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

Object initializer get/set accessor shorthand is not transpiled, breaks old browsers. #20

Closed
trusktr opened this issue Oct 9, 2017 · 6 comments
Labels

Comments

@trusktr
Copy link
Contributor

trusktr commented Oct 9, 2017

F.e., even with --target ie:8,

let o = { get foo() {return 1} }

is compiled to

var o = { get foo() {return 1} }

IE 11 throws the infamous "Expected object" error.

@trusktr
Copy link
Contributor Author

trusktr commented Oct 9, 2017

As a workaround, I'll process this with a post-buble babel step.

@trusktr
Copy link
Contributor Author

trusktr commented Oct 9, 2017

Actually, despite Buble having this bug, this output is appearing in module export code (after transpile), which Rollup handles.

If I downgrade from Rollup 0.50.0 to 0.45.2, the problem goes away! I'll make a new issue in Rollup. Nevermind, the problem is still there. I don't know how my code was previously working in IE11. I'll file in Rollup.

@trusktr
Copy link
Contributor Author

trusktr commented Oct 9, 2017

Here's the related issue in Rollup: rollup/rollup#1671

@adrianheine adrianheine added the bug label Dec 7, 2017
@adrianheine adrianheine changed the title [BUG] Object initializer get/set accessor shorthand is not transpiled, breaks old browsers. Object initializer get/set accessor shorthand is not transpiled, breaks old browsers. Dec 7, 2017
@nathancahill
Copy link
Collaborator

Is IE 11 a typo in this issue? Getters are supported since IE 9: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get#Browser_compatibility

@trusktr
Copy link
Contributor Author

trusktr commented Dec 18, 2017

It was a mistake, the other issue is closed. Closing this one too.

@trusktr trusktr closed this as completed Dec 18, 2017
adrianheine added a commit that referenced this issue Feb 14, 2018
This is off by default and only triggers if IE 8 is explicitly selected as
target. Closes #20.
@adrianheine
Copy link
Member

Babel doesn't handle this either, btw.

adrianheine added a commit that referenced this issue Oct 7, 2018
This is off by default and only triggers if IE 8 is explicitly selected as
target. Closes #20.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants