277hz
277hz
@xeioex As everything needed to make it work already is implemented, I managed to come up with a patch for njs_parser.c: https://gist.github.com/277hz/b68936f0b845d96a3dda2bfaf025cb69 ``` >> ((a, b, c, d) => console.log(a,...
I spent some more time trying to solve this and think I am very close now to a working solution for functions and arrays. It is a little bit more...
Not all aspects of spreading will be solveable in the parser, but it should reduce the complexity without being much of a performance penalty. Going further will require me to...
Getting closer :) ``` >> var a = [1,2,3], b = [0,...a,[4,...a]]; console.log(a,b); [1,2,3] [0,1,2,3,[4,1,2,3]] ```
@drsm @xeioex @lexborisov My idea is to add an operation if a name to be spread is found. Then copy the spread variable into the target array during, or more...
@drsm > I don't think this is possible, because the shift index is dynamic. Using concat was on my mind, too, but I am looking for a way to avoid...
Small comparison between output of node and my evolving patch, first line corresponds to node, second to njs: ``` > var x = [0,1]; console.log(x.length, JSON.stringify(x = [,,...x,,...x,-1,-2,,[...x,,],,]), x.length); 2...
@drsm Thank you, just the examples I was looking for. @lexborisov: Whats mostly missing still, is support for spreading function arguments, as I have not decided on how to manipulate...
Almost there: ``` === Summary === - Ran 34658 tests - - Passed 13513 tests (39.0%) - - Failed 21145 tests (61.0%) + - Passed 13573 tests (39.2%) + -...
@lexborisov https://gist.github.com/277hz/b68936f0b845d96a3dda2bfaf025cb69 Thank you for taking the time. I really wanted to leave some architectural decisions up to you, like adding a new vmcode_t, moving everything into its own function...