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 7171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7182 | 7182 |
7183 // crbug.com/582626 | 7183 // crbug.com/582626 |
7184 "{ NaN ,chA((evarA=new t ( l = !.0[((... co -a0([1]))=> greturnkf", | 7184 "{ NaN ,chA((evarA=new t ( l = !.0[((... co -a0([1]))=> greturnkf", |
7185 NULL | 7185 NULL |
7186 }; | 7186 }; |
7187 // clang-format on | 7187 // clang-format on |
7188 | 7188 |
7189 RunParserSyncTest(context_data, error_data, kError, NULL, 0, NULL, 0); | 7189 RunParserSyncTest(context_data, error_data, kError, NULL, 0, NULL, 0); |
7190 } | 7190 } |
7191 | 7191 |
| 7192 |
| 7193 TEST(EscapeSequenceErrors) { |
| 7194 // clang-format off |
| 7195 const char* context_data[][2] = { |
| 7196 { "'", "'" }, |
| 7197 { "\"", "\"" }, |
| 7198 { "`", "`" }, |
| 7199 { "`${'", "'}`" }, |
| 7200 { "`${\"", "\"}`" }, |
| 7201 { "`${`", "`}`" }, |
| 7202 { "f(tag`", "`);" }, |
| 7203 { NULL, NULL } |
| 7204 }; |
| 7205 const char* error_data[] = { |
| 7206 "\\uABCG", |
| 7207 "\\u{ZZ}", |
| 7208 "\\u{FFZ}", |
| 7209 "\\u{FFFFFFFFFF }", |
| 7210 "\\u{110000}", |
| 7211 "\\u{110000", |
| 7212 "\\u{FFFD }", |
| 7213 "\\xZF", |
| 7214 NULL |
| 7215 }; |
| 7216 // clang-format on |
| 7217 |
| 7218 RunParserSyncTest(context_data, error_data, kError, NULL, 0, NULL, 0); |
| 7219 } |
| 7220 |
| 7221 |
7192 TEST(FunctionSentErrors) { | 7222 TEST(FunctionSentErrors) { |
7193 // clang-format off | 7223 // clang-format off |
7194 const char* context_data[][2] = { | 7224 const char* context_data[][2] = { |
7195 { "'use strict'", "" }, | 7225 { "'use strict'", "" }, |
7196 { "", "" }, | 7226 { "", "" }, |
7197 { NULL, NULL } | 7227 { NULL, NULL } |
7198 }; | 7228 }; |
7199 const char* error_data[] = { | 7229 const char* error_data[] = { |
7200 "var x = function.sent", | 7230 "var x = function.sent", |
7201 "function* g() { yield function.s\\u0065nt; }", | 7231 "function* g() { yield function.s\\u0065nt; }", |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7285 RunParserSyncTest(sloppy_context, error_data, kError); | 7315 RunParserSyncTest(sloppy_context, error_data, kError); |
7286 RunParserSyncTest(sloppy_context, error_data, kError, NULL, 0, | 7316 RunParserSyncTest(sloppy_context, error_data, kError, NULL, 0, |
7287 restrictive_flags, arraysize(restrictive_flags)); | 7317 restrictive_flags, arraysize(restrictive_flags)); |
7288 RunParserSyncTest(sloppy_context, unrestricted_data, kSuccess); | 7318 RunParserSyncTest(sloppy_context, unrestricted_data, kSuccess); |
7289 RunParserSyncTest(sloppy_context, unrestricted_data, kError, NULL, 0, | 7319 RunParserSyncTest(sloppy_context, unrestricted_data, kError, NULL, 0, |
7290 restrictive_flags, arraysize(restrictive_flags)); | 7320 restrictive_flags, arraysize(restrictive_flags)); |
7291 RunParserSyncTest(sloppy_context, sloppy_data, kSuccess); | 7321 RunParserSyncTest(sloppy_context, sloppy_data, kSuccess); |
7292 RunParserSyncTest(sloppy_context, sloppy_data, kSuccess, restrictive_flags, | 7322 RunParserSyncTest(sloppy_context, sloppy_data, kSuccess, restrictive_flags, |
7293 arraysize(restrictive_flags)); | 7323 arraysize(restrictive_flags)); |
7294 } | 7324 } |
OLD | NEW |