jquery-screwed icon indicating copy to clipboard operation
jquery-screwed copied to clipboard

Bunch of calling to carry info

Open 837951602 opened this issue 8 years ago • 6 comments

I 6char-screwed jquery to less than 1MB but I needed to write a prototype and then delete it. Is it allowed?

837951602 avatar Feb 16 '17 13:02 837951602

That sounds quite cool B-) Why shouldn't it be allowed?

fasttime avatar Feb 16 '17 14:02 fasttime

https://github.com/837951602/jfuery/blob/master/jfuery.js

837951602 avatar Feb 16 '17 15:02 837951602

Thanks for the link! I really like the idea of a function returning a function to generate long strings. Probably this can be adapted to make it work for generic JS code. I couldn't get jfuery to run in older Android Stock browsers, but I'm sure that can be fixed with some tuning.

fasttime avatar Feb 16 '17 21:02 fasttime

Maybe some old environment have too small stack so it doesn't run correctly?

eval('(function(){return arguments.caller})'+Array(1e5).join('()')) VM185:2 Uncaught RangeError: Maximum call stack size exceededmessage: "Maximum call stack size exceeded"stack: (...)get stack: function () { [native code] }arguments: nullcaller: nulllength: 0name: ""prototype: StackTraceGetter__proto__: function Empty() {}set stack: function () { [native code] }proto: Error

837951602 avatar Feb 17 '17 02:02 837951602

Probably this can be adapted to make it work for generic JS code.

It's from the beginning workable generally. Generator is at https://github.com/837951602/jfuery/blob/master/generator.js, where base.txt is the common part and code.txt stores the code to be turned

837951602 avatar Feb 17 '17 04:02 837951602

With Object.defineProperty setting the function and Array.toString, can reach 4 bits/6 chars. Yet I don't know the compatibility

  • () undefined:(),([]),[[]]
  • ([]) []
  • (![]) false
  • (+[]) Num*
  • (!![]) true
  • (!+[]) false*
  • (+![]) 0*
  • ([[]])
  • [[]] ''*
  • [+[]] Num*
  • [![]] false
  • [!![]] true
  • [!+[]] false*
  • [+![]]
  • [[[]]]

837951602 avatar Feb 20 '17 03:02 837951602