Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index 3c72dd0f72c7b47b05c08da86de112bee65468eb..253b971c051a6cceaaafb6d497c01e681b4a9a4c 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -3860,6 +3860,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; |
} |