Skip to content
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

Bunch of calling to carry info #1

Open
837951602 opened this issue Feb 16, 2017 · 6 comments
Open

Bunch of calling to carry info #1

837951602 opened this issue Feb 16, 2017 · 6 comments

Comments

@837951602
Copy link

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

@fasttime
Copy link
Owner

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

@837951602
Copy link
Author

@fasttime
Copy link
Owner

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.

@837951602
Copy link
Author

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
Copy link
Author

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 837951602 changed the title [About the rule]Can I write a prototype and erase it? Bunch of calling to carry info Feb 17, 2017
@837951602
Copy link
Author

837951602 commented Feb 20, 2017

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*
  • [+![]]
  • [[[]]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants