Artem S. Povalyukhin
Artem S. Povalyukhin
Here is the patch: https://gist.github.com/drsm/b14d125ebcdeb244578030496c474ee5 Test242 diff: https://gist.github.com/drsm/10148c0799d6cab661ec8ccbd90faee5
@hongzhidao found another weird case: ```js >> for (var x = x in [1,2]; !x; x = 1) console.log(x); false undefined ``` vs. ```js > for (var x = x...
@hongzhidao @xeioex Actually we have a bug (global scope in accumulative mode): 1. ```js // njs >> var get = () => a; undefined >> var set = () =>...
@277hz > shift the following indexes accordingly. I don't think this is possible, because the shift index is dynamic. Maybe the same way we do in template literals will work:...
> Did I miss any other weird combinations that are possible in javascript? How about `Symbol.iterator` hijacking? ```js > var x = []; x[Symbol.iterator] = () => [1,2,3].values(); [...x] [...
@277hz ```js >> var a = [], b = () => [...a,...a]; b(); Segmentation fault (core dumped) ``` ```js > [...([1,2,3])] [ 1, 2, 3 ] > [...(void 0, [1,2,3])]...
@277hz Hi! One thing about these optimizations: ```js //Handled in parser without additional vmcode: [ ...[1,2,3], ...[1,2,3], 4, 5, 6 ] (()=>{})( ...[1,2,3], ...[1,2,3], 4, 5, 6 ) ``` there...
example: ```js function seq(n) { var i = 0; return { [Symbol.iterator]() { return { next() { if (i == n) { return { done: true }; } return {...
@VBart Hi! Actually, there is a huge difference between `for of` and `for in`: ```js function collatz(n) { var seq = [n]; for (var x of seq) { if (x...
@xeioex Please take a look. [Introduced initial iterator support.](https://gist.github.com/drsm/cfc7c820512f4c48690db0c144db58f6) [test262.diff](https://gist.github.com/drsm/4118f27d70de8d8ce56c7d95adae0ac8) Practically useless, because iteration will generate O(n) temporary objects. But by introducing some new vmcodes, the O(1) `for( of )`...