Closed canalun closed 6 months ago
Thanks, you are right, they should be non-writable.
Could you show for what collections and in what engines they are defined? With the current logic, they should be defined only in case of lack or inconsistency @@toStringTag
on DOM collections prototypes.
Thanks :)
writable
of Symbol.toStringTag
property is changed: as follows
CSSRuleList
CSSStyleDeclaration
DOMRectList
DOMStringList
DOMTokenList
DataTransferItemList
FileList
HTMLAllCollection
HTMLCollection
HTMLFormElement
HTMLSelectElement
MediaList
MimeTypeArray
NamedNodeMap
NodeList
Plugin
PluginArray
SVGLengthList
SVGNumberList
SVGPointList
SVGStringList
SVGTransformList
SourceBufferList
StyleSheetList
TextTrackCueList
TextTrackList
TouchList
I checked by using the below page. https://codesandbox.io/p/sandbox/determined-bose-sk7wqw
Ok, thanks, here is a wrong condition.
classof(CollectionPrototype) !== TO_STRING_TAG
instead of classof(CollectionPrototype) !== COLLECTION_NAME
Got it, thanks :) I'll try to patch it!
Here also required some other changes, I already made them -)
wow, really thanks...!! I'm trying it on my environment now :)
The problem has been resolved, thank you so much for your quick response! ! !
Hi, core-js team. Thank you for developing this great library.
Background
packages/core-js-pure/override/modules/web.dom-collections.iterator.js
setswritable
ofSymbol.toStringTag
property of DOM Iterables as true. That is becausecreateNonEnumerableProperty()
defines PropertyDescriptor withwritable: true
.As a result, the presence or absence of core-js affects some systems whose behavior changes depending on the
writable
value. For example, this part of lodash will be affected.Question
writable
value ofSymbol.toStringTag
property of DOM Iterables? (I'm thinking about patching to stop this overwrite on my application using core-js. Of course, if I can help anything, I'd like to contribute to core-js also.)packages/core-js-pure/override/modules/web.dom-collections.iterator.js
, is in core-js-pure. I've thought that core-js will never overwrite prototypes. It's not correct??