Skip to content

Commit

Permalink
set toStringTag to DOM collections in the pure version only if they c…
Browse files Browse the repository at this point in the history
…an't be identified by `classof`
  • Loading branch information
zloirock committed Dec 24, 2019
1 parent 8b9f774 commit a2fae8e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require('./es.array.iterator');
var DOMIterables = require('../internals/dom-iterables');
var global = require('../internals/global');
var classof = require('../internals/classof');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var Iterators = require('../internals/iterators');
var wellKnownSymbol = require('../internals/well-known-symbol');
Expand All @@ -10,7 +11,7 @@ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
for (var COLLECTION_NAME in DOMIterables) {
var Collection = global[COLLECTION_NAME];
var CollectionPrototype = Collection && Collection.prototype;
if (CollectionPrototype && !CollectionPrototype[TO_STRING_TAG]) {
if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {
createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
}
Iterators[COLLECTION_NAME] = Iterators.Array;
Expand Down

0 comments on commit a2fae8e

Please sign in to comment.