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. |