-
-
Notifications
You must be signed in to change notification settings - Fork 401
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
Create Print() function #142
Comments
Interest in this. Can I take a try? |
Sure! |
In terms of the helper, there exists one in the spec: The Execution context should have a getRealmObject method. You will need this to add Print to the global object before running |
if you call |
@louisgjphnson this method won’t be in the final binary, only in the shell |
@IovoslavIovchev @jasonwilliams thanks! I have to delay my contribution on this issue because of my uni coursework :p |
@Emanon42 no worries, take your time |
Arises from:
jasonwilliams#74
For Boa Shell we need a print function, the implementation is virtually the same as https://github.com/jasonwilliams/boa/blob/master/src/lib/js/console.rs#L11-L98
It might be worth abstracting the above logic into its own function, and have console.log() and print() use it.
print() should only be available in shell
So you will need to add it to the realm there.
You may need to create a helper function in realm which lets you add Objects to the global scope.
Spidermonkey equivalent
https://github.com/mozilla/gecko-dev/blob/master/js/src/shell/js.cpp#L2687-L2724
The text was updated successfully, but these errors were encountered: