Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 "src/parser.h" | 5 #include "src/parser.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/ast.h" | 8 #include "src/ast.h" |
| 9 #include "src/ast-literal-reindexer.h" | 9 #include "src/ast-literal-reindexer.h" |
| 10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
| (...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1210 ParseFormalParameter(&formals, &formals_classifier, &ok); | 1210 ParseFormalParameter(&formals, &formals_classifier, &ok); |
| 1211 if (ok) { | 1211 if (ok) { |
| 1212 DeclareFormalParameter(formals.scope, formals.at(0), | 1212 DeclareFormalParameter(formals.scope, formals.at(0), |
| 1213 &formals_classifier); | 1213 &formals_classifier); |
| 1214 } | 1214 } |
| 1215 } | 1215 } |
| 1216 } | 1216 } |
| 1217 | 1217 |
| 1218 if (ok) { | 1218 if (ok) { |
| 1219 checkpoint.Restore(&formals.materialized_literals_count); | 1219 checkpoint.Restore(&formals.materialized_literals_count); |
| 1220 Expression* expression = | 1220 Expression* expression = ParseArrowFunctionLiteral( |
| 1221 ParseArrowFunctionLiteral(formals, formals_classifier, &ok); | 1221 shared_info->accept_IN(), formals, formals_classifier, &ok); |
|
adamk
2015/10/14 13:37:19
So I patched this in locally, and just passed true
| |
| 1222 if (ok) { | 1222 if (ok) { |
| 1223 // Scanning must end at the same position that was recorded | 1223 // Scanning must end at the same position that was recorded |
| 1224 // previously. If not, parsing has been interrupted due to a stack | 1224 // previously. If not, parsing has been interrupted due to a stack |
| 1225 // overflow, at which point the partially parsed arrow function | 1225 // overflow, at which point the partially parsed arrow function |
| 1226 // concise body happens to be a valid expression. This is a problem | 1226 // concise body happens to be a valid expression. This is a problem |
| 1227 // only for arrow functions with single expression bodies, since there | 1227 // only for arrow functions with single expression bodies, since there |
| 1228 // is no end token such as "}" for normal functions. | 1228 // is no end token such as "}" for normal functions. |
| 1229 if (scanner()->location().end_pos == shared_info->end_position()) { | 1229 if (scanner()->location().end_pos == shared_info->end_position()) { |
| 1230 // The pre-parser saw an arrow function here, so the full parser | 1230 // The pre-parser saw an arrow function here, so the full parser |
| 1231 // must produce a FunctionLiteral. | 1231 // must produce a FunctionLiteral. |
| (...skipping 5105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6337 | 6337 |
| 6338 Expression* Parser::SpreadCallNew(Expression* function, | 6338 Expression* Parser::SpreadCallNew(Expression* function, |
| 6339 ZoneList<v8::internal::Expression*>* args, | 6339 ZoneList<v8::internal::Expression*>* args, |
| 6340 int pos) { | 6340 int pos) { |
| 6341 args->InsertAt(0, function, zone()); | 6341 args->InsertAt(0, function, zone()); |
| 6342 | 6342 |
| 6343 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); | 6343 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); |
| 6344 } | 6344 } |
| 6345 } // namespace internal | 6345 } // namespace internal |
| 6346 } // namespace v8 | 6346 } // namespace v8 |
| OLD | NEW |