Skip to content

fix(require.ensure): add ArrowFunctionExpression support: Fixes #959 - #3544

Merged
sokra merged 2 commits into
masterfrom
bugfix/add_require_ensure_arrow_function_expression_support
Dec 22, 2016
Merged

sokra merged 2 commits into
masterfrom
bugfix/add_require_ensure_arrow_function_expression_support

Conversation

@TheLarkInn

@TheLarkInn TheLarkInn commented Dec 21, 2016 •

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?
Bugfix. Fixes #959

  • require.ensure was erroring when passing arrow function as callback.
  • bumped uglify-js patch level deps
  • add node target cases for import()

Did you add tests for your changes?
Yes

If relevant, link to documentation update:
N/A

Summary

Does this PR introduce a breaking change?
No

Other information

@TheLarkInn
TheLarkInn requested a review from sokra December 21, 2016 20:12
});

it("should parse a string in require.ensure with arrow function expression", function(done) {
require.ensure("./file", require => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add a test with a single expression array function? They behave a bit different in AST.

require.ensure("./file", require => (require("./file").should.be.eql("ok"), done()))

@sokra
sokra merged commit 00a4fa6 into master Dec 22, 2016
@sokra

sokra commented Dec 22, 2016

Copy link
Copy Markdown
Member

Thanks

@sokra
sokra deleted the bugfix/add_require_ensure_arrow_function_expression_support branch December 22, 2016 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uncaught TypeError: Cannot read property 'call' of undefined

2 participants