Index: test/mjsunit/regress/regress-318420.js |
diff --git a/test/mjsunit/regress/regress-2813.js b/test/mjsunit/regress/regress-318420.js |
similarity index 80% |
copy from test/mjsunit/regress/regress-2813.js |
copy to test/mjsunit/regress/regress-318420.js |
index 97ae43b316a2177596927cf5465fa2214cc11c61..77bef10ec4eea03f38a5a29b56d615422cbe2bd4 100644 |
--- a/test/mjsunit/regress/regress-2813.js |
+++ b/test/mjsunit/regress/regress-318420.js |
@@ -27,18 +27,20 @@ |
// Flags: --allow-natives-syntax |
-function foo(x) { |
- var a = x + 1; |
- var b = x + 2; |
- if (x != 0) { |
- if (x > 0 & x < 100) { |
- return a; |
+function bar(a, b) { with(a) {return a + b;} } |
+ |
+var obj = { |
+ functions: [bar, bar, bar, bar], |
+ receivers: [bar, bar, undefined, null], |
+ foo: function () { |
+ for (var a = this.functions, e = this.receivers, c = a.length, |
+ d = 0; d < c ; d++) { |
+ a[d].apply(e[d], arguments) |
} |
} |
- return 0; |
} |
-assertEquals(0, foo(0)); |
-assertEquals(0, foo(0)); |
-%OptimizeFunctionOnNextCall(foo); |
-assertEquals(3, foo(2)); |
+obj.foo(1, 2, 3, 4); |
+obj.foo(1, 2, 3, 4); |
+%OptimizeFunctionOnNextCall(obj.foo); |
+obj.foo(1, 2, 3, 4); |