Closed 12wrigja closed 3 years ago
https://github.com/GoogleChromeLabs/jsbi/blob/c80c3ae61ca16fd37be76671fcf33df494369b34/lib/jsbi.ts#L1764-L1769
My understanding is that this code won't work in IE11 as neither Symbol or Symbol.toPrimitive are defined there.
Is using toPrimitive necessary, or could it be removed? If it is needed, then I would suggest wrapping it in some typeof checks:
if (typeof Symbol !== "undefined" && typeof Symbol.toPrimitive === "symbol" ) { ... existing code here ... }
I can send a PR for the above, but wanted to check and see whether this code is even needed before continuing down this path.
Yes, that code is needed for spec compliance, it's an implementation of https://tc39.es/ecma262/#sec-toprimitive.
+1 to wrapping it in the checks you suggest.
https://github.com/GoogleChromeLabs/jsbi/blob/c80c3ae61ca16fd37be76671fcf33df494369b34/lib/jsbi.ts#L1764-L1769
My understanding is that this code won't work in IE11 as neither Symbol or Symbol.toPrimitive are defined there.
Is using toPrimitive necessary, or could it be removed? If it is needed, then I would suggest wrapping it in some typeof checks:
I can send a PR for the above, but wanted to check and see whether this code is even needed before continuing down this path.