javascript-obfuscator / javascript-obfuscator-ui

A web UI to the JavaScript Obfuscator node.js package.
https://obfuscator.io
BSD 2-Clause "Simplified" License
230 stars 130 forks source link

Object initializer with computed property names does not work #10

Closed oogFranz closed 7 years ago

oogFranz commented 7 years ago

I found that this obfuscator breaks the following code.

Before:

const key = 'bar';
const obj = {
    [key]: 1
};
console.log(obj.bar); // 1

After:

const key='bar';const obj={['key']:0x1};console['log'](obj['bar']);

Could you fix it?

ref. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#New_notations_in_ECMAScript_2015

oogFranz commented 7 years ago

Sorry, i just made wrong issue... Plz, ignore this.