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 7989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8000 "for (();;) {}", | 8000 "for (();;) {}", |
8001 | 8001 |
8002 // crbug.com/582626 | 8002 // crbug.com/582626 |
8003 "{ NaN ,chA((evarA=new t ( l = !.0[((... co -a0([1]))=> greturnkf", | 8003 "{ NaN ,chA((evarA=new t ( l = !.0[((... co -a0([1]))=> greturnkf", |
8004 NULL | 8004 NULL |
8005 }; | 8005 }; |
8006 // clang-format on | 8006 // clang-format on |
8007 | 8007 |
8008 RunParserSyncTest(context_data, error_data, kError, NULL, 0, NULL, 0); | 8008 RunParserSyncTest(context_data, error_data, kError, NULL, 0, NULL, 0); |
8009 } | 8009 } |
| 8010 |
| 8011 TEST(FunctionSentErrors) { |
| 8012 // clang-format off |
| 8013 const char* context_data[][2] = { |
| 8014 { "'use strict'", "" }, |
| 8015 { "", "" }, |
| 8016 { NULL, NULL } |
| 8017 }; |
| 8018 const char* error_data[] = { |
| 8019 "var x = function.sent", |
| 8020 "function* g() { yield function.s\\u0065nt; }", |
| 8021 NULL |
| 8022 }; |
| 8023 // clang-format on |
| 8024 |
| 8025 bool old_flag = i::FLAG_harmony_function_sent; |
| 8026 i::FLAG_harmony_function_sent = true; |
| 8027 RunParserSyncTest(context_data, error_data, kError); |
| 8028 i::FLAG_harmony_function_sent = old_flag; |
| 8029 } |
| 8030 |
| 8031 TEST(NewTargetErrors) { |
| 8032 // clang-format off |
| 8033 const char* context_data[][2] = { |
| 8034 { "'use strict'", "" }, |
| 8035 { "", "" }, |
| 8036 { NULL, NULL } |
| 8037 }; |
| 8038 const char* error_data[] = { |
| 8039 "var x = new.target", |
| 8040 "function f() { return new.t\\u0061rget; }", |
| 8041 NULL |
| 8042 }; |
| 8043 // clang-format on |
| 8044 RunParserSyncTest(context_data, error_data, kError); |
| 8045 } |
OLD | NEW |