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

Breaking changes for 4.1.0 behavior #37

Closed
roderickhsiao opened this issue Jan 3, 2018 · 8 comments
Closed

Breaking changes for 4.1.0 behavior #37

roderickhsiao opened this issue Jan 3, 2018 · 8 comments

Comments

@roderickhsiao
Copy link

roderickhsiao commented Jan 3, 2018

Test cases

import ExtendableError from 'es6-error`;

class A extends ExtendableError {
  super('foo');
  this.name = 'bar';
} 

const errorA = new A();
console.log(errorA instanceof A)

On version
4.0.2 https://gist.github.com/tinder-rhsiao/aaa1082eb6575b7ee6f591f958adec61 will return true
4.1.0 https://gist.github.com/tinder-rhsiao/e8c7a1255f3def0ad4a72200a2c91dae returns false

doesn't seems transform-builtin-extend is outputting as is, not sure if it is expected.

@roderickhsiao
Copy link
Author

@bjyoungblood
Copy link
Owner

It does look like transform-builtin-extend was not being applied. I published v4.1.1 as a fix.

@roderickhsiao
Copy link
Author

Thanks for the prompt reply, verify the fix 🎇

@cyrilchapon
Copy link

Where is transform-builtin-extend you are talking about ?

I tried npm install @babel/transform-builtin-extend and npm install @babel/plugin-transform-builtin-extend but it didn't work

@bjyoungblood
Copy link
Owner

The package name on npm is babel-plugin-transform-builtin-extend (Github link). It's not owned or maintained by the Babel team.

@cyrilchapon
Copy link

Ok thanks bud @bjyoungblood

To finish on that topic, do you know if, nowadays, babel 7 is natively handling this correctly ?

(I have 2 apps, on with old school babel and one with pretty recent release, and wish I knew the status of this)

@bjyoungblood
Copy link
Owner

It looks like this was added in babel/babel#7020, but might not be bug-free yet (see babel/babel#7506).

FWIW, I tried compiling es6-error with Babel 7 (and no transform-builtin-extend). All the tests passed, and the output seemed to work fine under Node v9.9, but YMMV.

@cyrilchapon
Copy link

Ok thanks for your help ☺️

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

No branches or pull requests

3 participants