NEW 159968
[JSC] Unary + changes evaluation order
https://bugs.webkit.org/show_bug.cgi?id=159968
Summary [JSC] Unary + changes evaluation order
Yusuke Suzuki
Reported 2016-07-20 04:06:58 PDT
Currently, we just strip the unary + in makeXXXNode. But unary + can change the evaluation order since it performs ToNumber. Modified tests derived from the Rick Waldron's one. let capture = []; let leftValue = { valueOf() { capture.push("leftValue"); return 3; }}; let rightValue = { valueOf() { capture.push("rightValue"); return 2; }}; (capture.push("left"), leftValue) ${token} +(capture.push("right"), rightValue); // ^ // Changes the order // Expected per operator evaluation order: "left", "right", "rightValue", "leftValue" shouldBe(capture[0], "left"); shouldBe(capture[1], "right"); shouldBe(capture[2], "rightValue"); shouldBe(capture[3], "leftValue");
Attachments
Note You need to log in before you can comment on or make changes to this bug.