-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: unreachable code in ES5.js #2
Comments
Hmm, good question. It's not intentional. In the spec, ToPrimitive points to https://es5.github.io/#x8.12.8, so it actually appears like lines https://github.com/ljharb/es-to-primitive/blob/master/es5.js#L40-L46 should be deleted. However, it's also possible that using |
Turns out I had a bunch of incorrect stuff in my ES5 tests. Fixing it, and removing https://github.com/ljharb/es-to-primitive/blob/master/es5.js#L40-L46, plus one minor fix in https://github.com/ljharb/es-to-primitive/blob/master/es5.js#L11-L28, has the correct tests passing. |
…y primitive value, regardless of hint. Discovered per #2.
Thanks, I came across it when I started looking at using |
…y primitive value, regardless of hint. Discovered per #2.
In ES5.js, the following line is unreachable.
https://github.com/ljharb/es-to-primitive/blob/master/es5.js#L47
Which in turn, it seems that
ES5internalSlots
is never called.https://github.com/ljharb/es-to-primitive/blob/master/es5.js#L10
And
IsCallable
is loaded but never used.https://github.com/ljharb/es-to-primitive/blob/master/es5.js#L7
Is this intentional?
The text was updated successfully, but these errors were encountered: