aemkei / jsfuck

Write any JavaScript with 6 Characters: []()!+
jsfuck.com
Do What The F*ck You Want To Public License
8.16k stars 674 forks source link

'&' !== ("")["link"](0+")[10] #63

Closed jserNc closed 5 years ago

jserNc commented 7 years ago

Expression ("")"link"[10] error : Uncaught SyntaxError: Invalid or unexpected token

aemkei commented 5 years ago

Looks like it was introduced here:

https://github.com/aemkei/jsfuck/commit/b618bf470c21ed3f76dc267c1feefe7e4d684490

cc @subzey

hazzik commented 5 years ago

@aemkei, @jserNc. What are the evidences of that '&' !== ("")["link"](0+")[10]? Which browser?

The repository has tests, and according to these tests all ASCII7 characters are generated correctly and produce correct results.

Because of the peculiarity of how the substitutions work in the JSFuck the " symbol if needed to be substituted by the code should not be enclosed into the quotes ('"') or escaped (\"). The original expression for & is ("")["link"](0+'"')[10] (note the difference between what's in the code and here: the " is not escaped). So, obviously this would not work as the string does not have a closing quote.

So, I assume that the @jserNc is trying to evaluate the above raw expression in the console window of the browser.

> ("")["link"](0+")[10]
VM63:1 Uncaught SyntaxError: Invalid or unexpected token
> ("")["link"](0+'"')[10]
"&"

I believe this is not an issue and shall be closed.

aemkei commented 5 years ago

You are right. Thanks for the clarification!