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

Should we detect whether classes are used in strict mode for Node 4, 5 and Chrome 48? #66

Closed
adrianheine opened this issue Dec 4, 2017 · 5 comments

Comments

@adrianheine
Copy link
Member

Node 4, 5 and Chrome 48 only support classes in strict mode. Currently, we think Chrome 48 does not support classes and Node 4 and 5 do. Should we introduce separate support matrix entries for classes in strict mode and everywhere and do all the work to distinguish them?

This is relevant because @Rich-Harris decided in #43 to only support Node 4 and upwards to work around #40 when self-transpiling. Since we are using modules, all our code is in strict mode, so we could continue keeping classes as they are for Node 4 and 5 if bublé were clever enough to distinguish between strict and sloppy mode and know about Node's and Chrome's peculiarity.

@adrianheine
Copy link
Member Author

Another viable option would be to mark Node 4 and 5 as not supporting classes but explicitly disable class transpiling for the own build.

@kzc
Copy link
Contributor

kzc commented Dec 5, 2017

Node 4 is pretty broken standard-wise. Aside from the class problem, it is neither ES5 nor ES6 compliant related to scope handling for let and const. Probably best to mark Node 4 as not supporting classes.

@adrianheine
Copy link
Member Author

Should we then explicitly disable class transpiling for our build so that we can continue supporting Node 4?

@kzc
Copy link
Contributor

kzc commented Dec 5, 2017

In spite of Node 4's brokenness, it would be nice to support Node 4 as a Bublé target and to host Bublé itself. I don't know what's the cleanest way to accomplish that. Disabling class transpiling for Node 4 might be easiest.

@adrianheine
Copy link
Member Author

Since we parse everything as a module and modules are always in strict mode, we expect the input to be in strict mode anyway. As such, we can also require that the output is considered strict mode code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants