lachrist / aran

JavaScript Code Instrumenter
https://lachrist.github.io/aran
MIT License
37 stars 4 forks source link

Property reading trap is not used #2

Closed ward closed 9 years ago

ward commented 9 years ago

Both o.a and o['a'] do not seem to get converted to aran.traps.get(o, a). For example with the Logger from the demo:

o.a

becomes

aran.hooks.Program(1);
{
    aran.hooks.Expression();
    aran.hooks.Member('a'), (aran.hooks.Identifier('o'), o).a;
}

Similarly

o['a']

becomes

aran.hooks.Program(1);
{
    aran.hooks.Expression();
    aran.hooks.Member(null), (aran.hooks.Identifier('o'), o)[aran.hooks.Literal('a'), aran.traps.primitive('a')];
}
lachrist commented 9 years ago

Thanks, fixed.