[PATCH v2 4/5] jscript: Support nested scopes for functions defined inside.

Jacek Caban jacek at codeweavers.com
Tue Jun 15 06:57:16 CDT 2021


On 6/15/21 12:04 PM, Paul Gofman wrote:
> Signed-off-by: Paul Gofman <pgofman at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.diff
Type: text/x-patch
Size: 1591 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20210615/0b89472e/attachment.bin>


More information about the wine-devel mailing list