Skip to content
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

changing parent scope in eval #22

Open
awto opened this issue Apr 13, 2020 · 0 comments
Open

changing parent scope in eval #22

awto opened this issue Apr 13, 2020 · 0 comments
Labels
debugger @effectful/debugger related tickets enhancement

Comments

@awto
Copy link
Owner

awto commented Apr 13, 2020

Expressions like eval("var m = 10") should add variable` into its parent scope. This doesn't work now (if the variable isn't already defined in that scope), because the variables are accessed by index not by name.

To make this work each frame should also store reference of a global object, and each global variable access is converted to member access expression in that object. If some function uses eval it should also Object.create(parentGlobal). This way the eval will add the variable into the parent's global object and it can be accessed.

@awto awto added enhancement debugger @effectful/debugger related tickets labels Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugger @effectful/debugger related tickets enhancement
Projects
None yet
Development

No branches or pull requests

1 participant