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

Compiler crash when mixing goog.module and export #2358

Closed
evmar opened this issue Mar 7, 2017 · 1 comment
Closed

Compiler crash when mixing goog.module and export #2358

evmar opened this issue Mar 7, 2017 · 1 comment

Comments

@evmar
Copy link
Contributor

evmar commented Mar 7, 2017

This code is not valid, but the compiler shouldn't crash:

goog.module('ice');
export class Ice {
}
java.lang.RuntimeException: java.lang.RuntimeException: INTERNAL COMPILER ERROR.
Please file a bug at http://go/jscompiler-bug with this stack trace, sponge link, and repro steps (a CL# and a build target).

insertion point must be a statement: CLASS 2 [length: 14] [source_file: input0]
  Node(CLASS): input0:2:7
export class Ice {
  Parent(EXPORT): input0:2:0
export class Ice {

	at com.google.javascript.jscomp.CompilerExecutor.runInCompilerThread(CompilerExecutor.java:126)
	at com.google.javascript.jscomp.Compiler.runInCompilerThread(Compiler.java:763)
	at com.google.javascript.jscomp.Compiler.compile(Compiler.java:733)
	at com.google.javascript.jscomp.Compiler.compileModules(Compiler.java:724)

https://closure-compiler-debugger.appspot.com/#input0%3Dgoog.module('ice')%253B%250Aexport%2520class%2520Ice%2520%257B%250A%257D%250A%26input1%26conformanceConfig%26externs%26refasterjs-template%26includeDefaultExterns%3D1%26CHECK_SYMBOLS%3D1%26MISSING_PROPERTIES%3D1%26TRANSPILE%3D1%26CHECK_TYPES%3D1%26COMPUTE_FUNCTION_SIDE_EFFECTS%3D1%26INLINE_VARIABLES%3D1%26SMART_NAME_REMOVAL%3D1%26REMOVE_UNUSED_PROTOTYPE_PROPERTIES%3D1%26REMOVE_UNUSED_PROTOTYPE_PROPERTIES_IN_EXTERNS%3D1%26COLLAPSE_PROPERTIES%3D1%26DEVIRTUALIZE_PROTOTYPE_METHODS%3D1%26VARIABLE_RENAMING%3D1%26PROPERTY_RENAMING%3D1%26CLOSURE_PASS%3D1%26GENERATE_EXPORTS%3D1%26PRESERVE_TYPE_ANNOTATIONS%3D1%26PRETTY_PRINT%3D1

@lauraharker
Copy link
Contributor

The debugger link now doesn't crash and reports

WARNING - File cannot be a combination of goog.provide, goog.module, and/or ES6 module: input0

input0:2: ERROR - A file cannot be both a goog.module and an ES6 module.
export class Ice {
^^^^^^^^^^^^^^^^^^^

Closing the issue.

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

No branches or pull requests

3 participants