Skip to content

Commit

Permalink
[Refactor] use es-set-tostringtag
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 21, 2022
1 parent d107672 commit d220986
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"call-bind": "^1.0.2",
"define-properties": "^1.1.4",
"es-abstract": "^1.20.5",
"es-set-tostringtag": "^2.0.0",
"globalthis": "^1.0.3"
},
"auto-changelog": {
Expand Down
11 changes: 2 additions & 9 deletions shim.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
'use strict';

var CreateMethodProperty = require('es-abstract/2022/CreateMethodProperty');
var DefinePropertyOrThrow = require('es-abstract/2022/DefinePropertyOrThrow');
var globalThis = require('globalthis')();
var setToStringTag = require('es-set-tostringtag');

var getPolyfill = require('./polyfill');

module.exports = function shimReflectApply() {
if (typeof Reflect === 'undefined') {
var R = {};
if (typeof Symbol === 'function' && Symbol.toStringTag) {
DefinePropertyOrThrow(R, Symbol.toStringTag, {
'[[Configurable]]': true,
'[[Enumerable]]': false,
'[[Value]]': 'Reflect',
'[[Writable]]': false
});
}
setToStringTag(R, 'Reflect');
CreateMethodProperty(globalThis, 'Reflect', R);
}

Expand Down

0 comments on commit d220986

Please sign in to comment.