| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2550 const char* good_statement_data[] = { | 2550 const char* good_statement_data[] = { |
| 2551 "foo", | 2551 "foo", |
| 2552 "foo.bar", | 2552 "foo.bar", |
| 2553 "foo[bar]", | 2553 "foo[bar]", |
| 2554 "foo()[bar]", | 2554 "foo()[bar]", |
| 2555 "foo().bar", | 2555 "foo().bar", |
| 2556 "this.foo", | 2556 "this.foo", |
| 2557 "this[foo]", | 2557 "this[foo]", |
| 2558 "new foo()[bar]", | 2558 "new foo()[bar]", |
| 2559 "new foo().bar", | 2559 "new foo().bar", |
| 2560 "foo()", |
| 2561 "foo(bar)", |
| 2562 "foo[bar]()", |
| 2563 "foo.bar()", |
| 2564 "this()", |
| 2565 "this.foo()", |
| 2566 "this[foo].bar()", |
| 2567 "this.foo[foo].bar(this)(bar)[foo]()", |
| 2560 NULL | 2568 NULL |
| 2561 }; | 2569 }; |
| 2562 | 2570 |
| 2563 // Bad left hand sides for assigment or prefix / postfix operations. | 2571 // Bad left hand sides for assigment or prefix / postfix operations. |
| 2564 const char* bad_statement_data_common[] = { | 2572 const char* bad_statement_data_common[] = { |
| 2565 "2", | 2573 "2", |
| 2566 "foo()", | 2574 "new foo", |
| 2575 "new foo()", |
| 2567 "null", | 2576 "null", |
| 2568 "if", // Unexpected token | 2577 "if", // Unexpected token |
| 2569 "{x: 1}", // Unexpected token | 2578 "{x: 1}", // Unexpected token |
| 2570 "this", | 2579 "this", |
| 2571 "\"bar\"", | 2580 "\"bar\"", |
| 2572 "(foo + bar)", | 2581 "(foo + bar)", |
| 2573 "new new foo()[bar]", // means: new (new foo()[bar]) | 2582 "new new foo()[bar]", // means: new (new foo()[bar]) |
| 2574 "new new foo().bar", // means: new (new foo()[bar]) | 2583 "new new foo().bar", // means: new (new foo()[bar]) |
| 2575 NULL | 2584 NULL |
| 2576 }; | 2585 }; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2587 RunParserSyncTest(assignment_context_data, bad_statement_data_common, kError); | 2596 RunParserSyncTest(assignment_context_data, bad_statement_data_common, kError); |
| 2588 RunParserSyncTest(assignment_context_data, bad_statement_data_for_assignment, | 2597 RunParserSyncTest(assignment_context_data, bad_statement_data_for_assignment, |
| 2589 kError); | 2598 kError); |
| 2590 | 2599 |
| 2591 RunParserSyncTest(prefix_context_data, good_statement_data, kSuccess); | 2600 RunParserSyncTest(prefix_context_data, good_statement_data, kSuccess); |
| 2592 RunParserSyncTest(prefix_context_data, bad_statement_data_common, kError); | 2601 RunParserSyncTest(prefix_context_data, bad_statement_data_common, kError); |
| 2593 | 2602 |
| 2594 RunParserSyncTest(postfix_context_data, good_statement_data, kSuccess); | 2603 RunParserSyncTest(postfix_context_data, good_statement_data, kSuccess); |
| 2595 RunParserSyncTest(postfix_context_data, bad_statement_data_common, kError); | 2604 RunParserSyncTest(postfix_context_data, bad_statement_data_common, kError); |
| 2596 } | 2605 } |
| OLD | NEW |