On 6/15/21 12:04 PM, Paul Gofman wrote:
Signed-off-by: Paul Gofman pgofman@codeweavers.com
v2: - detach variable object when leaving scope which is still reference (fixes test by Jacek from patch 5); - add more tests for binding function defined and referenced in various scopes; - allocate function variable in the scope where the function is defined; - keep detached function variable both in local scope object and function base scope object.
dlls/jscript/compile.c | 40 ++++++++++++++++-- dlls/jscript/engine.c | 84 +++++++++++++++++++++++++++++-------- dlls/jscript/engine.h | 2 + dlls/jscript/parser.h | 1 + dlls/jscript/parser.y | 1 + dlls/mshtml/tests/es5.js | 89 +++++++++++++++++++++++++++++++++++++++- 6 files changed, 194 insertions(+), 23 deletions(-)
Those tests are becoming hard to follow. Please don't try to test everything at the time. There is no reason to mix 'let' tests with function declaration scope. While trying to see how it's supposed to work, I ended up with the attached test. It looks like we indeed need a slot both in block scope and function scope, but it asserts with your patches.
Jacek