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

Unified Diff: test/cctest/interpreter/test-interpreter.cc

Issue 1664593003: [Interpreter] Adds support for rest parameters to interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed failing bytecode-array-builder-unittest Created 4 years, 11 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: test/cctest/interpreter/test-interpreter.cc
diff --git a/test/cctest/interpreter/test-interpreter.cc b/test/cctest/interpreter/test-interpreter.cc
index d3c031f740a2807f92e6a6e4bf11bc8222692def..94648f53f48b584d96946a39db6efca7fbb025b6 100644
--- a/test/cctest/interpreter/test-interpreter.cc
+++ b/test/cctest/interpreter/test-interpreter.cc
@@ -2297,6 +2297,15 @@ TEST(InterpreterCreateArguments) {
std::make_pair("function f(a, b, c, d) {"
" 'use strict'; c = b; return arguments[2]; }",
2),
+ // check rest parameters
+ std::make_pair("function f(...restArray) { return restArray[0]; }", 0),
+ std::make_pair("function f(a, ...restArray) { return restArray[0]; }", 1),
+ std::make_pair("function f(a, ...restArray) { return arguments[0]; }", 0),
+ std::make_pair("function f(a, ...restArray) { return arguments[1]; }", 1),
+ std::make_pair("function f(a, ...restArray) { return restArray[1]; }", 2),
+ std::make_pair("function f(a, ...arguments) { return arguments[0]; }", 1),
+ std::make_pair("function f(a, b, ...restArray) { return restArray[0]; }",
+ 2),
};
// Test passing no arguments.

Powered by Google App Engine
This is Rietveld 408576698