Skip to content

[acl][hook] Local variables in a with block are mistreated as global variables in ACL #339

Description

@t2ym

[acl][hook] Local variables in a with block are mistreated as global variables in ACL

Root Cause

  • Local variables in a with block are hooked as with-scoped variables but they cannot be found in the with block scope chain and then mistreated as global variables in applying ACL, while the variables are just local

Reproducible Code

{
  let with_scoped_chain = 1;
  with ({with_scoped2: 2}) {
    let local_scoped = 3;
    // local_scoped is unexpectedly hooked as a with-scoped variable
    with_scoped_chain = local_scoped;
    global_scoped; // global if the scope object does not have global_scoped property
  }
}

Fix

  • Avoid unexpected hooking of local variables within a with-scoped block

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions