-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
Add a generic implementation of Kernel#caller and #warn(uplevel:) #2065
Conversation
a72d5f9
to
fbeed54
Compare
b1cf493
to
d86c92a
Compare
d86c92a
to
88d65a9
Compare
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.
LGTM 👍
opal/corelib/kernel.rb
Outdated
@@ -92,8 +92,13 @@ def at_exit(&block) | |||
|
|||
# Opal does not support #caller, but we stub it as an empty array to not |
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.
✂️
lib/opal/cli_runners/chrome.rb
Outdated
if (path.endsWith('/index.js')) { | ||
return { | ||
url: './index.map', | ||
map: #{builder.source_map.to_json.to_json} |
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.
can the second to_json
be replaced with inspect
?
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.
I'm not 100% sure the escaping is the same between the two… I since moved the generation of the values to be written to the top of the method, so the two to_json
don't appear one after the other anymore.
This better mirrors ruby.
88d65a9
to
5928890
Compare
Move all the file writing to the Ruby side and create a dedicated temporary folder to hold the code. Add a version of the already existing code for sourcemapped stack-traces that works on the browser (via Browserify).
This implementation should be good enough for browsers and node.
5928890
to
69952c2
Compare
Along with the recent changes to the node stacktrace this PR should be making the development experience both of opal itself and of opal apps much better.
Fixes #2068