Skip to content

refactor(ModuleError): upgrade to ES6#3695

Merged
TheLarkInn merged 1 commit into
webpack:masterfrom
willmendesneto:refactor-module-error
Jan 3, 2017
Merged

refactor(ModuleError): upgrade to ES6#3695
TheLarkInn merged 1 commit into
webpack:masterfrom
willmendesneto:refactor-module-error

Conversation

@willmendesneto

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

ES5 => ES6 refactor

Did you add tests for your changes?

refactor, all existing tests pass

If relevant, link to documentation update:

N/A

Summary

Helping in part of the ES6 refactor

Does this PR introduce a breaking change?

Nope

Comment thread lib/ModuleError.js
constructor(module, err) {
super();
if(Error.hasOwnProperty("captureStackTrace")) {
Error.captureStackTrace(this, this.constructor);

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.

This should be new.target instead of this.constructor... but Node 4 doesn't support it 😢

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.

Once we drop Node 4 and update engine, the linter should catch this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I notice the same @Kovensky :(

Comment thread lib/ModuleError.js
constructor(module, err) {
super();
if(Error.hasOwnProperty("captureStackTrace")) {
Error.captureStackTrace(this, this.constructor);

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.

Once we drop Node 4 and update engine, the linter should catch this

@TheLarkInn

Copy link
Copy Markdown
Member

Thank you so much!

@TheLarkInn TheLarkInn merged commit 6a2840f into webpack:master Jan 3, 2017
@willmendesneto willmendesneto deleted the refactor-module-error branch January 3, 2017 22:34
timse pushed a commit to timse/webpack that referenced this pull request Jan 4, 2017
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.

3 participants