Skip to content
New issue

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

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

Already on GitHub? # to your account

minify-dead-code-elimination remove-use-strict fails with async/await #641

Closed
swernerx opened this issue Aug 4, 2017 · 1 comment
Closed
Labels
bug Confirmed bug

Comments

@swernerx
Copy link

swernerx commented Aug 4, 2017

Input Code

async function wait() {
  await loadData()
}

Actual Output

Throws the following error:

TypeError: ./__tests__/__fixtures__/es2017_async-await.js: block.get(...).filter is not a function
      
      at getUseStrictDirectives (node_modules/babel-plugin-minify-dead-code-elimination/lib/remove-use-strict.js:50:34)
      at removeUseStrict (node_modules/babel-plugin-minify-dead-code-elimination/lib/remove-use-strict.js:21:20)
      at PluginPass.exit (node_modules/babel-plugin-minify-dead-code-elimination/lib/index.js:844:13)
      at newFn (node_modules/babel-traverse/lib/visitors.js:276:21)
      at NodePath._call (node_modules/babel-traverse/lib/path/context.js:76:18)
      at NodePath.call (node_modules/babel-traverse/lib/path/context.js:48:17)
      at NodePath.visit (node_modules/babel-traverse/lib/path/context.js:117:8)
      at TraversalContext.visitQueue (node_modules/babel-traverse/lib/context.js:150:16)
      at TraversalContext.visitSingle (node_modules/babel-traverse/lib/context.js:108:19)
      at TraversalContext.visit (node_modules/babel-traverse/lib/context.js:192:19)
      at Function.Object.<anonymous>.traverse.node (node_modules/babel-traverse/lib/index.js:114:17)

Expected Output

Somewhat like this:

async function wait(){await loadData()}

Details

Plugin version: 0.1.7

@boopathi boopathi added the bug Confirmed bug label Aug 4, 2017
@boopathi
Copy link
Member

boopathi commented Aug 4, 2017

#602 fixes this. Will release a new version soon.

@boopathi boopathi closed this as completed Aug 4, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

2 participants