-
Notifications
You must be signed in to change notification settings - Fork 283
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
Fixes Node.js compilers writing to STDOUT and/or STDERR during compilation #42
Fixes Node.js compilers writing to STDOUT and/or STDERR during compilation #42
Conversation
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @arthurnn (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@@ -376,4 +376,30 @@ def test_uglify | |||
assert_equal "function foo(bar){return bar}", | |||
context.call("uglify", "function foo(bar) {\n return bar;\n}") | |||
end | |||
|
|||
def test_compiler_writing_to_stdout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe stdio
instead of stdout
since this is testing both stdout
and stderr
?
029378b
to
a8e0781
Compare
@rafaelfranca @josh @SamSaffron thoughts? |
I'd suggest https://github.com/rails/execjs/blob/master/test/test_execjs.rb#L232-L257 |
@josh that won't work for us, in this case. Ember is using |
Then Ember is going to crash running in any environment that isn't node. In JSC |
No, it won't crash because it never references
export const context = {
// import jQuery
imports: originalContext.imports || global,
// export Ember
exports: originalContext.exports || global,
// search for Namespaces
lookup: originalContext.lookup || global
};
In other environments Does it make sense now? |
If it was possible, it'd be great if I still think we should attempt to undefine as much of |
@eventualbuddha Does #43 work in the eval case? |
I believe so. I'll leave it to @alexgorbatchev to check. |
I just tested locally, #43 also addresses this issue. |
Closing this one since #43 was merged. Thanks for the contribution. |
This was happening when I was trying to compiler an Ember template with Rails Assets that had deprecation warnings. The warnings would be printed to STDOUT and end up being part of the string that was going to be JSON parsed.