Skip to content

Transform object keys causes error  #516

Closed

Description

@sanex3339

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

  1. sanex3339 commented on Jan 22, 2020

    @sanex3339
    MemberAuthor

    I think the best way is to insert in the same VariableDeclaration array

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions