-
Notifications
You must be signed in to change notification settings - Fork 123
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
Inspect variables bound in closure #197
Comments
I recently rewrote how scoped variables work. If you have a reference to the current RuntimeScope you can just call |
Sounds promising - iterating through a number of scopes might work fine, if it's possible to get a list of them. Last we checked, we were unfortunately unable to upgrade our Jurassic 2.2.2 since we evaluate lodash.js into the js-environment, and a regression a while back made that fail. That issue is still open, so we're probably still stuck. |
@lsim I did a fix for the lodash symbol issue, it's in version 3.2.4. |
Great! We'll have another go then. Closure variable access will make a nice improvement to our debugger. |
I seem to have successfully upgraded to 2.3.6. 🎉 I'm now trying to figure out how to get a reference to the current RuntimeScope in a Is there an example somewhere I could look at? |
You mean 3.2.6? Great 👍
The short answer: you can't. What do you need this for, exactly? The RuntimeScope class is used to implement variable scopes in nested functions and with statements; it should not be relevant inside your C# method...? |
Oops - yes: 3.2.6 We have in our platform various features aimed at making debugging user scripts easier. It currently allows inspecting root scope variables only. With access to the current RuntimeScope, we might be able to allow interaction with variables in other scopes also. |
That makes sense. Unfortunately I haven't made this easy. There's a few options but none of them are particularly nice:
Yeah, not great, sorry :-/ |
Is there any way to list or otherwise access variables bound in the current functional scope when javascript calls back to C#?
This would be beneficial for people wanting to build an interactive debugger for js running on jurassic. At present we are limited to showing global variables. It would be nice if there was some way to accomplish this for scoped variables as well.
The text was updated successfully, but these errors were encountered: