Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index 8526f48d1cea5e310ceb38a64aba80001d5fb770..5990996baba7cd9ba6a9b899aa27fa33676873e3 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -3838,6 +3838,11 @@ FunctionLiteral* Parser::ParseFunctionLiteral( |
FunctionLiteral::kIsFunction, parenthesized, kind, pos); |
function_literal->set_function_token_position(function_token_pos); |
+ if (scope->has_rest_parameter()) { |
+ // TODO(caitp): enable optimization of functions with rest params |
+ function_literal->set_dont_optimize_reason(kRestParameter); |
+ } |
+ |
if (fni_ != NULL && should_infer_name) fni_->AddFunction(function_literal); |
return function_literal; |
} |