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 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2239 { "\"use strict\"; function * ", ""}, | 2239 { "\"use strict\"; function * ", ""}, |
2240 { NULL, NULL } | 2240 { NULL, NULL } |
2241 }; | 2241 }; |
2242 | 2242 |
2243 const char* statement_data[] = { | 2243 const char* statement_data[] = { |
2244 "eval() {\"use strict\";}", | 2244 "eval() {\"use strict\";}", |
2245 "arguments() {\"use strict\";}", | 2245 "arguments() {\"use strict\";}", |
2246 "interface() {\"use strict\";}", | 2246 "interface() {\"use strict\";}", |
2247 "yield() {\"use strict\";}", | 2247 "yield() {\"use strict\";}", |
2248 // Future reserved words are always illegal | 2248 // Future reserved words are always illegal |
2249 "function super() { }", | 2249 "super() { }", |
2250 "function super() {\"use strict\";}", | 2250 "super() {\"use strict\";}", |
2251 NULL | 2251 NULL |
2252 }; | 2252 }; |
2253 | 2253 |
2254 RunParserSyncTest(context_data, statement_data, kError); | 2254 RunParserSyncTest(context_data, statement_data, kError); |
2255 } | 2255 } |
2256 | 2256 |
2257 | 2257 |
2258 TEST(NoErrorsNameOfStrictFunction) { | 2258 TEST(NoErrorsNameOfStrictFunction) { |
2259 const char* context_data[][2] = { | 2259 const char* context_data[][2] = { |
2260 { "function ", ""}, | 2260 { "function ", ""}, |
(...skipping 2716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4977 "const x = 1;", | 4977 "const x = 1;", |
4978 "class C {}", | 4978 "class C {}", |
4979 NULL}; | 4979 NULL}; |
4980 | 4980 |
4981 static const ParserFlag always_flags[] = { | 4981 static const ParserFlag always_flags[] = { |
4982 kAllowHarmonyClasses, kAllowHarmonyScoping | 4982 kAllowHarmonyClasses, kAllowHarmonyScoping |
4983 }; | 4983 }; |
4984 RunParserSyncTest(context_data, statement_data, kError, NULL, 0, | 4984 RunParserSyncTest(context_data, statement_data, kError, NULL, 0, |
4985 always_flags, arraysize(always_flags)); | 4985 always_flags, arraysize(always_flags)); |
4986 } | 4986 } |
OLD | NEW |