Index: test/mjsunit/compiler/inline-arguments.js |
diff --git a/test/mjsunit/compiler/inline-arguments.js b/test/mjsunit/compiler/inline-arguments.js |
index 9712b2d18352c042247e93abe15645e24030b5c7..502441633ca3b65e2d812746f6f4d450da3e39d3 100644 |
--- a/test/mjsunit/compiler/inline-arguments.js |
+++ b/test/mjsunit/compiler/inline-arguments.js |
@@ -80,3 +80,35 @@ F4(1); |
F4(1); |
%OptimizeFunctionOnNextCall(F4); |
F4(1); |
+ |
+ |
+// Test correct adapation of arguments. |
+(function () { |
+ "use strict"; // Strict mode prevents arguments object from shadowing parameters. |
Michael Starzinger
2012/03/20 17:48:41
Line is longer than 80 characters.
|
+ |
+ function G2() { |
+ assertArrayEquals([1,2], arguments); |
+ } |
+ |
+ function G4() { |
+ assertArrayEquals([1,2,3,4], arguments); |
+ } |
+ |
+ function adapt2to4(a, b, c, d) { |
+ G2.apply(this, arguments); |
+ } |
+ |
+ function adapt4to2(a, b) { |
+ G4.apply(this, arguments); |
+ } |
+ |
+ function test_adaptation() { |
+ adapt2to4(1, 2); |
+ adapt4to2(1, 2, 3, 4); |
+ } |
+ |
+ test_adaptation(); |
+ test_adaptation(); |
+ %OptimizeFunctionOnNextCall(test_adaptation); |
+ test_adaptation(); |
+})(); |