es6.reflect.prevent-extensions.js 424 B

12345678910111213141516
  1. // 26.1.12 Reflect.preventExtensions(target)
  2. var $export = require('./_export');
  3. var anObject = require('./_an-object');
  4. var $preventExtensions = Object.preventExtensions;
  5. $export($export.S, 'Reflect', {
  6. preventExtensions: function preventExtensions(target) {
  7. anObject(target);
  8. try {
  9. if ($preventExtensions) $preventExtensions(target);
  10. return true;
  11. } catch (e) {
  12. return false;
  13. }
  14. }
  15. });