aemkei / jsfuck

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

Use unicode escape sequence instead of unescape #84

Closed hazzik closed 5 years ago

hazzik commented 5 years ago

Thanks to shorter backslash (#83) we can now use Unicode escape sequence. This shreds off around 1050 symbols from unmapped ASCI characters. Also, all remaining Unicode characters are now encoded in about 4000 symbols.

hazzik commented 5 years ago

@aemkei I have another optimization ready if you're interested: if the string contains unmapped characters, then instead of wrapping each individual character into a Function("return ")() it will wrap the whole string. This way it uses function wrap only once (about 2000 symbols), so the saving is 2000 per additional unmapped character.

aemkei commented 5 years ago

AARg, sorry. The other PRs caused a conflict. Can you please check that?

hazzik commented 5 years ago

Resolved

hazzik commented 5 years ago

~Please hold on merging this yet.~. Nah, all good false alarm.

aemkei commented 5 years ago

Hmm. It says it again:

This branch has conflicts that must be resolved.

hazzik commented 5 years ago

Resolved.

aemkei commented 5 years ago

Great work with the Unicode escapes! You are the best contributer now.

hazzik commented 5 years ago

Thanks