-
Notifications
You must be signed in to change notification settings - Fork 583
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
continuation.js missing from dist/commonjs/runtime in Traceur 0.0.110 #2126
Comments
It's worth saying that, as for the [email protected], the compilation-output ES5 JavaScript program works in the web browser. Is it a regression bug for the version 0.0.110? |
Please look in to your output for the The compiler generates Once you have a hint perhaps you can create a small test case. We did make some changes in the runtime. |
Given my investigation, the [email protected] ES5 code is very different from [email protected]. The below JS statement is inexistent in the [email protected] compilation result. On the contrary, in [email protected] compilation result, the above statement is in the 2nd line. However, in the web browser, the above JS statement brings about a NullPointer error, because $traceurRuntime.getModule($traceurRuntime.normalizeModuleName("traceur/dist/commonjs/runtime/modules/continuation.js", "widget-nest-thermostat.bbjs")) return null. The following picture shows the differences between [email protected] and [email protected] compilation results. |
Looks like |
I see dist/commonjs/runtime/modules/continuation.js in the npm release. I suspect there is cyclic dependency with the require that causes this to be undefined. I'll try to create a minimal test case. For now you can turn off |
Hey folks, thanks for the continued work on the project! 💃 |
Cloud you please teach me what the feature "importRuntime" takes on during the transformation from ES 6 to ES 5? |
I upgrade the Google Traceur to the latest 0.0.110. However, the compilation-output ES5 JavaScript program can't work in the web browser.
node_modules/.bin/traceur
--script=www/js/widget-nest-thermostat.bbjs
--out=www/js/widget-nest-thermostat.js
--require=true
--arrow-functions=true --block-binding=true --classes=true
--computed-property-names=true --default-parameters=true
--destructuring=true --for-of=true --generators=true --numeric-literals=true
--property-methods=true --property-name-shorthand=true --rest-parameters=true
--spread=true --symbols=true --template-literals=true --unicode-escape-sequences=true
--unicode-expressions=true --proper-tail-calls=true --annotations=true
--array-comprehension=true --async-functions=true --async-generators=true
--exponentiation=true --export-from-extended=true --for-on=true
--generator-comprehension=true --member-variables=true --spread-properties=true
--types=true --experimental --source-maps=file
The file "traceur-runtime.js" is copied from the folder "node_modules/traceur/bin".
By scanning the compilatio-output ES5 JS program, I discovered the error point is
var $__initTailRecursiveFunction = $traceurRuntime.getModule($traceurRuntime.normalizeModuleName("traceur/dist/commonjs/runtime/modules/initTailRecursiveFunction.js", "widget-nest-thermostat.bbjs")).default;
That's to say, $traceurRuntime.getModule($traceurRuntime.normalizeModuleName("traceur/dist/commonjs/runtime/modules/initTailRecursiveFunction.js", "widget-nest-thermostat.bbjs")) returns null.
Memo: in my project, ES6 JS file is suffixed with ".bbjs". After they are compiled, their corresponding ES5 file is ".js".
The text was updated successfully, but these errors were encountered: