Changeset 245406 in webkit
- Timestamp:
- May 16, 2019 1:08:22 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChakraCore.yaml
r244972 r245406 552 552 cmd: runChakra :baseline, "NoException", "CallNonFunction_3.baseline-jsc", [] 553 553 - path: ChakraCore/test/Error/variousErrors.js 554 cmd: runChakra :baseline, "NoException", "variousErrors3.baseline ", []554 cmd: runChakra :baseline, "NoException", "variousErrors3.baseline-jsc", [] 555 555 - path: ChakraCore/test/Error/bug560940.js 556 556 cmd: runChakra :pass, "NoException", "", [] -
trunk/JSTests/ChakraCore/test/EH/try6.baseline-jsc
r205387 r245406 17 17 Except foobaz 2 thrown 18 18 english (passed) 19 ReferenceError: Postfix ++ operator applied to value that is not a reference.19 SyntaxError: Postfix ++ operator applied to value that is not a reference. -
trunk/JSTests/ChangeLog
r245341 r245406 1 2019-05-16 Ross Kirsling <ross.kirsling@sony.com> 2 3 [JSC] Invalid AssignmentTargetType should be an early error. 4 https://bugs.webkit.org/show_bug.cgi?id=197603 5 6 Reviewed by Keith Miller. 7 8 * test262/expectations.yaml: 9 Update expectations to reflect new SyntaxErrors. 10 (Ideally, these should all be viewed as passing in the near future.) 11 12 * stress/async-await-basic.js: 13 * stress/big-int-literals.js: 14 Update tests to reflect new SyntaxErrors. 15 16 * ChakraCore.yaml: 17 * ChakraCore/test/EH/try6.baseline-jsc: 18 * ChakraCore/test/Error/variousErrors3.baseline-jsc: Added. 19 Update baselines to reflect new SyntaxErrors. 20 1 21 2019-05-15 Saam Barati <sbarati@apple.com> 2 22 -
trunk/JSTests/stress/async-await-basic.js
r223043 r245406 271 271 log.push('step 5 ' + t3); 272 272 273 try { 274 var t4 = ++await 1; 275 } catch(e) { 276 if (e instanceof ReferenceError) { 277 log.push('step 6 '); 278 } 279 } 280 281 try { 282 var t5 = --await 1; 283 } catch(e) { 284 if (e instanceof ReferenceError) { 285 log.push('step 7'); 286 } 287 } 273 shouldThrowSyntaxError("var t4 = ++await 1;"); 274 shouldThrowSyntaxError("var t5 = --await 1;"); 288 275 289 276 return void await 'test'; … … 292 279 293 280 shouldBeAsync(undefined, () => awaitEpression(5)); 294 shouldBe("start:5 step 1 step 2 -2 step 3 12345 step 4 -54321 step 5 false step 6 step 7", log.join(" "));281 shouldBe("start:5 step 1 step 2 -2 step 3 12345 step 4 -54321 step 5 false", log.join(" ")); 295 282 296 283 // MethoodDefinition SyntaxErrors -
trunk/JSTests/stress/big-int-literals.js
r225799 r245406 105 105 assertThrowSyntaxError("1a0nn"); 106 106 assertThrowSyntaxError("10E20n"); 107 108 try { 109 eval("--10n"); 110 assert(false); 111 } catch(e) { 112 assert(e instanceof ReferenceError); 113 } 107 assertThrowSyntaxError("--10n"); -
trunk/JSTests/test262/expectations.yaml
r245201 r245406 1822 1822 default: 'Test262Error: Expected obj[0] to have configurable:false.' 1823 1823 test/language/asi/S7.9_A5.7_T1.js: 1824 default: ' Test262: This statement should not be evaluated.'1824 default: 'SyntaxError: The prefix-increment operator requires a reference expression.' 1825 1825 strict mode: 'SyntaxError: The prefix-increment operator requires a reference expression.' 1826 1826 test/language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-function.js: … … 2075 2075 strict mode: 'Test262Error: Expected SameValue(«true», «false») to be true' 2076 2076 test/language/expressions/assignment/non-simple-target.js: 2077 default: ' Test262: This statement should not be evaluated.'2078 strict mode: ' Test262: This statement should not be evaluated.'2077 default: 'SyntaxError: Left side of assignment is not a reference.' 2078 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2079 2079 test/language/expressions/assignment/target-boolean.js: 2080 default: ' Test262: This statement should not be evaluated.'2081 strict mode: ' Test262: This statement should not be evaluated.'2080 default: 'SyntaxError: Left side of assignment is not a reference.' 2081 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2082 2082 test/language/expressions/assignment/target-cover-newtarget.js: 2083 2083 default: "SyntaxError: new.target can't be the left hand side of an assignment expression." 2084 2084 strict mode: "SyntaxError: new.target can't be the left hand side of an assignment expression." 2085 2085 test/language/expressions/assignment/target-cover-yieldexpr.js: 2086 default: ' Test262: This statement should not be evaluated.'2087 strict mode: ' Test262: This statement should not be evaluated.'2086 default: 'SyntaxError: Left side of assignment is not a reference.' 2087 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2088 2088 test/language/expressions/assignment/target-newtarget.js: 2089 2089 default: "SyntaxError: new.target can't be the left hand side of an assignment expression." 2090 2090 strict mode: "SyntaxError: new.target can't be the left hand side of an assignment expression." 2091 2091 test/language/expressions/assignment/target-null.js: 2092 default: ' Test262: This statement should not be evaluated.'2093 strict mode: ' Test262: This statement should not be evaluated.'2092 default: 'SyntaxError: Left side of assignment is not a reference.' 2093 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2094 2094 test/language/expressions/assignment/target-number.js: 2095 default: ' Test262: This statement should not be evaluated.'2096 strict mode: ' Test262: This statement should not be evaluated.'2095 default: 'SyntaxError: Left side of assignment is not a reference.' 2096 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2097 2097 test/language/expressions/assignment/target-string.js: 2098 default: ' Test262: This statement should not be evaluated.'2099 strict mode: ' Test262: This statement should not be evaluated.'2098 default: 'SyntaxError: Left side of assignment is not a reference.' 2099 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2100 2100 test/language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js: 2101 2101 default: 'Test262: This statement should not be evaluated.' … … 2105 2105 strict mode: 'Test262: This statement should not be evaluated.' 2106 2106 test/language/expressions/async-function/early-errors-expression-not-simple-assignment-target.js: 2107 default: ' Test262: This statement should not be evaluated.'2108 strict mode: ' Test262: This statement should not be evaluated.'2107 default: 'SyntaxError: Left side of assignment is not a reference.' 2108 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2109 2109 test/language/expressions/await/early-errors-await-not-simple-assignment-target.js: 2110 default: ' Test262: This statement should not be evaluated.'2111 strict mode: ' Test262: This statement should not be evaluated.'2110 default: 'SyntaxError: Left side of assignment is not a reference.' 2111 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2112 2112 test/language/expressions/call/eval-realm-indirect.js: 2113 2113 default: 'Test262Error: Expected SameValue(«inside», «outside») to be true' … … 2315 2315 strict mode: 'Test262Error: Expected true but got false' 2316 2316 test/language/expressions/compound-assignment/add-non-simple.js: 2317 default: ' Test262: This statement should not be evaluated.'2318 strict mode: ' Test262: This statement should not be evaluated.'2317 default: 'SyntaxError: Left side of assignment is not a reference.' 2318 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2319 2319 test/language/expressions/compound-assignment/btws-and-non-simple.js: 2320 default: ' Test262: This statement should not be evaluated.'2321 strict mode: ' Test262: This statement should not be evaluated.'2320 default: 'SyntaxError: Left side of assignment is not a reference.' 2321 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2322 2322 test/language/expressions/compound-assignment/btws-or-non-simple.js: 2323 default: ' Test262: This statement should not be evaluated.'2324 strict mode: ' Test262: This statement should not be evaluated.'2323 default: 'SyntaxError: Left side of assignment is not a reference.' 2324 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2325 2325 test/language/expressions/compound-assignment/btws-xor-non-simple.js: 2326 default: ' Test262: This statement should not be evaluated.'2327 strict mode: ' Test262: This statement should not be evaluated.'2326 default: 'SyntaxError: Left side of assignment is not a reference.' 2327 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2328 2328 test/language/expressions/compound-assignment/div-non-simple.js: 2329 default: ' Test262: This statement should not be evaluated.'2330 strict mode: ' Test262: This statement should not be evaluated.'2329 default: 'SyntaxError: Left side of assignment is not a reference.' 2330 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2331 2331 test/language/expressions/compound-assignment/left-shift-non-simple.js: 2332 default: ' Test262: This statement should not be evaluated.'2333 strict mode: ' Test262: This statement should not be evaluated.'2332 default: 'SyntaxError: Left side of assignment is not a reference.' 2333 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2334 2334 test/language/expressions/compound-assignment/mod-div-non-simple.js: 2335 default: ' Test262: This statement should not be evaluated.'2336 strict mode: ' Test262: This statement should not be evaluated.'2335 default: 'SyntaxError: Left side of assignment is not a reference.' 2336 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2337 2337 test/language/expressions/compound-assignment/mult-non-simple.js: 2338 default: ' Test262: This statement should not be evaluated.'2339 strict mode: ' Test262: This statement should not be evaluated.'2338 default: 'SyntaxError: Left side of assignment is not a reference.' 2339 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2340 2340 test/language/expressions/compound-assignment/right-shift-non-simple.js: 2341 default: ' Test262: This statement should not be evaluated.'2342 strict mode: ' Test262: This statement should not be evaluated.'2341 default: 'SyntaxError: Left side of assignment is not a reference.' 2342 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2343 2343 test/language/expressions/compound-assignment/subtract-non-simple.js: 2344 default: ' Test262: This statement should not be evaluated.'2345 strict mode: ' Test262: This statement should not be evaluated.'2344 default: 'SyntaxError: Left side of assignment is not a reference.' 2345 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2346 2346 test/language/expressions/compound-assignment/u-right-shift-non-simple.js: 2347 default: ' Test262: This statement should not be evaluated.'2348 strict mode: ' Test262: This statement should not be evaluated.'2347 default: 'SyntaxError: Left side of assignment is not a reference.' 2348 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2349 2349 test/language/expressions/conditional/in-branch-1.js: 2350 2350 default: "SyntaxError: Unexpected keyword 'in'. Expected ':' in ternary operator." 2351 2351 strict mode: "SyntaxError: Unexpected keyword 'in'. Expected ':' in ternary operator." 2352 2352 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-1-update-expression.js: 2353 default: ' Test262: This statement should not be evaluated.'2354 strict mode: ' Test262: This statement should not be evaluated.'2353 default: 'SyntaxError: Postfix ++ operator applied to value that is not a reference.' 2354 strict mode: 'SyntaxError: Postfix ++ operator applied to value that is not a reference.' 2355 2355 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-10-lhs-assignment-operator-assignment-expression.js: 2356 default: ' Test262: This statement should not be evaluated.'2357 strict mode: ' Test262: This statement should not be evaluated.'2356 default: 'SyntaxError: Left side of assignment is not a reference.' 2357 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2358 2358 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-11-lhs-assignment-operator-assignment-expression.js: 2359 default: ' Test262: This statement should not be evaluated.'2360 strict mode: ' Test262: This statement should not be evaluated.'2359 default: 'SyntaxError: Left side of assignment is not a reference.' 2360 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2361 2361 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-12-lhs-assignment-operator-assignment-expression.js: 2362 default: ' Test262: This statement should not be evaluated.'2363 strict mode: ' Test262: This statement should not be evaluated.'2362 default: 'SyntaxError: Left side of assignment is not a reference.' 2363 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2364 2364 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-13-lhs-assignment-operator-assignment-expression.js: 2365 default: ' Test262: This statement should not be evaluated.'2366 strict mode: ' Test262: This statement should not be evaluated.'2365 default: 'SyntaxError: Left side of assignment is not a reference.' 2366 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2367 2367 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-14-lhs-assignment-operator-assignment-expression.js: 2368 default: ' Test262: This statement should not be evaluated.'2369 strict mode: ' Test262: This statement should not be evaluated.'2368 default: 'SyntaxError: Left side of assignment is not a reference.' 2369 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2370 2370 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-15-lhs-assignment-operator-assignment-expression.js: 2371 default: ' Test262: This statement should not be evaluated.'2372 strict mode: ' Test262: This statement should not be evaluated.'2371 default: 'SyntaxError: Left side of assignment is not a reference.' 2372 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2373 2373 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-16-lhs-assignment-operator-assignment-expression.js: 2374 default: ' Test262: This statement should not be evaluated.'2375 strict mode: ' Test262: This statement should not be evaluated.'2374 default: 'SyntaxError: Left side of assignment is not a reference.' 2375 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2376 2376 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-17-lhs-assignment-operator-assignment-expression.js: 2377 default: ' Test262: This statement should not be evaluated.'2378 strict mode: ' Test262: This statement should not be evaluated.'2377 default: 'SyntaxError: Left side of assignment is not a reference.' 2378 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2379 2379 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-2-update-expression.js: 2380 default: ' Test262: This statement should not be evaluated.'2381 strict mode: ' Test262: This statement should not be evaluated.'2380 default: 'SyntaxError: Postfix -- operator applied to value that is not a reference.' 2381 strict mode: 'SyntaxError: Postfix -- operator applied to value that is not a reference.' 2382 2382 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-3-update-expression.js: 2383 default: ' Test262: This statement should not be evaluated.'2384 strict mode: ' Test262: This statement should not be evaluated.'2383 default: 'SyntaxError: Prefix -- operator applied to value that is not a reference.' 2384 strict mode: 'SyntaxError: Prefix -- operator applied to value that is not a reference.' 2385 2385 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-4-update-expression.js: 2386 default: ' Test262: This statement should not be evaluated.'2387 strict mode: ' Test262: This statement should not be evaluated.'2386 default: 'SyntaxError: Prefix -- operator applied to value that is not a reference.' 2387 strict mode: 'SyntaxError: Prefix -- operator applied to value that is not a reference.' 2388 2388 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-5-lhs-equals-assignment-expression.js: 2389 default: ' Test262: This statement should not be evaluated.'2390 strict mode: ' Test262: This statement should not be evaluated.'2389 default: 'SyntaxError: Left side of assignment is not a reference.' 2390 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2391 2391 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-6-lhs-assignment-operator-assignment-expression.js: 2392 default: ' Test262: This statement should not be evaluated.'2393 strict mode: ' Test262: This statement should not be evaluated.'2392 default: 'SyntaxError: Left side of assignment is not a reference.' 2393 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2394 2394 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-7-lhs-assignment-operator-assignment-expression.js: 2395 default: ' Test262: This statement should not be evaluated.'2396 strict mode: ' Test262: This statement should not be evaluated.'2395 default: 'SyntaxError: Left side of assignment is not a reference.' 2396 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2397 2397 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-8-lhs-assignment-operator-assignment-expression.js: 2398 default: ' Test262: This statement should not be evaluated.'2399 strict mode: ' Test262: This statement should not be evaluated.'2398 default: 'SyntaxError: Left side of assignment is not a reference.' 2399 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2400 2400 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-9-lhs-assignment-operator-assignment-expression.js: 2401 default: ' Test262: This statement should not be evaluated.'2402 strict mode: ' Test262: This statement should not be evaluated.'2401 default: 'SyntaxError: Left side of assignment is not a reference.' 2402 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2403 2403 test/language/expressions/function/name.js: 2404 2404 default: 'Test262Error: Expected SameValue(«true», «false») to be true' … … 2492 2492 strict mode: "SyntaxError: new.target can't come before a postfix operator." 2493 2493 test/language/expressions/postfix-decrement/target-cover-yieldexpr.js: 2494 default: ' Test262: This statement should not be evaluated.'2495 strict mode: ' Test262: This statement should not be evaluated.'2494 default: 'SyntaxError: Postfix -- operator applied to value that is not a reference.' 2495 strict mode: 'SyntaxError: Postfix -- operator applied to value that is not a reference.' 2496 2496 test/language/expressions/postfix-decrement/target-newtarget.js: 2497 2497 default: "SyntaxError: new.target can't come before a postfix operator." … … 2515 2515 strict mode: "SyntaxError: new.target can't come before a postfix operator." 2516 2516 test/language/expressions/postfix-increment/target-cover-yieldexpr.js: 2517 default: ' Test262: This statement should not be evaluated.'2518 strict mode: ' Test262: This statement should not be evaluated.'2517 default: 'SyntaxError: Postfix ++ operator applied to value that is not a reference.' 2518 strict mode: 'SyntaxError: Postfix ++ operator applied to value that is not a reference.' 2519 2519 test/language/expressions/postfix-increment/target-newtarget.js: 2520 2520 default: "SyntaxError: new.target can't come before a postfix operator." … … 2538 2538 strict mode: "SyntaxError: new.target can't come after a prefix operator." 2539 2539 test/language/expressions/prefix-decrement/target-cover-yieldexpr.js: 2540 default: ' Test262: This statement should not be evaluated.'2541 strict mode: ' Test262: This statement should not be evaluated.'2540 default: 'SyntaxError: Prefix -- operator applied to value that is not a reference.' 2541 strict mode: 'SyntaxError: Prefix -- operator applied to value that is not a reference.' 2542 2542 test/language/expressions/prefix-decrement/target-newtarget.js: 2543 2543 default: "SyntaxError: new.target can't come after a prefix operator." … … 2561 2561 strict mode: "SyntaxError: new.target can't come after a prefix operator." 2562 2562 test/language/expressions/prefix-increment/target-cover-yieldexpr.js: 2563 default: ' Test262: This statement should not be evaluated.'2564 strict mode: ' Test262: This statement should not be evaluated.'2563 default: 'SyntaxError: Prefix -- operator applied to value that is not a reference.' 2564 strict mode: 'SyntaxError: Prefix -- operator applied to value that is not a reference.' 2565 2565 test/language/expressions/prefix-increment/target-newtarget.js: 2566 2566 default: "SyntaxError: new.target can't come after a prefix operator." … … 2570 2570 strict mode: 'Test262Error: did not perform ArgumentsListEvaluation Expected SameValue(«true», «false») to be true' 2571 2571 test/language/expressions/this/S11.1.1_A1.js: 2572 default: ' Test262: This statement should not be evaluated.'2573 strict mode: ' Test262: This statement should not be evaluated.'2572 default: 'SyntaxError: Left side of assignment is not a reference.' 2573 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 2574 2574 test/language/expressions/yield/star-iterable.js: 2575 2575 default: 'Test262Error: First result `done` flag Expected SameValue(«false», «undefined») to be true' … … 2792 2792 test/language/module-code/instn-once.js: 2793 2793 module: "SyntaxError: Unexpected identifier 'as'. Expected 'from' before exported module name." 2794 test/language/module-code/instn-resolve-empty-export.js: 2795 module: 'SyntaxError: Postfix ++ operator applied to value that is not a reference.' 2796 test/language/module-code/instn-resolve-empty-import.js: 2797 module: 'SyntaxError: Postfix ++ operator applied to value that is not a reference.' 2798 test/language/module-code/instn-resolve-err-reference.js: 2799 module: 'SyntaxError: Postfix ++ operator applied to value that is not a reference.' 2794 2800 test/language/module-code/instn-resolve-order-depth.js: 2795 2801 module: "SyntaxError: 'break' is only valid inside a switch or loop statement." 2796 2802 test/language/module-code/instn-resolve-order-src.js: 2797 module: "SyntaxError: 'break' is only valid inside a switch or loop statement."2803 module: 'SyntaxError: Postfix ++ operator applied to value that is not a reference.' 2798 2804 test/language/module-code/instn-star-as-props-dflt-skip.js: 2799 2805 module: "SyntaxError: Unexpected identifier 'as'. Expected 'from' before exported module name." … … 2815 2821 module: 'Test262: This statement should not be evaluated.' 2816 2822 test/language/module-code/parse-err-reference.js: 2817 module: ' Test262: This statement should not be evaluated.'2823 module: 'SyntaxError: Postfix ++ operator applied to value that is not a reference.' 2818 2824 test/language/statements/class/class-name-ident-await-escaped.js: 2819 2825 default: "SyntaxError: Unexpected escaped characters in keyword token: 'aw\\u0061it'" … … 3189 3195 default: 'Test262: This statement should not be evaluated.' 3190 3196 test/language/types/boolean/S8.3_A2.1.js: 3191 default: ' Test262: This statement should not be evaluated.'3192 strict mode: ' Test262: This statement should not be evaluated.'3197 default: 'SyntaxError: Left side of assignment is not a reference.' 3198 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 3193 3199 test/language/types/boolean/S8.3_A2.2.js: 3194 default: ' Test262: This statement should not be evaluated.'3195 strict mode: ' Test262: This statement should not be evaluated.'3200 default: 'SyntaxError: Left side of assignment is not a reference.' 3201 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 3196 3202 test/language/types/reference/S8.7.2_A1_T1.js: 3197 default: ' Test262: This statement should not be evaluated.'3198 strict mode: ' Test262: This statement should not be evaluated.'3203 default: 'SyntaxError: Left side of assignment is not a reference.' 3204 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 3199 3205 test/language/types/reference/S8.7.2_A1_T2.js: 3200 default: ' Test262: This statement should not be evaluated.'3201 strict mode: ' Test262: This statement should not be evaluated.'3206 default: 'SyntaxError: Left side of assignment is not a reference.' 3207 strict mode: 'SyntaxError: Left side of assignment is not a reference.' 3202 3208 test/language/types/reference/put-value-prop-base-primitive-realm.js: 3203 3209 default: 'Test262Error: number Expected SameValue(«0», «1») to be true' -
trunk/LayoutTests/ChangeLog
r245402 r245406 1 2019-05-16 Ross Kirsling <ross.kirsling@sony.com> 2 3 [JSC] Invalid AssignmentTargetType should be an early error. 4 https://bugs.webkit.org/show_bug.cgi?id=197603 5 6 Reviewed by Keith Miller. 7 8 * fast/events/window-onerror4-expected.txt: 9 * ietestcenter/Javascript/11.13.1-1-1-expected.txt: 10 * ietestcenter/Javascript/11.13.1-1-2-expected.txt: 11 * ietestcenter/Javascript/11.13.1-1-3-expected.txt: 12 * ietestcenter/Javascript/11.13.1-1-4-expected.txt: 13 * js/basic-strict-mode-expected.txt: 14 * js/dom/assign-expected.txt: 15 * js/dom/line-column-numbers-expected.txt: 16 * js/dom/line-column-numbers.html: 17 * js/dom/postfix-syntax-expected.txt: 18 * js/dom/prefix-syntax-expected.txt: 19 * js/dom/script-tests/line-column-numbers.js: 20 * js/function-toString-parentheses-expected.txt: 21 * js/parser-syntax-check-expected.txt: 22 * js/parser-xml-close-comment-expected.txt: 23 * js/script-tests/function-toString-parentheses.js: 24 * js/script-tests/parser-syntax-check.js: 25 Update tests & expectations to reflect new SyntaxErrors. 26 27 * js/script-tests/toString-prefix-postfix-preserve-parens.js: 28 * js/toString-prefix-postfix-preserve-parens-expected.txt: 29 None of the prefix/postfix tests make sense here now that they're all SyntaxErrors; 30 remove them and just leave the typeof tests. 31 1 32 2019-05-16 Youenn Fablet <youenn@apple.com> 2 33 -
trunk/LayoutTests/fast/events/window-onerror4-expected.txt
r202023 r245406 1 1 You should see a log record if window.onerror is working properly for this test.Bug 8519. 2 2 3 Error caught successfully: ReferenceError: Left side of assignment is not a reference. File: undefined Line: 1 Column: 3 Error: ReferenceError: Left side of assignment is not a reference.3 Error caught successfully: SyntaxError: Left side of assignment is not a reference. File: window-onerror4.html Line: 16 Column: 9 Error: SyntaxError: Left side of assignment is not a reference. 4 4 -
trunk/LayoutTests/ietestcenter/Javascript/11.13.1-1-1-expected.txt
r62810 r245406 5 5 6 6 PASS ES5Harness.preconditionPassed is true 7 PASS ES5Harness.testPassed is true 7 FAIL ES5Harness.testPassed should be true (of type boolean). Was undefined (of type undefined). 8 8 PASS successfullyParsed is true 9 9 -
trunk/LayoutTests/ietestcenter/Javascript/11.13.1-1-2-expected.txt
r62810 r245406 5 5 6 6 PASS ES5Harness.preconditionPassed is true 7 PASS ES5Harness.testPassed is true 7 FAIL ES5Harness.testPassed should be true (of type boolean). Was undefined (of type undefined). 8 8 PASS successfullyParsed is true 9 9 -
trunk/LayoutTests/ietestcenter/Javascript/11.13.1-1-3-expected.txt
r62810 r245406 5 5 6 6 PASS ES5Harness.preconditionPassed is true 7 PASS ES5Harness.testPassed is true 7 FAIL ES5Harness.testPassed should be true (of type boolean). Was undefined (of type undefined). 8 8 PASS successfullyParsed is true 9 9 -
trunk/LayoutTests/ietestcenter/Javascript/11.13.1-1-4-expected.txt
r62810 r245406 5 5 6 6 PASS ES5Harness.preconditionPassed is true 7 PASS ES5Harness.testPassed is true 7 FAIL ES5Harness.testPassed should be true (of type boolean). Was undefined (of type undefined). 8 8 PASS successfullyParsed is true 9 9 -
trunk/LayoutTests/js/basic-strict-mode-expected.txt
r237259 r245406 134 134 PASS (function(){'use strict'; function f() { arguments-- }}) threw exception SyntaxError: 'arguments' cannot be modified in strict mode.. 135 135 PASS global.eval('"use strict"; if (0) ++arguments; true;') threw exception SyntaxError: Cannot modify 'arguments' in strict mode.. 136 PASS 'use strict'; ++(1, eval) threw exception ReferenceError: Prefix ++ operator applied to value that is not a reference..136 PASS 'use strict'; ++(1, eval) threw exception SyntaxError: Prefix ++ operator applied to value that is not a reference.. 137 137 PASS (function(){'use strict'; ++(1, eval)}) threw exception SyntaxError: Cannot modify 'eval' in strict mode.. 138 PASS 'use strict'; ++(1, 2, 3, eval) threw exception ReferenceError: Prefix ++ operator applied to value that is not a reference..138 PASS 'use strict'; ++(1, 2, 3, eval) threw exception SyntaxError: Prefix ++ operator applied to value that is not a reference.. 139 139 PASS (function(){'use strict'; ++(1, 2, 3, eval)}) threw exception SyntaxError: Cannot modify 'eval' in strict mode.. 140 PASS 'use strict'; (1, eval)++ threw exception ReferenceError: Postfix ++ operator applied to value that is not a reference..140 PASS 'use strict'; (1, eval)++ threw exception SyntaxError: Postfix ++ operator applied to value that is not a reference.. 141 141 PASS (function(){'use strict'; (1, eval)++}) threw exception SyntaxError: Cannot modify 'eval' in strict mode.. 142 PASS 'use strict'; --(1, eval) threw exception ReferenceError: Prefix -- operator applied to value that is not a reference..142 PASS 'use strict'; --(1, eval) threw exception SyntaxError: Prefix -- operator applied to value that is not a reference.. 143 143 PASS (function(){'use strict'; --(1, eval)}) threw exception SyntaxError: Cannot modify 'eval' in strict mode.. 144 PASS 'use strict'; (1, eval)-- threw exception ReferenceError: Postfix -- operator applied to value that is not a reference..144 PASS 'use strict'; (1, eval)-- threw exception SyntaxError: Postfix -- operator applied to value that is not a reference.. 145 145 PASS (function(){'use strict'; (1, eval)--}) threw exception SyntaxError: 'eval' cannot be modified in strict mode.. 146 PASS 'use strict'; (1, 2, 3, eval)-- threw exception ReferenceError: Postfix -- operator applied to value that is not a reference..146 PASS 'use strict'; (1, 2, 3, eval)-- threw exception SyntaxError: Postfix -- operator applied to value that is not a reference.. 147 147 PASS (function(){'use strict'; (1, 2, 3, eval)--}) threw exception SyntaxError: 'eval' cannot be modified in strict mode.. 148 148 PASS 'use strict'; function f() { ++(1, arguments) } threw exception SyntaxError: Cannot modify 'arguments' in strict mode.. -
trunk/LayoutTests/js/dom/assign-expected.txt
r158425 r245406 14 14 PASS ((window.x)) = 9; x is 9 15 15 PASS ((window["x"])) = 10; x is 10 16 PASS (y, x) = "FAIL"; threw exception ReferenceError: Left side of assignment is not a reference..17 PASS (true ? x : y) = "FAIL"; threw exception ReferenceError: Left side of assignment is not a reference..16 PASS (y, x) = "FAIL"; threw exception SyntaxError: Left side of assignment is not a reference.. 17 PASS (true ? x : y) = "FAIL"; threw exception SyntaxError: Left side of assignment is not a reference.. 18 18 PASS x++ = "FAIL"; threw exception SyntaxError: Left hand side of operator '=' must be a reference.. 19 19 PASS successfullyParsed is true -
trunk/LayoutTests/js/dom/line-column-numbers-expected.txt
r156066 r245406 139 139 140 140 --> Case 21 Stack Trace: 141 0 toFuzz21 at line-column-numbers.html:206:26142 1 global code at line-column-numbers.html:20 9:13141 0 eval at [native code] 142 1 global code at line-column-numbers.html:205:9 143 143 144 144 --> Case 22 Stack Trace: 145 0 toFuzz22 at line-column-numbers.html:22 0:36146 1 global code at line-column-numbers.html:22 4:13145 0 toFuzz22 at line-column-numbers.html:221:36 146 1 global code at line-column-numbers.html:225:13 147 147 148 148 --> Case 1 Stack Trace: … … 281 281 282 282 --> Case 21 Stack Trace: 283 0 toFuzz21b at line-column-numbers.js:141:26284 1 global code at line-column-numbers.js:14 4:14283 0 eval at [native code] 284 1 global code at line-column-numbers.js:140:9 285 285 286 286 --> Case 22 Stack Trace: 287 0 toFuzz22b at line-column-numbers.js:15 3:36288 1 global code at line-column-numbers.js:15 7:14287 0 toFuzz22b at line-column-numbers.js:154:36 288 1 global code at line-column-numbers.js:158:14 289 289 290 290 PASS successfullyParsed is true -
trunk/LayoutTests/js/dom/line-column-numbers.html
r156066 r245406 203 203 <script> 204 204 try { 205 function toFuzz21() { 206 if (PriorityQueue.prototype.doSort() instanceof (this ^= function() { 207 })) return 2; 208 } 209 toFuzz21(); 205 eval( 206 "function toFuzz21() {\n" + 207 " if (PriorityQueue.prototype.doSort() instanceof (this ^= function () {})) return 2;\n" + 208 "}\n" + 209 "toFuzz21();" 210 ); 210 211 } catch(e) { 211 212 printStack(e.stack); -
trunk/LayoutTests/js/dom/postfix-syntax-expected.txt
r156066 r245406 14 14 PASS ((window.x))++ is 8 15 15 PASS ((window["x"]))++ is 9 16 PASS (y, x)++ threw exception ReferenceError: Postfix ++ operator applied to value that is not a reference..17 PASS (true ? x : y)++ threw exception ReferenceError: Postfix ++ operator applied to value that is not a reference..16 PASS (y, x)++ threw exception SyntaxError: Postfix ++ operator applied to value that is not a reference.. 17 PASS (true ? x : y)++ threw exception SyntaxError: Postfix ++ operator applied to value that is not a reference.. 18 18 PASS x++++ threw exception SyntaxError: Unexpected token '++'. 19 19 PASS x is 0 -
trunk/LayoutTests/js/dom/prefix-syntax-expected.txt
r156066 r245406 14 14 PASS ++((window.x)) is 9 15 15 PASS ++((window["x"])) is 10 16 PASS ++(y, x) threw exception ReferenceError: Prefix ++ operator applied to value that is not a reference..17 PASS ++(true ? x : y) threw exception ReferenceError: Prefix ++ operator applied to value that is not a reference..18 PASS ++++x threw exception ReferenceError: Prefix ++ operator applied to value that is not a reference..16 PASS ++(y, x) threw exception SyntaxError: Prefix ++ operator applied to value that is not a reference.. 17 PASS ++(true ? x : y) threw exception SyntaxError: Prefix ++ operator applied to value that is not a reference.. 18 PASS ++++x threw exception SyntaxError: The prefix-increment operator requires a reference expression.. 19 19 PASS successfullyParsed is true 20 20 -
trunk/LayoutTests/js/dom/script-tests/line-column-numbers.js
r156066 r245406 138 138 testId++; 139 139 try { 140 function toFuzz21b() { 141 if (PriorityQueue.prototype.doSort() instanceof (this ^= function() { 142 })) return 2; 143 } 144 toFuzz21b(); 140 eval( 141 "function toFuzz21() {\n" + 142 " if (PriorityQueue.prototype.doSort() instanceof (this ^= function () {})) return 2;\n" + 143 "}\n" + 144 "toFuzz21();" 145 ); 145 146 } catch(e) { 146 147 printStack(e.stack); -
trunk/LayoutTests/js/function-toString-parentheses-expected.txt
r187012 r245406 218 218 PASS compileAndSerialize('a = (b + c)') is 'a = (b + c)' 219 219 PASS compileAndSerialize('a + b = c') threw exception SyntaxError: Left hand side of operator '=' must be a reference.. 220 PASS compileAndSerialize('(a + b) = c') is '(a + b) = c'220 PASS compileAndSerialize('(a + b) = c') threw exception SyntaxError: Left side of assignment is not a reference.. 221 221 PASS compileAndSerialize('a + (b = c)') is 'a + (b = c)' 222 222 PASS compileAndSerialize('a *= b *= c') is 'a *= b *= c' … … 230 230 PASS compileAndSerialize('a *= (b + c)') is 'a *= (b + c)' 231 231 PASS compileAndSerialize('a + b *= c') threw exception SyntaxError: Left hand side of operator '*=' must be a reference.. 232 PASS compileAndSerialize('(a + b) *= c') is '(a + b) *= c'232 PASS compileAndSerialize('(a + b) *= c') threw exception SyntaxError: Left side of assignment is not a reference.. 233 233 PASS compileAndSerialize('a + (b *= c)') is 'a + (b *= c)' 234 234 PASS compileAndSerialize('a /= b /= c') is 'a /= b /= c' … … 242 242 PASS compileAndSerialize('a /= (b + c)') is 'a /= (b + c)' 243 243 PASS compileAndSerialize('a + b /= c') threw exception SyntaxError: Left hand side of operator '/=' must be a reference.. 244 PASS compileAndSerialize('(a + b) /= c') is '(a + b) /= c'244 PASS compileAndSerialize('(a + b) /= c') threw exception SyntaxError: Left side of assignment is not a reference.. 245 245 PASS compileAndSerialize('a + (b /= c)') is 'a + (b /= c)' 246 246 PASS compileAndSerialize('a %= b %= c') is 'a %= b %= c' … … 254 254 PASS compileAndSerialize('a %= (b + c)') is 'a %= (b + c)' 255 255 PASS compileAndSerialize('a + b %= c') threw exception SyntaxError: Left hand side of operator '%=' must be a reference.. 256 PASS compileAndSerialize('(a + b) %= c') is '(a + b) %= c'256 PASS compileAndSerialize('(a + b) %= c') threw exception SyntaxError: Left side of assignment is not a reference.. 257 257 PASS compileAndSerialize('a + (b %= c)') is 'a + (b %= c)' 258 258 PASS compileAndSerialize('a += b += c') is 'a += b += c' … … 266 266 PASS compileAndSerialize('a += (b + c)') is 'a += (b + c)' 267 267 PASS compileAndSerialize('a + b += c') threw exception SyntaxError: Left hand side of operator '+=' must be a reference.. 268 PASS compileAndSerialize('(a + b) += c') is '(a + b) += c'268 PASS compileAndSerialize('(a + b) += c') threw exception SyntaxError: Left side of assignment is not a reference.. 269 269 PASS compileAndSerialize('a + (b += c)') is 'a + (b += c)' 270 270 PASS compileAndSerialize('a -= b -= c') is 'a -= b -= c' … … 278 278 PASS compileAndSerialize('a -= (b + c)') is 'a -= (b + c)' 279 279 PASS compileAndSerialize('a + b -= c') threw exception SyntaxError: Left hand side of operator '-=' must be a reference.. 280 PASS compileAndSerialize('(a + b) -= c') is '(a + b) -= c'280 PASS compileAndSerialize('(a + b) -= c') threw exception SyntaxError: Left side of assignment is not a reference.. 281 281 PASS compileAndSerialize('a + (b -= c)') is 'a + (b -= c)' 282 282 PASS compileAndSerialize('a <<= b <<= c') is 'a <<= b <<= c' … … 290 290 PASS compileAndSerialize('a <<= (b + c)') is 'a <<= (b + c)' 291 291 PASS compileAndSerialize('a + b <<= c') threw exception SyntaxError: Left hand side of operator '<<=' must be a reference.. 292 PASS compileAndSerialize('(a + b) <<= c') is '(a + b) <<= c'292 PASS compileAndSerialize('(a + b) <<= c') threw exception SyntaxError: Left side of assignment is not a reference.. 293 293 PASS compileAndSerialize('a + (b <<= c)') is 'a + (b <<= c)' 294 294 PASS compileAndSerialize('a >>= b >>= c') is 'a >>= b >>= c' … … 302 302 PASS compileAndSerialize('a >>= (b + c)') is 'a >>= (b + c)' 303 303 PASS compileAndSerialize('a + b >>= c') threw exception SyntaxError: Left hand side of operator '>>=' must be a reference.. 304 PASS compileAndSerialize('(a + b) >>= c') is '(a + b) >>= c'304 PASS compileAndSerialize('(a + b) >>= c') threw exception SyntaxError: Left side of assignment is not a reference.. 305 305 PASS compileAndSerialize('a + (b >>= c)') is 'a + (b >>= c)' 306 306 PASS compileAndSerialize('a >>>= b >>>= c') is 'a >>>= b >>>= c' … … 314 314 PASS compileAndSerialize('a >>>= (b + c)') is 'a >>>= (b + c)' 315 315 PASS compileAndSerialize('a + b >>>= c') threw exception SyntaxError: Left hand side of operator '>>>=' must be a reference.. 316 PASS compileAndSerialize('(a + b) >>>= c') is '(a + b) >>>= c'316 PASS compileAndSerialize('(a + b) >>>= c') threw exception SyntaxError: Left side of assignment is not a reference.. 317 317 PASS compileAndSerialize('a + (b >>>= c)') is 'a + (b >>>= c)' 318 318 PASS compileAndSerialize('a &= b &= c') is 'a &= b &= c' … … 326 326 PASS compileAndSerialize('a &= (b + c)') is 'a &= (b + c)' 327 327 PASS compileAndSerialize('a + b &= c') threw exception SyntaxError: Left hand side of operator '&=' must be a reference.. 328 PASS compileAndSerialize('(a + b) &= c') is '(a + b) &= c'328 PASS compileAndSerialize('(a + b) &= c') threw exception SyntaxError: Left side of assignment is not a reference.. 329 329 PASS compileAndSerialize('a + (b &= c)') is 'a + (b &= c)' 330 330 PASS compileAndSerialize('a ^= b ^= c') is 'a ^= b ^= c' … … 338 338 PASS compileAndSerialize('a ^= (b + c)') is 'a ^= (b + c)' 339 339 PASS compileAndSerialize('a + b ^= c') threw exception SyntaxError: Left hand side of operator '^=' must be a reference.. 340 PASS compileAndSerialize('(a + b) ^= c') is '(a + b) ^= c'340 PASS compileAndSerialize('(a + b) ^= c') threw exception SyntaxError: Left side of assignment is not a reference.. 341 341 PASS compileAndSerialize('a + (b ^= c)') is 'a + (b ^= c)' 342 342 PASS compileAndSerialize('a |= b |= c') is 'a |= b |= c' … … 350 350 PASS compileAndSerialize('a |= (b + c)') is 'a |= (b + c)' 351 351 PASS compileAndSerialize('a + b |= c') threw exception SyntaxError: Left hand side of operator '|=' must be a reference.. 352 PASS compileAndSerialize('(a + b) |= c') is '(a + b) |= c'352 PASS compileAndSerialize('(a + b) |= c') threw exception SyntaxError: Left side of assignment is not a reference.. 353 353 PASS compileAndSerialize('a + (b |= c)') is 'a + (b |= c)' 354 354 PASS compileAndSerialize('delete a + b') is 'delete a + b' … … 369 369 PASS compileAndSerialize('++a + b') is '++a + b' 370 370 PASS compileAndSerialize('(++a) + b') is '(++a) + b' 371 PASS compileAndSerialize('++(a + b)') is '++(a + b)'371 PASS compileAndSerialize('++(a + b)') threw exception SyntaxError: Prefix ++ operator applied to value that is not a reference.. 372 372 PASS compileAndSerialize('!++a') is '!++a' 373 373 PASS compileAndSerialize('!(++a)') is '!(++a)' 374 374 PASS compileAndSerialize('--a + b') is '--a + b' 375 375 PASS compileAndSerialize('(--a) + b') is '(--a) + b' 376 PASS compileAndSerialize('--(a + b)') is '--(a + b)'376 PASS compileAndSerialize('--(a + b)') threw exception SyntaxError: Prefix -- operator applied to value that is not a reference.. 377 377 PASS compileAndSerialize('!--a') is '!--a' 378 378 PASS compileAndSerialize('!(--a)') is '!(--a)' … … 399 399 PASS compileAndSerialize('!a++') is '!a++' 400 400 PASS compileAndSerialize('!(a++)') is '!(a++)' 401 PASS compileAndSerialize('(!a)++') is '(!a)++'401 PASS compileAndSerialize('(!a)++') threw exception SyntaxError: Postfix ++ operator applied to value that is not a reference.. 402 402 PASS compileAndSerialize('!a--') is '!a--' 403 403 PASS compileAndSerialize('!(a--)') is '!(a--)' 404 PASS compileAndSerialize('(!a)--') is '(!a)--'404 PASS compileAndSerialize('(!a)--') threw exception SyntaxError: Postfix -- operator applied to value that is not a reference.. 405 405 PASS compileAndSerialize('(-1)[a]') is '(-1)[a]' 406 406 PASS compileAndSerialize('(-1)[a] = b') is '(-1)[a] = b' … … 442 442 PASS compileAndSerialize('++(1).a') is '++(1).a' 443 443 PASS compileAndSerialize('(1).a()') is '(1).a()' 444 PASS compileAndSerialize('(-1) = a') is '(-1) = a'445 PASS compileAndSerialize('(- 0) = a') is '(- 0) = a'446 PASS compileAndSerialize('1 = a') is '1 = a'447 PASS compileAndSerialize('(-1) *= a') is '(-1) *= a'448 PASS compileAndSerialize('(- 0) *= a') is '(- 0) *= a'449 PASS compileAndSerialize('1 *= a') is '1 *= a'450 PASS compileAndSerialize('(-1) /= a') is '(-1) /= a'451 PASS compileAndSerialize('(- 0) /= a') is '(- 0) /= a'452 PASS compileAndSerialize('1 /= a') is '1 /= a'453 PASS compileAndSerialize('(-1) %= a') is '(-1) %= a'454 PASS compileAndSerialize('(- 0) %= a') is '(- 0) %= a'455 PASS compileAndSerialize('1 %= a') is '1 %= a'456 PASS compileAndSerialize('(-1) += a') is '(-1) += a'457 PASS compileAndSerialize('(- 0) += a') is '(- 0) += a'458 PASS compileAndSerialize('1 += a') is '1 += a'459 PASS compileAndSerialize('(-1) -= a') is '(-1) -= a'460 PASS compileAndSerialize('(- 0) -= a') is '(- 0) -= a'461 PASS compileAndSerialize('1 -= a') is '1 -= a'462 PASS compileAndSerialize('(-1) <<= a') is '(-1) <<= a'463 PASS compileAndSerialize('(- 0) <<= a') is '(- 0) <<= a'464 PASS compileAndSerialize('1 <<= a') is '1 <<= a'465 PASS compileAndSerialize('(-1) >>= a') is '(-1) >>= a'466 PASS compileAndSerialize('(- 0) >>= a') is '(- 0) >>= a'467 PASS compileAndSerialize('1 >>= a') is '1 >>= a'468 PASS compileAndSerialize('(-1) >>>= a') is '(-1) >>>= a'469 PASS compileAndSerialize('(- 0) >>>= a') is '(- 0) >>>= a'470 PASS compileAndSerialize('1 >>>= a') is '1 >>>= a'471 PASS compileAndSerialize('(-1) &= a') is '(-1) &= a'472 PASS compileAndSerialize('(- 0) &= a') is '(- 0) &= a'473 PASS compileAndSerialize('1 &= a') is '1 &= a'474 PASS compileAndSerialize('(-1) ^= a') is '(-1) ^= a'475 PASS compileAndSerialize('(- 0) ^= a') is '(- 0) ^= a'476 PASS compileAndSerialize('1 ^= a') is '1 ^= a'477 PASS compileAndSerialize('(-1) |= a') is '(-1) |= a'478 PASS compileAndSerialize('(- 0) |= a') is '(- 0) |= a'479 PASS compileAndSerialize('1 |= a') is '1 |= a'444 PASS compileAndSerialize('(-1) = a') threw exception SyntaxError: Left side of assignment is not a reference.. 445 PASS compileAndSerialize('(- 0) = a') threw exception SyntaxError: Left side of assignment is not a reference.. 446 PASS compileAndSerialize('1 = a') threw exception SyntaxError: Left side of assignment is not a reference.. 447 PASS compileAndSerialize('(-1) *= a') threw exception SyntaxError: Left side of assignment is not a reference.. 448 PASS compileAndSerialize('(- 0) *= a') threw exception SyntaxError: Left side of assignment is not a reference.. 449 PASS compileAndSerialize('1 *= a') threw exception SyntaxError: Left side of assignment is not a reference.. 450 PASS compileAndSerialize('(-1) /= a') threw exception SyntaxError: Left side of assignment is not a reference.. 451 PASS compileAndSerialize('(- 0) /= a') threw exception SyntaxError: Left side of assignment is not a reference.. 452 PASS compileAndSerialize('1 /= a') threw exception SyntaxError: Left side of assignment is not a reference.. 453 PASS compileAndSerialize('(-1) %= a') threw exception SyntaxError: Left side of assignment is not a reference.. 454 PASS compileAndSerialize('(- 0) %= a') threw exception SyntaxError: Left side of assignment is not a reference.. 455 PASS compileAndSerialize('1 %= a') threw exception SyntaxError: Left side of assignment is not a reference.. 456 PASS compileAndSerialize('(-1) += a') threw exception SyntaxError: Left side of assignment is not a reference.. 457 PASS compileAndSerialize('(- 0) += a') threw exception SyntaxError: Left side of assignment is not a reference.. 458 PASS compileAndSerialize('1 += a') threw exception SyntaxError: Left side of assignment is not a reference.. 459 PASS compileAndSerialize('(-1) -= a') threw exception SyntaxError: Left side of assignment is not a reference.. 460 PASS compileAndSerialize('(- 0) -= a') threw exception SyntaxError: Left side of assignment is not a reference.. 461 PASS compileAndSerialize('1 -= a') threw exception SyntaxError: Left side of assignment is not a reference.. 462 PASS compileAndSerialize('(-1) <<= a') threw exception SyntaxError: Left side of assignment is not a reference.. 463 PASS compileAndSerialize('(- 0) <<= a') threw exception SyntaxError: Left side of assignment is not a reference.. 464 PASS compileAndSerialize('1 <<= a') threw exception SyntaxError: Left side of assignment is not a reference.. 465 PASS compileAndSerialize('(-1) >>= a') threw exception SyntaxError: Left side of assignment is not a reference.. 466 PASS compileAndSerialize('(- 0) >>= a') threw exception SyntaxError: Left side of assignment is not a reference.. 467 PASS compileAndSerialize('1 >>= a') threw exception SyntaxError: Left side of assignment is not a reference.. 468 PASS compileAndSerialize('(-1) >>>= a') threw exception SyntaxError: Left side of assignment is not a reference.. 469 PASS compileAndSerialize('(- 0) >>>= a') threw exception SyntaxError: Left side of assignment is not a reference.. 470 PASS compileAndSerialize('1 >>>= a') threw exception SyntaxError: Left side of assignment is not a reference.. 471 PASS compileAndSerialize('(-1) &= a') threw exception SyntaxError: Left side of assignment is not a reference.. 472 PASS compileAndSerialize('(- 0) &= a') threw exception SyntaxError: Left side of assignment is not a reference.. 473 PASS compileAndSerialize('1 &= a') threw exception SyntaxError: Left side of assignment is not a reference.. 474 PASS compileAndSerialize('(-1) ^= a') threw exception SyntaxError: Left side of assignment is not a reference.. 475 PASS compileAndSerialize('(- 0) ^= a') threw exception SyntaxError: Left side of assignment is not a reference.. 476 PASS compileAndSerialize('1 ^= a') threw exception SyntaxError: Left side of assignment is not a reference.. 477 PASS compileAndSerialize('(-1) |= a') threw exception SyntaxError: Left side of assignment is not a reference.. 478 PASS compileAndSerialize('(- 0) |= a') threw exception SyntaxError: Left side of assignment is not a reference.. 479 PASS compileAndSerialize('1 |= a') threw exception SyntaxError: Left side of assignment is not a reference.. 480 480 PASS compileAndSerializeLeftmostTest('({ }).x') is '({ }).x' 481 481 PASS compileAndSerializeLeftmostTest('x = { }') is 'x = { }' -
trunk/LayoutTests/js/parser-syntax-check-expected.txt
r220068 r245406 25 25 PASS Valid: "new (-1)" with TypeError 26 26 PASS Valid: "function f() { new (-1) }" 27 PASS Valid: "a: b: c: new f(x++)++" with ReferenceError28 PASS Valid: "function f() { a: b: c: new f(x++)++ }"27 PASS Invalid: "a: b: c: new f(x++)++". Produced the following syntax error: "SyntaxError: Postfix ++ operator applied to value that is not a reference." 28 PASS Invalid: "function f() { a: b: c: new f(x++)++ }". Produced the following syntax error: "SyntaxError: Postfix ++ operator applied to value that is not a reference." 29 29 PASS Valid: "(a)++" with ReferenceError 30 30 PASS Valid: "function f() { (a)++ }" 31 PASS Valid: "(1--).x" with ReferenceError32 PASS Valid: "function f() { (1--).x }"31 PASS Invalid: "(1--).x". Produced the following syntax error: "SyntaxError: Postfix -- operator applied to value that is not a reference." 32 PASS Invalid: "function f() { (1--).x }". Produced the following syntax error: "SyntaxError: Postfix -- operator applied to value that is not a reference." 33 33 PASS Invalid: "a-- ++". Produced the following syntax error: "SyntaxError: Unexpected token '++'" 34 34 PASS Invalid: "function f() { a-- ++ }". Produced the following syntax error: "SyntaxError: Unexpected token '++'" 35 35 PASS Invalid: "(a:) --b". Produced the following syntax error: "SyntaxError: Unexpected token ':'. Expected ')' to end a compound expression." 36 36 PASS Invalid: "function f() { (a:) --b }". Produced the following syntax error: "SyntaxError: Unexpected token ':'. Expected ')' to end a compound expression." 37 PASS Valid: "++ -- ++ a" with ReferenceError38 PASS Valid: "function f() { ++ -- ++ a }"39 PASS Valid: "++ new new a ++" with ReferenceError40 PASS Valid: "function f() { ++ new new a ++ }"37 PASS Invalid: "++ -- ++ a". Produced the following syntax error: "SyntaxError: The prefix-increment operator requires a reference expression." 38 PASS Invalid: "function f() { ++ -- ++ a }". Produced the following syntax error: "SyntaxError: The prefix-increment operator requires a reference expression." 39 PASS Invalid: "++ new new a ++". Produced the following syntax error: "SyntaxError: Prefix ++ operator applied to value that is not a reference." 40 PASS Invalid: "function f() { ++ new new a ++ }". Produced the following syntax error: "SyntaxError: Prefix ++ operator applied to value that is not a reference." 41 41 PASS Valid: "delete void 0" 42 42 PASS Valid: "function f() { delete void 0 }" … … 45 45 PASS Invalid: "(a++". Produced the following syntax error: "SyntaxError: Unexpected end of script" 46 46 PASS Invalid: "function f() { (a++ }". Produced the following syntax error: "SyntaxError: Unexpected token '}'. Expected ')' to end a compound expression." 47 PASS Valid: "++a--" with ReferenceError48 PASS Valid: "function f() { ++a-- }"49 PASS Valid: "++((a))--" with ReferenceError50 PASS Valid: "function f() { ++((a))-- }"51 PASS Valid: "(a.x++)++" with ReferenceError52 PASS Valid: "function f() { (a.x++)++ }"47 PASS Invalid: "++a--". Produced the following syntax error: "SyntaxError: The increment operator requires a reference expression." 48 PASS Invalid: "function f() { ++a-- }". Produced the following syntax error: "SyntaxError: The increment operator requires a reference expression." 49 PASS Invalid: "++((a))--". Produced the following syntax error: "SyntaxError: The increment operator requires a reference expression." 50 PASS Invalid: "function f() { ++((a))-- }". Produced the following syntax error: "SyntaxError: The increment operator requires a reference expression." 51 PASS Invalid: "(a.x++)++". Produced the following syntax error: "SyntaxError: Postfix ++ operator applied to value that is not a reference." 52 PASS Invalid: "function f() { (a.x++)++ }". Produced the following syntax error: "SyntaxError: Postfix ++ operator applied to value that is not a reference." 53 53 PASS Invalid: "1: null". Produced the following syntax error: "SyntaxError: Unexpected token ':'. Parse error." 54 54 PASS Invalid: "function f() { 1: null }". Produced the following syntax error: "SyntaxError: Unexpected token ':'. Parse error." … … 111 111 PASS Invalid: "- false = 3". Produced the following syntax error: "SyntaxError: Left hand side of operator '=' must be a reference." 112 112 PASS Invalid: "function f() { - false = 3 }". Produced the following syntax error: "SyntaxError: Left hand side of operator '=' must be a reference." 113 PASS Valid: "a: b: c: (1 + null) = 3" with ReferenceError114 PASS Valid: "function f() { a: b: c: (1 + null) = 3 }"113 PASS Invalid: "a: b: c: (1 + null) = 3". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 114 PASS Invalid: "function f() { a: b: c: (1 + null) = 3 }". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 115 115 PASS Valid: "a[2] = b.l += c /= 4 * 7 ^ !6" with ReferenceError 116 116 PASS Valid: "function f() { a[2] = b.l += c /= 4 * 7 ^ !6 }" … … 119 119 PASS Invalid: "typeof a &= typeof b". Produced the following syntax error: "SyntaxError: Left hand side of operator '&=' must be a reference." 120 120 PASS Invalid: "function f() { typeof a &= typeof b }". Produced the following syntax error: "SyntaxError: Left hand side of operator '&=' must be a reference." 121 PASS Valid: "a: ((typeof (a))) >>>= a || b.l && c" with ReferenceError122 PASS Valid: "function f() { a: ((typeof (a))) >>>= a || b.l && c }"121 PASS Invalid: "a: ((typeof (a))) >>>= a || b.l && c". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 122 PASS Invalid: "function f() { a: ((typeof (a))) >>>= a || b.l && c }". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 123 123 PASS Valid: "a: b: c[a /= f[a %= b]].l[c[x] = 7] -= a ? b <<= f : g" with ReferenceError 124 124 PASS Valid: "function f() { a: b: c[a /= f[a %= b]].l[c[x] = 7] -= a ? b <<= f : g }" … … 128 128 PASS Valid: "a()()()" with ReferenceError 129 129 PASS Valid: "function f() { a()()() }" 130 PASS Valid: "s: l: a[2](4 == 6, 5 = 6)(f[4], 6)" with ReferenceError131 PASS Valid: "function f() { s: l: a[2](4 == 6, 5 = 6)(f[4], 6) }"130 PASS Invalid: "s: l: a[2](4 == 6, 5 = 6)(f[4], 6)". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 131 PASS Invalid: "function f() { s: l: a[2](4 == 6, 5 = 6)(f[4], 6) }". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 132 132 PASS Valid: "s: eval(a.apply(), b.call(c[5] - f[7]))" with ReferenceError 133 133 PASS Valid: "function f() { s: eval(a.apply(), b.call(c[5] - f[7])) }" … … 358 358 PASS Invalid: "const a, a, a = void 7 - typeof 8, a = 8". Produced the following syntax error: "SyntaxError: Unexpected token ','. const declared variable 'a' must have an initializer." 359 359 PASS Invalid: "function f() { const a, a, a = void 7 - typeof 8, a = 8 }". Produced the following syntax error: "SyntaxError: Unexpected token ','. const declared variable 'a' must have an initializer." 360 PASS Valid: "const x_x = 6 /= 7 ? e : f" with ReferenceError361 PASS Valid: "function f() { const x_x = 6 /= 7 ? e : f }"360 PASS Invalid: "const x_x = 6 /= 7 ? e : f". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 361 PASS Invalid: "function f() { const x_x = 6 /= 7 ? e : f }". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 362 362 PASS Invalid: "var a = ?". Produced the following syntax error: "SyntaxError: Unexpected token '?'" 363 363 PASS Invalid: "function f() { var a = ? }". Produced the following syntax error: "SyntaxError: Unexpected token '?'" … … 505 505 PASS Valid: "for (var a in b in c) break" with ReferenceError 506 506 PASS Valid: "function f() { for (var a in b in c) break }" 507 PASS Valid: "for (var a = 5 += 6 in b) break" with ReferenceError508 PASS Valid: "function f() { for (var a = 5 += 6 in b) break }"507 PASS Invalid: "for (var a = 5 += 6 in b) break". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 508 PASS Invalid: "function f() { for (var a = 5 += 6 in b) break }". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 509 509 PASS Valid: "for (var a = foo('should be hit') in b) break" with ReferenceError 510 510 PASS Valid: "function f() { for (var a = foo('should be hit') in b) break }" … … 525 525 PASS Invalid: "for (var (a) in b) { }". Produced the following syntax error: "SyntaxError: Unexpected token '('. Expected a parameter pattern or a ')' in parameter list." 526 526 PASS Invalid: "function f() { for (var (a) in b) { } }". Produced the following syntax error: "SyntaxError: Unexpected token '('. Expected a parameter pattern or a ')' in parameter list." 527 PASS Valid: "for (var a = 7, b = c < d >= d ; f()[6]++ ; --i()[1]++ ) {}" with ReferenceError528 PASS Valid: "function f() { for (var a = 7, b = c < d >= d ; f()[6]++ ; --i()[1]++ ) {} }"527 PASS Invalid: "for (var a = 7, b = c < d >= d ; f()[6]++ ; --i()[1]++ ) {}". Produced the following syntax error: "SyntaxError: The decrement operator requires a reference expression." 528 PASS Invalid: "function f() { for (var a = 7, b = c < d >= d ; f()[6]++ ; --i()[1]++ ) {} }". Produced the following syntax error: "SyntaxError: The decrement operator requires a reference expression." 529 529 PASS Invalid: "for (var {a} = 20 in b) { }". Produced the following syntax error: "SyntaxError: Cannot assign to the loop variable inside a for-in loop header." 530 530 PASS Invalid: "function f() { for (var {a} = 20 in b) { } }". Produced the following syntax error: "SyntaxError: Cannot assign to the loop variable inside a for-in loop header." … … 879 879 PASS Valid: "if (0) new a(b+c).d = 5" 880 880 PASS Valid: "function f() { if (0) new a(b+c).d = 5 }" 881 PASS Valid: "if (0) new a(b+c) = 5"882 PASS Valid: "function f() { if (0) new a(b+c) = 5 }"881 PASS Invalid: "if (0) new a(b+c) = 5". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 882 PASS Invalid: "function f() { if (0) new a(b+c) = 5 }". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 883 883 PASS Valid: "([1 || 1].a = 1)" 884 884 PASS Valid: "function f() { ([1 || 1].a = 1) }" … … 1044 1044 PASS Valid: "({a:a}=1)()" with TypeError 1045 1045 PASS Valid: "function f() { ({a:a}=1)() }" 1046 PASS Valid: "({a}=1)=1" with ReferenceError1047 PASS Valid: "function f() { ({a}=1)=1 }"1048 PASS Valid: "({a:a}=1)=1" with ReferenceError1049 PASS Valid: "function f() { ({a:a}=1)=1 }"1050 PASS Valid: "({a}=1=1)" with ReferenceError1051 PASS Valid: "function f() { ({a}=1=1) }"1052 PASS Valid: "({a:a}=1=1)" with ReferenceError1053 PASS Valid: "function f() { ({a:a}=1=1) }"1046 PASS Invalid: "({a}=1)=1". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 1047 PASS Invalid: "function f() { ({a}=1)=1 }". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 1048 PASS Invalid: "({a:a}=1)=1". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 1049 PASS Invalid: "function f() { ({a:a}=1)=1 }". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 1050 PASS Invalid: "({a}=1=1)". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 1051 PASS Invalid: "function f() { ({a}=1=1) }". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 1052 PASS Invalid: "({a:a}=1=1)". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 1053 PASS Invalid: "function f() { ({a:a}=1=1) }". Produced the following syntax error: "SyntaxError: Left side of assignment is not a reference." 1054 1054 PASS Invalid: "var {x}". Produced the following syntax error: "SyntaxError: Unexpected end of script" 1055 1055 PASS Invalid: "function f() { var {x} }". Produced the following syntax error: "SyntaxError: Unexpected token '}'. Expected an initializer in destructuring variable declaration." -
trunk/LayoutTests/js/parser-xml-close-comment-expected.txt
r215235 r245406 4 4 5 5 6 PASS 'should be a syntax error' --> threw exception SyntaxError: Unexpected end of script.7 PASS /**/ 1--> threw exception SyntaxError: Unexpected end of script.8 PASS /**/ 1 --> threw exception SyntaxError: Unexpected end of script.9 PASS 1 /**/--> threw exception SyntaxError: Unexpected end of script.10 PASS 1 /**/ --> threw exception SyntaxError: Unexpected end of script.6 PASS 'should be a syntax error' --> threw exception SyntaxError: Postfix -- operator applied to value that is not a reference.. 7 PASS /**/ 1--> threw exception SyntaxError: Postfix -- operator applied to value that is not a reference.. 8 PASS /**/ 1 --> threw exception SyntaxError: Postfix -- operator applied to value that is not a reference.. 9 PASS 1 /**/--> threw exception SyntaxError: Postfix -- operator applied to value that is not a reference.. 10 PASS 1 /**/ --> threw exception SyntaxError: Postfix -- operator applied to value that is not a reference.. 11 11 PASS 1/* 12 12 */--> is 1 -
trunk/LayoutTests/js/script-tests/function-toString-parentheses.js
r187012 r245406 105 105 testLowerFirst(op, "+"); 106 106 shouldThrow("compileAndSerialize('a + b " + op + " c')"); 107 testKeepParentheses("(a + b) " + op + " c");107 shouldThrow("compileAndSerialize('(a + b) " + op + " c')"); 108 108 testKeepParentheses("a + (b " + op + " c)"); 109 109 } … … 116 116 testKeepParentheses("" + op + "a + b"); 117 117 testOptionalParentheses("(" + op + "a) + b"); 118 testKeepParentheses("" + op + "(a + b)"); 118 if (prefixOperators[i] !== "++" && prefixOperators[i] !== "--") 119 testKeepParentheses("" + op + "(a + b)"); 120 else 121 shouldThrow("compileAndSerialize('" + op + "(a + b)')"); 119 122 testKeepParentheses("!" + op + "a"); 120 123 testOptionalParentheses("!(" + op + "a)"); … … 124 127 testKeepParentheses("!a++"); 125 128 testOptionalParentheses("!(a++)"); 126 testKeepParentheses("(!a)++");129 shouldThrow("compileAndSerialize('(!a)++')"); 127 130 128 131 testKeepParentheses("!a--"); 129 132 testOptionalParentheses("!(a--)"); 130 testKeepParentheses("(!a)--");133 shouldThrow("compileAndSerialize('(!a)--')"); 131 134 132 135 testKeepParentheses("(-1)[a]"); … … 183 186 for (i = 0; i < assignmentOperators.length; ++i) { 184 187 var op = assignmentOperators[i]; 185 testKeepParentheses("(-1) " + op + " a");186 testKeepParentheses("(- 0) " + op + " a");187 testKeepParentheses("1 " + op + " a");188 shouldThrow("compileAndSerialize('(-1) " + op + " a')"); 189 shouldThrow("compileAndSerialize('(- 0) " + op + " a')"); 190 shouldThrow("compileAndSerialize('1 " + op + " a')"); 188 191 } 189 192 -
trunk/LayoutTests/js/script-tests/parser-syntax-check.js
r220068 r245406 84 84 invalid("new -a"); 85 85 valid ("new (-1)") 86 valid("a: b: c: new f(x++)++")86 invalid("a: b: c: new f(x++)++") 87 87 valid ("(a)++"); 88 valid("(1--).x");88 invalid("(1--).x"); 89 89 invalid("a-- ++"); 90 90 invalid("(a:) --b"); 91 valid("++ -- ++ a");92 valid("++ new new a ++");91 invalid("++ -- ++ a"); 92 invalid("++ new new a ++"); 93 93 valid ("delete void 0"); 94 94 invalid("delete the void"); 95 95 invalid("(a++"); 96 valid("++a--");97 valid("++((a))--");98 valid("(a.x++)++");96 invalid("++a--"); 97 invalid("++((a))--"); 98 invalid("(a.x++)++"); 99 99 invalid("1: null"); 100 100 invalid("+-!~"); … … 132 132 valid ("- - true % 5"); 133 133 invalid("- false = 3"); 134 valid("a: b: c: (1 + null) = 3");134 invalid("a: b: c: (1 + null) = 3"); 135 135 valid ("a[2] = b.l += c /= 4 * 7 ^ !6"); 136 136 invalid("a + typeof b += c in d"); 137 137 invalid("typeof a &= typeof b"); 138 valid("a: ((typeof (a))) >>>= a || b.l && c");138 invalid("a: ((typeof (a))) >>>= a || b.l && c"); 139 139 valid ("a: b: c[a /= f[a %= b]].l[c[x] = 7] -= a ? b <<= f : g"); 140 140 valid ("-void+x['y'].l == x.l != 5 - f[7]"); … … 143 143 144 144 valid ("a()()()"); 145 valid("s: l: a[2](4 == 6, 5 = 6)(f[4], 6)");145 invalid("s: l: a[2](4 == 6, 5 = 6)(f[4], 6)"); 146 146 valid ("s: eval(a.apply(), b.call(c[5] - f[7]))"); 147 147 invalid("a("); … … 269 269 valid ("const a = void 7 - typeof 8, b = 8"); 270 270 invalid("const a, a, a = void 7 - typeof 8, a = 8"); 271 valid("const x_x = 6 /= 7 ? e : f");271 invalid("const x_x = 6 /= 7 ? e : f"); 272 272 invalid("var a = ?"); 273 273 invalid("const a = *7"); … … 346 346 valid ("for ((a ? b : c) in c) break"); 347 347 valid ("for (var a in b in c) break"); 348 valid("for (var a = 5 += 6 in b) break");348 invalid("for (var a = 5 += 6 in b) break"); 349 349 valid("for (var a = foo('should be hit') in b) break"); 350 350 invalid("for (var a += 5 in b) break"); … … 356 356 invalid("for (var a = (b in c in d) break"); 357 357 invalid("for (var (a) in b) { }"); 358 valid("for (var a = 7, b = c < d >= d ; f()[6]++ ; --i()[1]++ ) {}");358 invalid("for (var a = 7, b = c < d >= d ; f()[6]++ ; --i()[1]++ ) {}"); 359 359 invalid("for (var {a} = 20 in b) { }"); 360 360 invalid("for (var {a} = 20 of b) { }"); … … 544 544 valid("if (0) obj.foo\\u03bb; ") 545 545 valid("if (0) new a(b+c).d = 5"); 546 valid("if (0) new a(b+c) = 5");546 invalid("if (0) new a(b+c) = 5"); 547 547 valid("([1 || 1].a = 1)"); 548 548 valid("({a: 1 || 1}.a = 1)"); … … 632 632 valid("({a}=1)()") 633 633 valid("({a:a}=1)()") 634 valid("({a}=1)=1")635 valid("({a:a}=1)=1")636 valid("({a}=1=1)")637 valid("({a:a}=1=1)")634 invalid("({a}=1)=1") 635 invalid("({a:a}=1)=1") 636 invalid("({a}=1=1)") 637 invalid("({a:a}=1=1)") 638 638 invalid("var {x}") 639 639 invalid("var {x, y}") -
trunk/LayoutTests/js/script-tests/toString-prefix-postfix-preserve-parens.js
r98407 r245406 1 1 description( 2 "This test checks that toString() round-trip on a function that has prefix, postfix and typeof operators applied to group expression will not remove the grouping. Also checks that evaluation of such a expression produces run-time exception"2 "This test checks that toString() round-trip on a function that has a typeof operator applied to a group expression will not remove the grouping." 3 3 ); 4 5 function postfix_should_preserve_parens(x, y, z) {6 (x, y)++;7 return y;8 }9 10 function prefix_should_preserve_parens(x, y, z) {11 ++(x, y);12 return x;13 14 }15 16 function both_should_preserve_parens(x, y, z) {17 ++(x, y)--;18 return x;19 20 }21 22 function postfix_should_preserve_parens_multi(x, y, z) {23 (((x, y)))--;24 return x;25 }26 27 function prefix_should_preserve_parens_multi(x, y, z) {28 --(((x, y)));29 return x;30 }31 32 function both_should_preserve_parens_multi(x, y, z) {33 ++(((x, y)))--;34 return x;35 }36 37 function postfix_should_preserve_parens_multi1(x, y, z) {38 (((x)), y)--;39 return x;40 }41 42 function prefix_should_preserve_parens_multi1(x, y, z) {43 --(((x)), y);44 return x;45 }46 47 function prefix_should_preserve_parens_multi2(x, y, z) {48 var z = 0;49 --(((x), y), z);50 return x;51 }52 53 function postfix_should_preserve_parens_multi2(x, y, z) {54 var z = 0;55 (((x), y) ,z)++;56 return x;57 }58 4 59 5 // if these return a variable (such as y) instead of … … 92 38 } 93 39 94 function testToStringAndRTFailure(fn)95 {96 testToString(fn);97 98 // check that function call produces run-time exception99 shouldThrow(""+fn+ "(1, 2, 3);");100 101 // check that function call produces run-time exception after eval(unevalf)102 shouldThrow("eval(unevalf("+fn+ "))(1, 2, 3);");103 }104 105 40 function testToStringAndReturn(fn, p1, p2, retval) 106 41 { … … 115 50 } 116 51 117 118 testToStringAndRTFailure("prefix_should_preserve_parens");119 testToStringAndRTFailure("postfix_should_preserve_parens");120 testToStringAndRTFailure("both_should_preserve_parens");121 testToStringAndRTFailure("prefix_should_preserve_parens_multi");122 testToStringAndRTFailure("postfix_should_preserve_parens_multi");123 testToStringAndRTFailure("prefix_should_preserve_parens_multi1");124 testToStringAndRTFailure("postfix_should_preserve_parens_multi1");125 testToStringAndRTFailure("prefix_should_preserve_parens_multi2");126 testToStringAndRTFailure("postfix_should_preserve_parens_multi2");127 128 52 testToStringAndReturn("typeof_should_preserve_parens", "'a'", 1, "'number'"); 129 53 testToStringAndReturn("typeof_should_preserve_parens1", "'a'", 1, "'number'"); -
trunk/LayoutTests/js/toString-prefix-postfix-preserve-parens-expected.txt
r33979 r245406 1 This test checks that toString() round-trip on a function that has prefix, postfix and typeof operators applied to group expression will not remove the grouping. Also checks that evaluation of such a expression produces run-time exception1 This test checks that toString() round-trip on a function that has a typeof operator applied to a group expression will not remove the grouping. 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 PASS unevalf(eval(unevalf(prefix_should_preserve_parens))) is unevalf(prefix_should_preserve_parens)7 PASS /.*\(+x\)*, y\)/.test(unevalf(prefix_should_preserve_parens)) is true8 PASS prefix_should_preserve_parens(1, 2, 3); threw exception ReferenceError: Prefix ++ operator applied to value that is not a reference..9 PASS eval(unevalf(prefix_should_preserve_parens))(1, 2, 3); threw exception ReferenceError: Prefix ++ operator applied to value that is not a reference..10 PASS unevalf(eval(unevalf(postfix_should_preserve_parens))) is unevalf(postfix_should_preserve_parens)11 PASS /.*\(+x\)*, y\)/.test(unevalf(postfix_should_preserve_parens)) is true12 PASS postfix_should_preserve_parens(1, 2, 3); threw exception ReferenceError: Postfix ++ operator applied to value that is not a reference..13 PASS eval(unevalf(postfix_should_preserve_parens))(1, 2, 3); threw exception ReferenceError: Postfix ++ operator applied to value that is not a reference..14 PASS unevalf(eval(unevalf(both_should_preserve_parens))) is unevalf(both_should_preserve_parens)15 PASS /.*\(+x\)*, y\)/.test(unevalf(both_should_preserve_parens)) is true16 PASS both_should_preserve_parens(1, 2, 3); threw exception ReferenceError: Prefix ++ operator applied to value that is not a reference..17 PASS eval(unevalf(both_should_preserve_parens))(1, 2, 3); threw exception ReferenceError: Prefix ++ operator applied to value that is not a reference..18 PASS unevalf(eval(unevalf(prefix_should_preserve_parens_multi))) is unevalf(prefix_should_preserve_parens_multi)19 PASS /.*\(+x\)*, y\)/.test(unevalf(prefix_should_preserve_parens_multi)) is true20 PASS prefix_should_preserve_parens_multi(1, 2, 3); threw exception ReferenceError: Prefix -- operator applied to value that is not a reference..21 PASS eval(unevalf(prefix_should_preserve_parens_multi))(1, 2, 3); threw exception ReferenceError: Prefix -- operator applied to value that is not a reference..22 PASS unevalf(eval(unevalf(postfix_should_preserve_parens_multi))) is unevalf(postfix_should_preserve_parens_multi)23 PASS /.*\(+x\)*, y\)/.test(unevalf(postfix_should_preserve_parens_multi)) is true24 PASS postfix_should_preserve_parens_multi(1, 2, 3); threw exception ReferenceError: Postfix -- operator applied to value that is not a reference..25 PASS eval(unevalf(postfix_should_preserve_parens_multi))(1, 2, 3); threw exception ReferenceError: Postfix -- operator applied to value that is not a reference..26 PASS unevalf(eval(unevalf(prefix_should_preserve_parens_multi1))) is unevalf(prefix_should_preserve_parens_multi1)27 PASS /.*\(+x\)*, y\)/.test(unevalf(prefix_should_preserve_parens_multi1)) is true28 PASS prefix_should_preserve_parens_multi1(1, 2, 3); threw exception ReferenceError: Prefix -- operator applied to value that is not a reference..29 PASS eval(unevalf(prefix_should_preserve_parens_multi1))(1, 2, 3); threw exception ReferenceError: Prefix -- operator applied to value that is not a reference..30 PASS unevalf(eval(unevalf(postfix_should_preserve_parens_multi1))) is unevalf(postfix_should_preserve_parens_multi1)31 PASS /.*\(+x\)*, y\)/.test(unevalf(postfix_should_preserve_parens_multi1)) is true32 PASS postfix_should_preserve_parens_multi1(1, 2, 3); threw exception ReferenceError: Postfix -- operator applied to value that is not a reference..33 PASS eval(unevalf(postfix_should_preserve_parens_multi1))(1, 2, 3); threw exception ReferenceError: Postfix -- operator applied to value that is not a reference..34 PASS unevalf(eval(unevalf(prefix_should_preserve_parens_multi2))) is unevalf(prefix_should_preserve_parens_multi2)35 PASS /.*\(+x\)*, y\)/.test(unevalf(prefix_should_preserve_parens_multi2)) is true36 PASS prefix_should_preserve_parens_multi2(1, 2, 3); threw exception ReferenceError: Prefix -- operator applied to value that is not a reference..37 PASS eval(unevalf(prefix_should_preserve_parens_multi2))(1, 2, 3); threw exception ReferenceError: Prefix -- operator applied to value that is not a reference..38 PASS unevalf(eval(unevalf(postfix_should_preserve_parens_multi2))) is unevalf(postfix_should_preserve_parens_multi2)39 PASS /.*\(+x\)*, y\)/.test(unevalf(postfix_should_preserve_parens_multi2)) is true40 PASS postfix_should_preserve_parens_multi2(1, 2, 3); threw exception ReferenceError: Postfix ++ operator applied to value that is not a reference..41 PASS eval(unevalf(postfix_should_preserve_parens_multi2))(1, 2, 3); threw exception ReferenceError: Postfix ++ operator applied to value that is not a reference..42 6 PASS unevalf(eval(unevalf(typeof_should_preserve_parens))) is unevalf(typeof_should_preserve_parens) 43 7 PASS /.*\(+x\)*, y\)/.test(unevalf(typeof_should_preserve_parens)) is true -
trunk/Source/JavaScriptCore/ChangeLog
r245341 r245406 1 2019-05-16 Ross Kirsling <ross.kirsling@sony.com> 2 3 [JSC] Invalid AssignmentTargetType should be an early error. 4 https://bugs.webkit.org/show_bug.cgi?id=197603 5 6 Reviewed by Keith Miller. 7 8 Since ES6, expressions like 0++, ++0, 0 = 0, and 0 += 0 are all specified as early errors: 9 https://tc39.github.io/ecma262/#sec-update-expressions-static-semantics-early-errors 10 https://tc39.github.io/ecma262/#sec-assignment-operators-static-semantics-early-errors 11 12 We currently throw late ReferenceErrors for these -- let's turn them into early SyntaxErrors. 13 (This is based on the expectation that https://github.com/tc39/ecma262/pull/1527 will be accepted; 14 if that doesn't come to pass, we can subsequently introduce early ReferenceError and revise these.) 15 16 * bytecompiler/NodesCodegen.cpp: 17 (JSC::PostfixNode::emitBytecode): Add an assert for "function call LHS" case. 18 (JSC::PrefixNode::emitBytecode): Add an assert for "function call LHS" case. 19 20 * parser/ASTBuilder.h: 21 (JSC::ASTBuilder::isLocation): Added. 22 (JSC::ASTBuilder::isAssignmentLocation): Fix misleading parameter name. 23 (JSC::ASTBuilder::isFunctionCall): Added. 24 (JSC::ASTBuilder::makeAssignNode): Add an assert for "function call LHS" case. 25 * parser/SyntaxChecker.h: 26 (JSC::SyntaxChecker::isLocation): Added. 27 (JSC::SyntaxChecker::isAssignmentLocation): Fix incorrect definition and align with ASTBuilder. 28 (JSC::SyntaxChecker::isFunctionCall): Added. 29 * parser/Nodes.h: 30 (JSC::ExpressionNode::isFunctionCall const): Added. 31 Ensure that the parser can check whether an expression node is a function call. 32 33 * parser/Parser.cpp: 34 (JSC::Parser<LexerType>::isSimpleAssignmentTarget): Added. 35 (JSC::Parser<LexerType>::parseAssignmentExpression): 36 (JSC::Parser<LexerType>::parseUnaryExpression): See below. 37 * parser/Parser.h: 38 Throw SyntaxError whenever an assignment or update expression's target is invalid. 39 Unfortunately, it seems that web compatibility obliges us to exempt the "function call LHS" case in sloppy mode. 40 (https://github.com/tc39/ecma262/issues/257#issuecomment-195106880) 41 42 Additional cleanup items: 43 - Make use of `semanticFailIfTrue` for `isMetaProperty` checks, as it's equivalent. 44 - Rename `requiresLExpr` to `hasPrefixUpdateOp` since it's now confusing, 45 and get rid of `modifiesExpr` since it refers to the exact same condition. 46 - Stop setting `lastOperator` near the end -- one case was incorrect and regardless neither is used. 47 1 48 2019-05-15 Saam Barati <sbarati@apple.com> 2 49 -
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r244915 r245406 1667 1667 return emitDot(generator, dst); 1668 1668 1669 ASSERT(m_expr->isFunctionCall()); 1669 1670 return emitThrowReferenceError(generator, m_operator == OpPlusPlus 1670 1671 ? "Postfix ++ operator applied to value that is not a reference."_s … … 1880 1881 return emitDot(generator, dst); 1881 1882 1883 ASSERT(m_expr->isFunctionCall()); 1882 1884 return emitThrowReferenceError(generator, m_operator == OpPlusPlus 1883 1885 ? "Prefix ++ operator applied to value that is not a reference."_s -
trunk/Source/JavaScriptCore/parser/ASTBuilder.h
r245288 r245406 628 628 } 629 629 630 bool isAssignmentLocation(const Expression& pattern) 631 { 632 return pattern->isAssignmentLocation(); 630 bool isLocation(const Expression& node) 631 { 632 return node->isLocation(); 633 } 634 635 bool isAssignmentLocation(const Expression& node) 636 { 637 return node->isAssignmentLocation(); 633 638 } 634 639 … … 646 651 { 647 652 return isObjectLiteral(node) || isArrayLiteral(node); 653 } 654 655 bool isFunctionCall(const Expression& node) 656 { 657 return node->isFunctionCall(); 648 658 } 649 659 … … 1468 1478 ExpressionNode* ASTBuilder::makeAssignNode(const JSTokenLocation& location, ExpressionNode* loc, Operator op, ExpressionNode* expr, bool locHasAssignments, bool exprHasAssignments, const JSTextPosition& start, const JSTextPosition& divot, const JSTextPosition& end) 1469 1479 { 1470 if (!loc->isLocation()) 1480 if (!loc->isLocation()) { 1481 ASSERT(loc->isFunctionCall()); 1471 1482 return new (m_parserArena) AssignErrorNode(location, divot, start, end); 1483 } 1472 1484 1473 1485 if (loc->isResolveNode()) { -
trunk/Source/JavaScriptCore/parser/Nodes.h
r245288 r245406 205 205 virtual bool isBytecodeIntrinsicNode() const { return false; } 206 206 virtual bool isBinaryOpNode() const { return false; } 207 virtual bool isFunctionCall() const { return false; } 207 208 208 209 virtual void emitBytecodeInConditionContext(BytecodeGenerator&, Label&, Label&, FallThroughMode); … … 870 871 RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override; 871 872 873 bool isFunctionCall() const override { return true; } 874 872 875 ArgumentsNode* m_args; 873 876 }; … … 879 882 private: 880 883 RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override; 884 885 bool isFunctionCall() const override { return true; } 881 886 882 887 ExpressionNode* m_expr; … … 891 896 RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override; 892 897 898 bool isFunctionCall() const override { return true; } 899 893 900 const Identifier& m_ident; 894 901 ArgumentsNode* m_args; … … 901 908 private: 902 909 RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override; 910 911 bool isFunctionCall() const override { return true; } 903 912 904 913 ExpressionNode* m_base; … … 916 925 917 926 protected: 927 bool isFunctionCall() const override { return true; } 928 918 929 ExpressionNode* m_base; 919 930 const Identifier& m_ident; … … 945 956 private: 946 957 RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override; 958 959 bool isFunctionCall() const override { return m_type == Type::Function; } 947 960 948 961 EmitterType m_emitter; -
trunk/Source/JavaScriptCore/parser/Parser.cpp
r245152 r245406 3632 3632 return "error"; 3633 3633 } 3634 3635 template <typename LexerType> 3636 template <typename TreeBuilder> bool Parser<LexerType>::isSimpleAssignmentTarget(TreeBuilder& context, TreeExpression expr) 3637 { 3638 // Web compatibility concerns prevent us from handling a function call LHS as an early error in sloppy mode. 3639 // This behavior is currently unspecified, but see: https://github.com/tc39/ecma262/issues/257#issuecomment-195106880 3640 return context.isLocation(expr) || (!strictMode() && context.isFunctionCall(expr)); 3641 } 3634 3642 3635 3643 template <typename LexerType> … … 3738 3746 m_parserState.nonTrivialExpressionCount++; 3739 3747 hadAssignment = true; 3740 if (UNLIKELY(context.isMetaProperty(lhs)))3741 internalFailWithMessage(false, metaPropertyName(context, lhs), " can't be the left hand side of an assignment expression");3748 semanticFailIfTrue(context.isMetaProperty(lhs), metaPropertyName(context, lhs), " can't be the left hand side of an assignment expression"); 3749 semanticFailIfFalse(isSimpleAssignmentTarget(context, lhs), "Left side of assignment is not a reference"); 3742 3750 context.assignmentStackAppend(assignmentStack, lhs, start, tokenStartPosition(), m_parserState.assignmentCount, op); 3743 3751 start = tokenStartPosition(); … … 4930 4938 AllowInOverride allowInOverride(this); 4931 4939 int tokenStackDepth = 0; 4932 bool modifiesExpr = false; 4933 bool requiresLExpr = false; 4940 bool hasPrefixUpdateOp = false; 4934 4941 unsigned lastOperator = 0; 4935 4942 … … 4940 4947 4941 4948 while (isUnaryOp(m_token.m_type)) { 4942 if (strictMode()) { 4943 switch (m_token.m_type) { 4944 case PLUSPLUS: 4945 case MINUSMINUS: 4946 case AUTOPLUSPLUS: 4947 case AUTOMINUSMINUS: 4948 semanticFailIfTrue(requiresLExpr, "The ", operatorString(true, lastOperator), " operator requires a reference expression"); 4949 modifiesExpr = true; 4950 requiresLExpr = true; 4951 break; 4952 default: 4953 semanticFailIfTrue(requiresLExpr, "The ", operatorString(true, lastOperator), " operator requires a reference expression"); 4954 break; 4955 } 4949 switch (m_token.m_type) { 4950 case PLUSPLUS: 4951 case MINUSMINUS: 4952 case AUTOPLUSPLUS: 4953 case AUTOMINUSMINUS: 4954 semanticFailIfTrue(hasPrefixUpdateOp, "The ", operatorString(true, lastOperator), " operator requires a reference expression"); 4955 hasPrefixUpdateOp = true; 4956 break; 4957 default: 4958 semanticFailIfTrue(hasPrefixUpdateOp, "The ", operatorString(true, lastOperator), " operator requires a reference expression"); 4959 break; 4956 4960 } 4957 4961 lastOperator = m_token.m_type; … … 4969 4973 failWithMessage("Cannot parse member expression"); 4970 4974 } 4971 if (UNLIKELY(isUpdateOp(static_cast<JSTokenType>(lastOperator)) && context.isMetaProperty(expr))) 4972 internalFailWithMessage(false, metaPropertyName(context, expr), " can't come after a prefix operator"); 4975 if (isUpdateOp(static_cast<JSTokenType>(lastOperator))) { 4976 semanticFailIfTrue(context.isMetaProperty(expr), metaPropertyName(context, expr), " can't come after a prefix operator"); 4977 semanticFailIfFalse(isSimpleAssignmentTarget(context, expr), "Prefix ", lastOperator == PLUSPLUS ? "++" : "--", " operator applied to value that is not a reference"); 4978 } 4973 4979 bool isEvalOrArguments = false; 4974 4980 if (strictMode()) { … … 4976 4982 isEvalOrArguments = *m_parserState.lastIdentifier == m_vm->propertyNames->eval || *m_parserState.lastIdentifier == m_vm->propertyNames->arguments; 4977 4983 } 4978 failIfTrueIfStrict(isEvalOrArguments && modifiesExpr, "Cannot modify '", m_parserState.lastIdentifier->impl(), "' in strict mode");4984 failIfTrueIfStrict(isEvalOrArguments && hasPrefixUpdateOp, "Cannot modify '", m_parserState.lastIdentifier->impl(), "' in strict mode"); 4979 4985 switch (m_token.m_type) { 4980 4986 case PLUSPLUS: 4981 if (UNLIKELY(context.isMetaProperty(expr)))4982 internalFailWithMessage(false, metaPropertyName(context, expr), " can't come before a postfix operator");4987 semanticFailIfTrue(context.isMetaProperty(expr), metaPropertyName(context, expr), " can't come before a postfix operator"); 4988 semanticFailIfFalse(isSimpleAssignmentTarget(context, expr), "Postfix ++ operator applied to value that is not a reference"); 4983 4989 m_parserState.nonTrivialExpressionCount++; 4984 4990 m_parserState.nonLHSCount++; … … 4986 4992 m_parserState.assignmentCount++; 4987 4993 failIfTrueIfStrict(isEvalOrArguments, "Cannot modify '", m_parserState.lastIdentifier->impl(), "' in strict mode"); 4988 semanticFailIfTrue(requiresLExpr, "The ", operatorString(false, lastOperator), " operator requires a reference expression"); 4989 lastOperator = PLUSPLUS; 4994 semanticFailIfTrue(hasPrefixUpdateOp, "The ", operatorString(false, lastOperator), " operator requires a reference expression"); 4990 4995 next(); 4991 4996 break; 4992 4997 case MINUSMINUS: 4993 if (UNLIKELY(context.isMetaProperty(expr)))4994 internalFailWithMessage(false, metaPropertyName(context, expr), " can't come before a postfix operator");4998 semanticFailIfTrue(context.isMetaProperty(expr), metaPropertyName(context, expr), " can't come before a postfix operator"); 4999 semanticFailIfFalse(isSimpleAssignmentTarget(context, expr), "Postfix -- operator applied to value that is not a reference"); 4995 5000 m_parserState.nonTrivialExpressionCount++; 4996 5001 m_parserState.nonLHSCount++; … … 4998 5003 m_parserState.assignmentCount++; 4999 5004 failIfTrueIfStrict(isEvalOrArguments, "'", m_parserState.lastIdentifier->impl(), "' cannot be modified in strict mode"); 5000 semanticFailIfTrue(requiresLExpr, "The ", operatorString(false, lastOperator), " operator requires a reference expression"); 5001 lastOperator = PLUSPLUS; 5005 semanticFailIfTrue(hasPrefixUpdateOp, "The ", operatorString(false, lastOperator), " operator requires a reference expression"); 5002 5006 next(); 5003 5007 break; … … 5007 5011 5008 5012 JSTextPosition end = lastTokenEndPosition(); 5009 5010 if (!TreeBuilder::CreatesAST && (!strictMode()))5011 return expr;5012 5013 5013 while (tokenStackDepth) { 5014 5014 switch (context.unaryTokenStackLastType(tokenStackDepth)) { -
trunk/Source/JavaScriptCore/parser/Parser.h
r244038 r245406 1666 1666 template <class TreeBuilder> NEVER_INLINE const char* metaPropertyName(TreeBuilder&, TreeExpression); 1667 1667 1668 template <class TreeBuilder> ALWAYS_INLINE bool isSimpleAssignmentTarget(TreeBuilder&, TreeExpression); 1669 1668 1670 ALWAYS_INLINE int isBinaryOperator(JSTokenType); 1669 1671 bool allowAutomaticSemicolon(); -
trunk/Source/JavaScriptCore/parser/SyntaxChecker.h
r229608 r245406 394 394 } 395 395 396 bool isLocation(ExpressionType type) 397 { 398 return type == ResolveExpr || type == DotExpr || type == BracketExpr; 399 } 400 396 401 bool isAssignmentLocation(ExpressionType type) 397 402 { 398 return type == ResolveExpr || type == DotExpr || type == BracketExpr;403 return isLocation(type) || type == DestructuringAssignment; 399 404 } 400 405 … … 412 417 { 413 418 return isObjectLiteral(type) || isArrayLiteral(type); 419 } 420 421 bool isFunctionCall(ExpressionType type) 422 { 423 return type == CallExpr; 414 424 } 415 425
Note: See TracChangeset
for help on using the changeset viewer.