Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: test/cctest/test-parsing.cc

Issue 2695973003: ParserBase should accept ESCAPED_STRICT_RESERVED_WORD as an identifier (Closed)
Patch Set: Address comments and add NULL to statement_data Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/parsing/parser-base.h ('k') | test/mjsunit/regress/regress-5692.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 9431 matching lines...) Expand 10 before | Expand all | Expand 10 after
9442 DCHECK_NULL(scope->sibling()); 9442 DCHECK_NULL(scope->sibling());
9443 DCHECK(scope->is_function_scope()); 9443 DCHECK(scope->is_function_scope());
9444 const i::AstRawString* var_name = 9444 const i::AstRawString* var_name =
9445 info.ast_value_factory()->GetOneByteString("my_var"); 9445 info.ast_value_factory()->GetOneByteString("my_var");
9446 i::Variable* var = scope->Lookup(var_name); 9446 i::Variable* var = scope->Lookup(var_name);
9447 CHECK_EQ(inners[i].ctxt_allocate, 9447 CHECK_EQ(inners[i].ctxt_allocate,
9448 i::ScopeTestHelper::MustAllocateInContext(var)); 9448 i::ScopeTestHelper::MustAllocateInContext(var));
9449 } 9449 }
9450 } 9450 }
9451 } 9451 }
9452
9453 TEST(EscapedStrictReservedWord) {
9454 // Test that identifiers which are both escaped and only reserved in the
9455 // strict mode are accepted in non-strict mode.
9456 const char* context_data[][2] = {{"", ""}, {NULL, NULL}};
9457
9458 const char* statement_data[] = {"if (true) l\u0065t: ;",
9459 "function l\u0065t() { }",
9460 "(function l\u0065t() { })",
9461 "async function l\u0065t() { }",
9462 "(async function l\u0065t() { })",
9463 "l\u0065t => 42",
9464 "async l\u0065t => 42",
9465 NULL};
9466
9467 RunParserSyncTest(context_data, statement_data, kSuccess);
9468 }
OLDNEW
« no previous file with comments | « src/parsing/parser-base.h ('k') | test/mjsunit/regress/regress-5692.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698