Skip to content

merge_pr_50906

Compare
Choose a tag to compare
@github-actions github-actions released this 24 Feb 14:04

[functions] Ensure that referenced var in outer scope is applied

Dynamic scoping allows a var() to see local variables defined
higher up the call stack. If a local variable in some outer function
makes a function call, that inner function call may reference variables
in the outer function that are not yet resolved (i.e. do not yet
exist on FunctionContext::locals). We already handle this for references
within the same frame. Fixed by calling LookupAndApplyLocalVariable
on each frame visited during var()-dereferencing.

This has implications for cycle detection too, but that's not handled
in this CL (Issue 397485310).

Bug: 325504770, 397620596
Change-Id: I4aad9eeb885d19ccba116b89f40faf0cc721201c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6287713
Reviewed-by: Steinar H Gunderson sesse@chromium.org
Commit-Queue: Anders Hartvoll Ruud andruud@chromium.org
Cr-Commit-Position: refs/heads/main@{#1423847}