Forráskód Böngészése

Merge branch 'master' into optimize-long-strings

Alex Zaytsev 4 éve
szülő
commit
f0d6adb547
3 módosított fájl, 78 hozzáadás és 78 törlés
  1. 1 1
      README.md
  2. 13 13
      jsfuck.js
  3. 64 64
      output.txt

+ 1 - 1
README.md

@@ -270,7 +270,7 @@ Note: This symbol could also be replaced by others, like `<` or `=`. See the sec
 
 
 ### `!X` – Cast to Boolean
 ### `!X` – Cast to Boolean
 
 
-The logical "Not" operator can be used to create booelans `false` and `true`:
+The logical "Not" operator can be used to create booleans `false` and `true`:
 
 
 ```js
 ```js
  ![] // false
  ![] // false

+ 13 - 13
jsfuck.js

@@ -16,7 +16,7 @@
     'Number':   '(+[])',
     'Number':   '(+[])',
     'String':   '([]+[])',
     'String':   '([]+[])',
     'Boolean':  '(![])',
     'Boolean':  '(![])',
-    'Function': '[]["fill"]',
+    'Function': '[]["flat"]',
     'RegExp':   'Function("return/"+false+"/")()',
     'RegExp':   'Function("return/"+false+"/")()',
     'Object':	'[]["entries"]()'
     'Object':	'[]["entries"]()'
   };
   };
@@ -24,7 +24,7 @@
   const MAPPING = {
   const MAPPING = {
     'a':   '(false+"")[1]',
     'a':   '(false+"")[1]',
     'b':   '([]["entries"]()+"")[2]',
     'b':   '([]["entries"]()+"")[2]',
-    'c':   '([]["fill"]+"")[3]',
+    'c':   '([]["flat"]+"")[3]',
     'd':   '(undefined+"")[2]',
     'd':   '(undefined+"")[2]',
     'e':   '(true+"")[3]',
     'e':   '(true+"")[3]',
     'f':   '(false+"")[0]',
     'f':   '(false+"")[0]',
@@ -36,7 +36,7 @@
     'l':   '(false+"")[2]',
     'l':   '(false+"")[2]',
     'm':   '(Number+"")[11]',
     'm':   '(Number+"")[11]',
     'n':   '(undefined+"")[1]',
     'n':   '(undefined+"")[1]',
-    'o':   '(true+[]["fill"])[10]',
+    'o':   '(true+[]["flat"])[10]',
     'p':   '(+(211))["to"+String["name"]](31)[1]',
     'p':   '(+(211))["to"+String["name"]](31)[1]',
     'q':   '("")["fontcolor"]([0]+false+")[20]',
     'q':   '("")["fontcolor"]([0]+false+")[20]',
     'r':   '(true+"")[1]',
     'r':   '(true+"")[1]',
@@ -52,7 +52,7 @@
     'A':   '(+[]+Array)[10]',
     'A':   '(+[]+Array)[10]',
     'B':   '(+[]+Boolean)[10]',
     'B':   '(+[]+Boolean)[10]',
     'C':   'Function("return escape")()(("")["italics"]())[2]',
     'C':   'Function("return escape")()(("")["italics"]())[2]',
-    'D':   'Function("return escape")()([]["fill"])["slice"]("-1")',
+    'D':   'Function("return escape")()([]["flat"])["slice"]("-1")',
     'E':   '(RegExp+"")[12]',
     'E':   '(RegExp+"")[12]',
     'F':   '(+[]+Function)[10]',
     'F':   '(+[]+Function)[10]',
     'G':   '(false+Function("return Date")()())[30]',
     'G':   '(false+Function("return Date")()())[30]',
@@ -76,16 +76,16 @@
     'Y':   null,
     'Y':   null,
     'Z':   null,
     'Z':   null,
 
 
-    ' ':   '(NaN+[]["fill"])[11]',
+    ' ':   '(NaN+[]["flat"])[11]',
     '!':   null,
     '!':   null,
     '"':   '("")["fontcolor"]()[12]',
     '"':   '("")["fontcolor"]()[12]',
     '#':   null,
     '#':   null,
     '$':   null,
     '$':   null,
-    '%':   'Function("return escape")()([]["fill"])[21]',
+    '%':   'Function("return escape")()([]["flat"])[21]',
     '&':   '("")["fontcolor"](")[13]',
     '&':   '("")["fontcolor"](")[13]',
     '\'':  null,
     '\'':  null,
-    '(':   '([]["fill"]+"")[13]',
-    ')':   '([0]+false+[]["fill"])[20]',
+    '(':   '([]["flat"]+"")[13]',
+    ')':   '([0]+false+[]["flat"])[20]',
     '*':   null,
     '*':   null,
     '+':   '(+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]])+[])[2]',
     '+':   '(+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]])+[])[2]',
     ',':   '([]["slice"]["call"](false+"")+"")[1]',
     ',':   '([]["slice"]["call"](false+"")+"")[1]',
@@ -105,9 +105,9 @@
     '^':   null,
     '^':   null,
     '_':   null,
     '_':   null,
     '`':   null,
     '`':   null,
-    '{':   '(true+[]["fill"])[20]',
+    '{':   '(true+[]["flat"])[20]',
     '|':   null,
     '|':   null,
-    '}':   '([]["fill"]+"")["slice"]("-1")',
+    '}':   '([]["flat"]+"")["slice"]("-1")',
     '~':   null
     '~':   null
   };
   };
 
 
@@ -296,19 +296,19 @@
     }
     }
 
 
     if (hasUnmappedCharacters) {
     if (hasUnmappedCharacters) {
-      output = "[][" + encode("fill") + "]"+
+      output = "[][" + encode("flat") + "]"+
       "[" + encode("constructor") + "]" +
       "[" + encode("constructor") + "]" +
       "(" + encode("return\"") + "+" + output + "+" + encode("\"") + ")()";
       "(" + encode("return\"") + "+" + output + "+" + encode("\"") + ")()";
     }
     }
 
 
     if (wrapWithEval){
     if (wrapWithEval){
       if (runInParentScope){
       if (runInParentScope){
-        output = "[][" + encode("fill") + "]" +
+        output = "[][" + encode("flat") + "]" +
           "[" + encode("constructor") + "]" +
           "[" + encode("constructor") + "]" +
           "(" + encode("return eval") + ")()" +
           "(" + encode("return eval") + ")()" +
           "(" + output + ")";
           "(" + output + ")";
       } else {
       } else {
-        output = "[][" + encode("fill") + "]" +
+        output = "[][" + encode("flat") + "]" +
           "[" + encode("constructor") + "]" +
           "[" + encode("constructor") + "]" +
           "(" + output + ")()";
           "(" + output + ")()";
       }
       }

+ 64 - 64
output.txt

@@ -1,19 +1,19 @@
-` ` 109
-`!` 3983
-`"` 539
-`#` 3992
-`$` 3997
-`%` 2551
-`&` 1083
-`'` 4012
-`(` 114
-`)` 114
-`*` 3992
+` ` 92
+`!` 3558
+`"` 471
+`#` 3567
+`$` 3572
+`%` 2262
+`&` 947
+`'` 3587
+`(` 97
+`)` 97
+`*` 3567
 `+` 70
 `+` 70
-`,` 393
+`,` 359
 `-` 135
 `-` 135
 `.` 72
 `.` 72
-`/` 266
+`/` 249
 `0` 8
 `0` 8
 `1` 10
 `1` 10
 `2` 14
 `2` 14
@@ -24,72 +24,72 @@
 `7` 39
 `7` 39
 `8` 44
 `8` 44
 `9` 49
 `9` 49
-`:` 1864
-`;` 1085
-`<` 254
-`=` 535
-`>` 260
-`?` 1859
-`@` 3973
-`A` 573
-`B` 576
-`C` 2707
-`D` 2884
-`E` 1865
-`F` 656
-`G` 3833
-`H` 3975
+`:` 1677
+`;` 949
+`<` 237
+`=` 467
+`>` 243
+`?` 1672
+`@` 3548
+`A` 505
+`B` 508
+`C` 2418
+`D` 2578
+`E` 1678
+`F` 571
+`G` 3425
+`H` 3550
 `I` 70
 `I` 70
-`J` 3981
-`K` 3986
-`L` 3991
-`M` 3834
+`J` 3556
+`K` 3561
+`L` 3566
+`M` 3426
 `N` 16
 `N` 16
-`O` 732
-`P` 3979
-`Q` 3981
-`R` 1860
-`S` 578
-`T` 3836
-`U` 2227
-`V` 4005
-`W` 4010
-`X` 3984
-`Y` 3986
-`Z` 3990
+`O` 664
+`P` 3554
+`Q` 3556
+`R` 1673
+`S` 510
+`T` 3428
+`U` 1989
+`V` 3580
+`W` 3585
+`X` 3559
+`Y` 3561
+`Z` 3565
 `[` 171
 `[` 171
-`\` 2121
+`\` 1917
 `]` 189
 `]` 189
-`^` 4010
-`_` 4015
-``` 3989
+`^` 3585
+`_` 3590
+``` 3564
 `a` 15
 `a` 15
 `b` 177
 `b` 177
-`c` 106
+`c` 89
 `d` 22
 `d` 22
 `e` 25
 `e` 25
 `f` 13
 `f` 13
-`g` 588
-`h` 1372
+`g` 520
+`h` 1219
 `i` 27
 `i` 27
 `j` 182
 `j` 182
-`k` 1361
+`k` 1208
 `l` 19
 `l` 19
-`m` 577
+`m` 509
 `n` 18
 `n` 18
-`o` 105
-`p` 1383
-`q` 1086
+`o` 88
+`p` 1230
+`q` 950
 `r` 16
 `r` 16
 `s` 24
 `s` 24
 `t` 14
 `t` 14
 `u` 16
 `u` 16
-`v` 1377
-`w` 1386
-`x` 1391
+`v` 1224
+`w` 1233
+`x` 1238
 `y` 84
 `y` 84
-`z` 1416
-`{` 109
-`|` 4020
-`}` 442
-`~` 4030
+`z` 1263
+`{` 92
+`|` 3595
+`}` 408
+`~` 3605