Summary: | eval() incorrectly sets variable to undefined when redeclaring it with var | ||
---|---|---|---|
Product: | MuJS | Reporter: | Arto Pekkanen <isoa> |
Component: | general | Assignee: | Tor Andersson <tor.andersson> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | P4 | ||
Version: | 1.0.6 | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- |
Description
Arto Pekkanen
2019-11-08 15:59:59 UTC
commit 3d3f473c399186d229bc0313d3f4efaef0cc5bdb Author: Tor Andersson <tor.andersson@artifex.com> Date: Mon Nov 11 11:02:54 2019 +0100 Bug 701887: Create arguments if eval is present. We can't know at compile time that the 'arguments' object will not be used from the eval statement, so err on the side of caution and always create the arguments object if eval can be called. commit d248b0ce1800a1ebf2c853f205c1947642185c6a Author: Tor Andersson <tor.andersson@artifex.com> Date: Mon Nov 11 11:34:43 2019 +0100 Bug 701886: Always create new scope for eval(). Distinguish eval code from script code. The fix in d248b0ce1800a1ebf2c853f205c1947642185c6a is wrong. Fixed in a better way in: commit a34fdf2af87cc13b1d85cd19812c4d0b722f3e3a Author: Tor Andersson <tor.andersson@artifex.com> Date: Thu Mar 4 12:20:46 2021 +0100 Bug 701886: Don't redefine/reset existing vars in script code. If a var is already declared in the same scope, don't redeclare it. Should fix issues with "var" used in eval() code. |