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

Unified Diff: src/parser.cc

Issue 919703003: WIP: Implement ES6 Spread-calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Flag calls as spread calls in parser, error on spread intrinsics/construct calls 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
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 15ed6ded0e8e08b417b1f6a7ebbe2c2f63240844..f2975e1fd47ae30f2eb51656ff030dce24782b0e 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -736,14 +736,7 @@ Expression* ParserTraits::ExpressionFromString(int pos, Scanner* scanner,
Expression* ParserTraits::GetIterator(Expression* iterable,
AstNodeFactory* factory) {
- Expression* iterator_symbol_literal =
- factory->NewSymbolLiteral("iterator_symbol", RelocInfo::kNoPosition);
- int pos = iterable->position();
- Expression* prop =
- factory->NewProperty(iterable, iterator_symbol_literal, pos);
- Zone* zone = parser_->zone();
- ZoneList<Expression*>* args = new (zone) ZoneList<Expression*>(0, zone);
- return factory->NewCall(prop, args, pos);
+ return factory->GetIterator(iterable);
}
@@ -4123,7 +4116,15 @@ Expression* Parser::ParseV8Intrinsic(bool* ok) {
Expect(Token::MOD, CHECK_OK);
// Allow "eval" or "arguments" for backward compatibility.
const AstRawString* name = ParseIdentifier(kAllowEvalOrArguments, CHECK_OK);
- ZoneList<Expression*>* args = ParseArguments(CHECK_OK);
+ Scanner::Location spread_pos;
+ ZoneList<Expression*>* args = ParseArguments(&spread_pos, CHECK_OK);
+
+ if (spread_pos.IsValid()) {
+ // Maybe support spread calls for intrinsics/runtime calls?
+ ParserTraits::ReportMessageAt(spread_pos, "spreadcall_intrinsic");
+ *ok = false;
+ return NULL;
+ }
if (extension_ != NULL) {
// The extension structures are only accessible while parsing the

Powered by Google App Engine
This is Rietveld 408576698