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

Side by Side Diff: src/preparser.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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <cmath> 5 #include <cmath>
6 6
7 #include "src/allocation.h" 7 #include "src/allocation.h"
8 #include "src/base/logging.h" 8 #include "src/base/logging.h"
9 #include "src/conversions-inl.h" 9 #include "src/conversions-inl.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) { 1009 PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) {
1010 // CallRuntime :: 1010 // CallRuntime ::
1011 // '%' Identifier Arguments 1011 // '%' Identifier Arguments
1012 Expect(Token::MOD, CHECK_OK); 1012 Expect(Token::MOD, CHECK_OK);
1013 if (!allow_natives()) { 1013 if (!allow_natives()) {
1014 *ok = false; 1014 *ok = false;
1015 return Expression::Default(); 1015 return Expression::Default();
1016 } 1016 }
1017 // Allow "eval" or "arguments" for backward compatibility. 1017 // Allow "eval" or "arguments" for backward compatibility.
1018 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); 1018 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK);
1019 ParseArguments(ok); 1019 Scanner::Location spread_pos;
1020 ParseArguments(&spread_pos, ok);
1021
1022 if (spread_pos.IsValid()) {
1023 // Maybe support spread calls for intrinsics/runtime calls?
1024 PreParserTraits::ReportMessageAt(spread_pos, "spreadcall_intrinsic");
1025 *ok = false;
1026 return Expression::Default();
1027 }
1020 1028
1021 return Expression::Default(); 1029 return Expression::Default();
1022 } 1030 }
1023 1031
1024 #undef CHECK_OK 1032 #undef CHECK_OK
1025 1033
1026 1034
1027 } } // v8::internal 1035 } } // v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698