You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This supercedes my stupidity in be77679.
as [raised in chat][1] by @terinjokes, passing a list `(object a 1)` to
a macro and attempting to `this.evaluate` it caused unexpected results,
and passing `(object a 1 b 2)` failed altogether.
As mentioned, this was due to `eval` parsing "{ a: 1 }" as a block
statement containing a labelled literal. [More detail on SO here][2].
The fix is to wrap the JS generated from ObjectExpression AST nodes in
parentheses before evaluating it. As explained in the comments, we
still want this.evaluate to be able to evaluate statements, so I added
an if-branch for that and a test to cover it.
[1]: https://gitter.im/anko/eslisp?at=566a7415cffd648a0554eeeb
[2]: http://stackoverflow.com/questions/3731802
0 commit comments