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

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

Issue 1906923002: [modules] Infer strict mode from within scope object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/preparser.h ('k') | no next file » | 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 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after
1548 if (test_preparser) { 1548 if (test_preparser) {
1549 i::Scanner scanner(isolate->unicode_cache()); 1549 i::Scanner scanner(isolate->unicode_cache());
1550 i::GenericStringUtf16CharacterStream stream(source, 0, source->length()); 1550 i::GenericStringUtf16CharacterStream stream(source, 0, source->length());
1551 i::Zone zone(CcTest::i_isolate()->allocator()); 1551 i::Zone zone(CcTest::i_isolate()->allocator());
1552 i::AstValueFactory ast_value_factory( 1552 i::AstValueFactory ast_value_factory(
1553 &zone, CcTest::i_isolate()->heap()->HashSeed()); 1553 &zone, CcTest::i_isolate()->heap()->HashSeed());
1554 i::PreParser preparser(&zone, &scanner, &ast_value_factory, &log, 1554 i::PreParser preparser(&zone, &scanner, &ast_value_factory, &log,
1555 stack_limit); 1555 stack_limit);
1556 SetParserFlags(&preparser, flags); 1556 SetParserFlags(&preparser, flags);
1557 scanner.Initialize(&stream); 1557 scanner.Initialize(&stream);
1558 i::PreParser::PreParseResult result = preparser.PreParseProgram( 1558 i::PreParser::PreParseResult result =
1559 &preparser_materialized_literals); 1559 preparser.PreParseProgram(&preparser_materialized_literals, is_module);
1560 CHECK_EQ(i::PreParser::kPreParseSuccess, result); 1560 CHECK_EQ(i::PreParser::kPreParseSuccess, result);
1561 } 1561 }
1562 bool preparse_error = log.HasError(); 1562 bool preparse_error = log.HasError();
1563 1563
1564 // Parse the data 1564 // Parse the data
1565 i::FunctionLiteral* function; 1565 i::FunctionLiteral* function;
1566 { 1566 {
1567 i::Handle<i::Script> script = factory->NewScript(source); 1567 i::Handle<i::Script> script = factory->NewScript(source);
1568 i::Zone zone(CcTest::i_isolate()->allocator()); 1568 i::Zone zone(CcTest::i_isolate()->allocator());
1569 i::ParseInfo info(&zone, script); 1569 i::ParseInfo info(&zone, script);
(...skipping 5690 matching lines...) Expand 10 before | Expand all | Expand 10 after
7260 // "Array() **= 10", 7260 // "Array() **= 10",
7261 NULL 7261 NULL
7262 }; 7262 };
7263 // clang-format on 7263 // clang-format on
7264 7264
7265 static const ParserFlag always_flags[] = { 7265 static const ParserFlag always_flags[] = {
7266 kAllowHarmonyExponentiationOperator}; 7266 kAllowHarmonyExponentiationOperator};
7267 RunParserSyncTest(context_data, error_data, kError, NULL, 0, always_flags, 7267 RunParserSyncTest(context_data, error_data, kError, NULL, 0, always_flags,
7268 arraysize(always_flags)); 7268 arraysize(always_flags));
7269 } 7269 }
OLDNEW
« no previous file with comments | « src/parsing/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698