-
Notifications
You must be signed in to change notification settings - Fork 112
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
JsChecker crashes when assigning an arrow function to a var in a class #496
Comments
ES6 Class field initialization is a non-finalized spec (Level 3 as of this writing) and not supported by Closure Compiler yet. If you like you can file a bug there to track. |
@gkdn — I understand this is a not-yet-supported JS feature in JsCompiler, but please note that JsCompiler doesn't crash with the same input:
I am not expecting JsChecker to support JS features that even JsCompiler doesn't support yet, but it seems like a bug that JsChecker crashes with an internal error for any user input, even if the input has invalid/unsupported syntax. Would it be possible to update JsChecker to proxy the error output from JsCompiler, so that developers can debug & fix their code just using |
JsChecker uses JsCompiler directly so there should be no behavior difference which suggests that you are very likely testing with a different version of JsCompiler than the one used current with rules_closure. |
@gkdn wrote:
The commit of this repo I'm using (62746bd) includes JsCompiler version v20200614 (as of commit d69cb55), but the output from JsCompiler is the same at that version as well:
It's also the same using an even earlier version of Closure Compiler (previously referenced in this repo, and updated in commit d69cb55):
so this behavior has been the same in Closure Compiler for a while, and it looks like JsChecker has diverged. |
Ok the behavior difference is then probably due to selected language from JsChecker: LanguageMode.ECMASCRIPT_2017 while using JsCompiler. It should be using ECMASCRIPT_NEXT or STABLE_IN to not fall behind. You can probably repro the issue with JsCompiler using Thanks for digging this. |
JsCompiler doesn't crash when using
Or the more recent one:
|
Got it; need to dig where the exception escapes. Re-opening the issue. |
I reproduced the issue with Closure compiler; you need to pass |
I'm using latest commit of
rules_closure
because the latest release (0.10.0) is quite old (Oct 2019), and I've run into similar issues there as well.Here's a relevant excerpt from my
WORKSPACE
:I've created
closure_js_library()
andclosure_js_binary()
rules to compile Preact Todo MVC, but I'm running into various compiler errors.Here's a minified example (
index.min.js
):Here's the failure:
which results in the following output:
The text was updated successfully, but these errors were encountered: