8000 changing parent scope in `eval` · Issue #22 · awto/effectfuljs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
changing parent scope in eval #22
Open
@awto

Description

@awto

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0