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

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

Issue 2695973003: ParserBase should accept ESCAPED_STRICT_RESERVED_WORD as an identifier (Closed)
Patch Set: cctest fixed and ParseIdentifierOrStrictReservedWord recognises ESCAPED_STRICT_RESERVED_WORD 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
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[] = {
9459 "if (true) l\u0065t: ;", "function l\u0065t() { }",
9460 "(function l\u0065t() { })", "async function l\u0065t() { }",
9461 "(async function l\u0065t() { })", "async l\u0065t => 42"};
adamk 2017/02/15 01:25:39 For completeness, can you add a non-async arrow fu
vabr (Chromium) 2017/02/15 01:34:20 Done.
9462
9463 RunParserSyncTest(context_data, statement_data, kSuccess);
9464 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698