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 4235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4246 "for(const x = 4, y of [1,2,3]) {}", | 4246 "for(const x = 4, y of [1,2,3]) {}", |
4247 "for(const x = 1, y = 2 in []) {}", | 4247 "for(const x = 1, y = 2 in []) {}", |
4248 "for(const x,y in []) {}", | 4248 "for(const x,y in []) {}", |
4249 "for(const x = 1, y = 2 of []) {}", | 4249 "for(const x = 1, y = 2 of []) {}", |
4250 "for(const x,y of []) {}", | 4250 "for(const x,y of []) {}", |
4251 NULL}; | 4251 NULL}; |
4252 static const ParserFlag always_flags[] = {kAllowHarmonyScoping}; | 4252 static const ParserFlag always_flags[] = {kAllowHarmonyScoping}; |
4253 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, | 4253 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, |
4254 arraysize(always_flags)); | 4254 arraysize(always_flags)); |
4255 } | 4255 } |
| 4256 |
| 4257 |
| 4258 TEST(InvalidUnicodeEscapes) { |
| 4259 const char* context_data[][2] = {{"", ""}, |
| 4260 {"'use strict';", ""}, |
| 4261 {NULL, NULL}}; |
| 4262 const char* data[] = { |
| 4263 "var foob\\u123r = 0;", |
| 4264 "var \\u123roo = 0;", |
| 4265 "\"foob\\u123rr\"", |
| 4266 "/regex/g\\u123r", |
| 4267 NULL}; |
| 4268 RunParserSyncTest(context_data, data, kError); |
| 4269 } |
OLD | NEW |