Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with Async/Await #231

Closed
fab1o opened this issue Mar 24, 2018 · 11 comments
Closed

Not working with Async/Await #231

fab1o opened this issue Mar 24, 2018 · 11 comments

Comments

@fab1o
Copy link

fab1o commented Mar 24, 2018

How to make it work with async/await?

test.js

export default class Request {
  static async get() {
   return window.fetch("...");
  }
}

javascript-obfuscator test.js

On Windows Powershell:

               ^
Error: Line 2: Unexpected identifier
> ...tic async get() {...
    at Function.value (....\node_modules\javascript-obfuscator\dist\index.js:1:63377)
Exit code: 1

Tried yarn add using both #master branch and @latest

@sanex3339
Copy link
Member

sanex3339 commented Mar 24, 2018

@sanex3339
Copy link
Member

Lol. This is more fun than i expected! Just see this issue.

Esprima cannot parse class method named async get() #1875

jquery/esprima#1875

@sanex3339
Copy link
Member

sanex3339 commented Mar 24, 2018

I'll investigate switch from esprima on acorn. It working with the same AST format, so it should be easy.

@sanex3339
Copy link
Member

#233

@sanex3339
Copy link
Member

I will switch from esprima on espree

@sanex3339
Copy link
Member

Hi. Fix in master branch. You can use it from this branch until 0.15.0 release.

@fab1o
Copy link
Author

fab1o commented Mar 26, 2018

Works! Thanks @sanex3339. In case someone else is also having this issue using webpack, here is my set up in package.json:

  "dependencies": {
    "javascript-obfuscator": "javascript-obfuscator/javascript-obfuscator#master",
    "webpack": "3.*",
    "webpack-dev-server": "2.*",
    "webpack-obfuscator": "0.14.3"
  },
  "resolutions": {
    "webpack-obfuscator/**/javascript-obfuscator":
      "javascript-obfuscator/javascript-obfuscator#master"
  },

@fab1o fab1o closed this as completed Mar 26, 2018
@sanex3339
Copy link
Member

I reopened issue untill 0.15.0 release

@sanex3339 sanex3339 reopened this Mar 26, 2018
@sanex3339
Copy link
Member

javascript-obfuscator@0.15.0 just published to the npm!

@bgbruno
Copy link

bgbruno commented Apr 15, 2021

it is @2021 and I have still that issue
Q pls what is the solution ?

@sanex3339
Copy link
Member

sanex3339 commented Apr 15, 2021

@bgbruno please show me your code, obfuscator version and other details

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

No branches or pull requests

3 participants