web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
659 B

  1. var $ = require('../internals/export');
  2. var FREEZING = require('../internals/freezing');
  3. var fails = require('../internals/fails');
  4. var isObject = require('../internals/is-object');
  5. var onFreeze = require('../internals/internal-metadata').onFreeze;
  6. // eslint-disable-next-line es/no-object-freeze -- safe
  7. var $freeze = Object.freeze;
  8. var FAILS_ON_PRIMITIVES = fails(function () { $freeze(1); });
  9. // `Object.freeze` method
  10. // https://tc39.es/ecma262/#sec-object.freeze
  11. $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
  12. freeze: function freeze(it) {
  13. return $freeze && isObject(it) ? $freeze(onFreeze(it)) : it;
  14. }
  15. });