yeoman / generator-polymer

Scaffold out a Polymer project
http://polymer-project.org
926 stars 150 forks source link

remove use strict #80

Closed robdodson closed 10 years ago

robdodson commented 10 years ago

Can't call super when use strict is in place

sindresorhus commented 10 years ago

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

robdodson commented 10 years ago

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 commented 10 years ago

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

sindresorhus commented 10 years ago

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