Based on the bug found in tc39/ecma262#1320 (comment):
- If a non-writable prototype property exists during
o.foo = v
- Define a new property on
o with { value: v, enumerable: true, writable: true, configurable: true } (like it's defining a new property without extending the parent)
- Note: It must be configurable to get past the
delete statement when running getRawTag(new Uint8Array(0)).
- Extend
Object.prototype.toString() special cases with typed arrays, DataView, ArrayBuffer, Map, WeakMap, Set, WeakSet, Promise, etc.
- Note: With the ability to write
value[Symbol.toStringTag] = undefined, we must fix various builtins to still return the expected [object Foo] values.
- Note: This fixes lodash's
isTypedArray, isArrayBuffer, etc, functions directly, and the getTag function indirectly by ensuring a few feature checks don't fail and cause a incomplete impl of getTag to be used.
Based on the bug found in tc39/ecma262#1320 (comment):
o.foo = vowith{ value: v, enumerable: true, writable: true, configurable: true }(like it's defining a new property without extending the parent)deletestatement when runninggetRawTag(new Uint8Array(0)).Object.prototype.toString()special cases with typed arrays,DataView,ArrayBuffer,Map,WeakMap,Set,WeakSet,Promise, etc.value[Symbol.toStringTag] = undefined, we must fix various builtins to still return the expected[object Foo]values.isTypedArray,isArrayBuffer, etc, functions directly, and thegetTagfunction indirectly by ensuring a few feature checks don't fail and cause a incomplete impl ofgetTagto be used.