[Webkit-unassigned] [Bug 159968] New: [JSC] Unary + changes evaluation order

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 20 04:06:58 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=159968

            Bug ID: 159968
           Summary: [JSC] Unary + changes evaluation order
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: utatane.tea at gmail.com

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");

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160720/cafe5040/attachment.html>


More information about the webkit-unassigned mailing list