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

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

Issue 2406803003: Get rid of ParseInfo::lazy (Closed)
Patch Set: restore dcheck Created 4 years, 2 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 | « test/cctest/asmjs/test-asm-typer.cc ('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 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 full_source += "; }"; 906 full_source += "; }";
907 907
908 i::Handle<i::String> source_code = 908 i::Handle<i::String> source_code =
909 factory->NewStringFromUtf8(i::CStrVector(full_source.c_str())) 909 factory->NewStringFromUtf8(i::CStrVector(full_source.c_str()))
910 .ToHandleChecked(); 910 .ToHandleChecked();
911 911
912 i::Handle<i::Script> script = factory->NewScript(source_code); 912 i::Handle<i::Script> script = factory->NewScript(source_code);
913 913
914 i::ParseInfo info(handles.main_zone(), script); 914 i::ParseInfo info(handles.main_zone(), script);
915 i::Parser parser(&info); 915 i::Parser parser(&info);
916 info.set_lazy(false);
917 info.set_allow_lazy_parsing(false); 916 info.set_allow_lazy_parsing(false);
918 info.set_toplevel(true); 917 info.set_toplevel(true);
919 918
920 CHECK(i::Compiler::ParseAndAnalyze(&info)); 919 CHECK(i::Compiler::ParseAndAnalyze(&info));
921 920
922 CHECK(info.scope()->declarations()->length() == 1); 921 CHECK(info.scope()->declarations()->length() == 1);
923 i::FunctionLiteral* fun = 922 i::FunctionLiteral* fun =
924 info.scope()->declarations()->at(0)->AsFunctionDeclaration()->fun(); 923 info.scope()->declarations()->at(0)->AsFunctionDeclaration()->fun();
925 CHECK(fun->body()->length() == 1); 924 CHECK(fun->body()->length() == 1);
926 CHECK(fun->body()->at(0)->IsReturnStatement()); 925 CHECK(fun->body()->at(0)->IsReturnStatement());
(...skipping 7395 matching lines...) Expand 10 before | Expand all | Expand 10 after
8322 const char* data[] = { 8321 const char* data[] = {
8323 "const arguments = 1", 8322 "const arguments = 1",
8324 "let arguments", 8323 "let arguments",
8325 "var arguments", 8324 "var arguments",
8326 NULL 8325 NULL
8327 }; 8326 };
8328 // clang-format on 8327 // clang-format on
8329 RunParserSyncTest(context_data, data, kSuccess); 8328 RunParserSyncTest(context_data, data, kSuccess);
8330 } 8329 }
8331 } 8330 }
OLDNEW
« no previous file with comments | « test/cctest/asmjs/test-asm-typer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698