Following code throws runtime error: **Bug №1 ** Input: ``` var passthrough = (object) => object; var foo = {foo: 1}, bar = passthrough({bar: foo.foo}); console.log(bar.bar); ``` Output: ``` var passthrough = _0x15e948 => _0x15e948; var _0x1193f7 = {}; _0x1193f7['foo'] = 0x1; var _0x49746f = {}; _0x49746f['bar'] = foo['foo']; var foo = _0x1193f7, bar = passthrough(_0x49746f); console['log'](bar['bar']); ``` After extraction `{bar: foo.foo}` object is inserted before `foo` variable declaration **Bug №2** Input: ``` var passthrough = (object) => object; function test (foo = {foo: 1}, bar = {bar: foo.foo}) { return bar.bar; } console.log(test()); ``` With this code, looks like `maximum call stack` error will appear
Activity
sanex3339 commentedon Jan 22, 2020
I think the best way is to insert in the same VariableDeclaration array
Added more restrictions for object keys transformations