LivelyKernel / lively.ast

Parsing JS code into ASTs and tools to query and transform these trees.
4 stars 0 forks source link

capturing definition wrapper #8

Open rksm opened 7 years ago

rksm commented 7 years ago

When using a definition wrapping function via lively.ast.capturing.rewriteToCaptureTopLevelVariables(..., {declarationWrapper: astForDeclFunc}) then simple assignments are correctly wrapped:

i = i+1 becomes _rec.i = _rec._define('i', 'assignment', _rec.i + 1, _rec);

However, expressions like i++ or i+=1 aren't correctly identified as modifications and not wrapped.

Fix that!