Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

remove use strict #80

Closed
robdodson opened this issue Oct 8, 2014 · 4 comments
Closed

remove use strict #80

robdodson opened this issue Oct 8, 2014 · 4 comments

Comments

@robdodson
Copy link
Contributor

Can't call super when use strict is in place

@sindresorhus
Copy link
Member

I don't think removing use strict is the best option. If you can elaborate I'm sure there is a better way.

@robdodson
Copy link
Contributor Author

my understanding is that use strict will blow up when someone calls super() inside of a Polymer element. super() relies on .caller which is disabled in strict mode. Not sure if there's a workaround but @sjmiles may know

@sjmiles
Copy link

sjmiles commented Oct 9, 2014

You can only use strict if you never use super(), this is correct. There is no workaround, this is a hard line.

@sindresorhus
Copy link
Member

Lame :(

I guess you'll have to then...

Though I refuse to believe that you can't somehow implement super semantics in strict mode. Traceur is able to shim ES6 Classes super() just fine: https://github.com/google/traceur-compiler/blob/d4ce3695a9d3c1aa85b07da6f3262477192165d9/src/runtime/classes.js#L32-L42

robdodson added a commit that referenced this issue Oct 9, 2014
Remove `use strict` in elements. Fixes #80
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants