Export assignment expression must not track variables (#4660)

Only export the result of the assignment expression. This value cannot be changed later.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-04-21 08:56:50 +02:00
committed by GitHub
parent dead11cdd0
commit b4bea25f13
7 changed files with 38 additions and 13 deletions
+7 -1
View File
@@ -15,7 +15,13 @@
export var a = 2.5
export var b = 4
export var c = function(v) { def = v; return "c" }
export var c = function(v) {
assert(def === 0);
a = v;
return "c"
}
var def = 8.5
/* Nothing is tracked, only the result value is exported. */
export default def
def = 0