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

Unified Diff: src/preparser.cc

Issue 885643004: new classes: assert that constructors are not callable and rewrite 'return;' (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix bit width Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/preparser.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.cc
diff --git a/src/preparser.cc b/src/preparser.cc
index 170c9e725135818e3ff81a9914b16429b387dfa1..4c96ffb52f4573b13150f4a8c6583d89fe4ff18d 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -104,18 +104,18 @@ PreParserExpression PreParserTraits::ParseFunctionLiteral(
PreParser::PreParseResult PreParser::PreParseLazyFunction(
- LanguageMode language_mode, bool is_generator, ParserRecorder* log) {
+ LanguageMode language_mode, FunctionKind kind, ParserRecorder* log) {
log_ = log;
// Lazy functions always have trivial outer scopes (no with/catch scopes).
PreParserScope top_scope(scope_, SCRIPT_SCOPE);
PreParserFactory top_factory(NULL);
- FunctionState top_state(&function_state_, &scope_, &top_scope, &top_factory);
+ FunctionState top_state(&function_state_, &scope_, &top_scope,
+ kNormalFunction, &top_factory);
scope_->SetLanguageMode(language_mode);
PreParserScope function_scope(scope_, FUNCTION_SCOPE);
PreParserFactory function_factory(NULL);
- FunctionState function_state(&function_state_, &scope_, &function_scope,
+ FunctionState function_state(&function_state_, &scope_, &function_scope, kind,
&function_factory);
- function_state.set_is_generator(is_generator);
DCHECK_EQ(Token::LBRACE, scanner()->current_token());
bool ok = true;
int start_position = peek_position();
@@ -869,9 +869,8 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
ScopeType outer_scope_type = scope_->type();
PreParserScope function_scope(scope_, FUNCTION_SCOPE);
PreParserFactory factory(NULL);
- FunctionState function_state(&function_state_, &scope_, &function_scope,
+ FunctionState function_state(&function_state_, &scope_, &function_scope, kind,
&factory);
- function_state.set_is_generator(IsGeneratorFunction(kind));
// FormalParameterList ::
// '(' (Identifier)*[','] ')'
Expect(Token::LPAREN, CHECK_OK);
« no previous file with comments | « src/preparser.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698