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 ab6fec0 commit 06ddf53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/map-iterator.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
'use strict';

var hasSymbols = require('has-symbols')();
var SLOT = require('internal-slot');
var setToStringTag = require('es-set-tostringtag');

var GetIntrinsic = require('get-intrinsic');
var CreateIterResultObject = require('es-abstract/2022/CreateIterResultObject');
var CreateMethodProperty = require('es-abstract/2022/CreateMethodProperty');
var DefinePropertyOrThrow = require('es-abstract/2022/DefinePropertyOrThrow');
var OrdinaryObjectCreate = require('es-abstract/2022/OrdinaryObjectCreate');

var requireMapSlot = require('./validation').requireMapSlot;
Expand Down Expand Up @@ -69,13 +68,6 @@ CreateMethodProperty(
}
);

if (hasSymbols && Symbol.toStringTag) {
DefinePropertyOrThrow(MapIterator.prototype, Symbol.toStringTag, {
'[[Configurable]]': true,
'[[Enumerable]]': false,
'[[Value]]': 'Map Iterator',
'[[Writable]]': false
});
}
setToStringTag(MapIterator.prototype, 'Map Iterator');

module.exports = MapIterator;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"define-properties": "^1.1.4",
"es-abstract": "^1.20.5",
"es-get-iterator": "^1.1.2",
"es-set-tostringtag": "^1.0.0",
"for-each": "^0.3.3",
"get-intrinsic": "^1.1.3",
"globalthis": "^1.0.3",
Expand Down

0 comments on commit 06ddf53

Please sign in to comment.