Index: test/mjsunit/regress/regress-crbug-137689.js |
diff --git a/test/mjsunit/compiler/optimized-closures.js b/test/mjsunit/regress/regress-crbug-137689.js |
similarity index 73% |
copy from test/mjsunit/compiler/optimized-closures.js |
copy to test/mjsunit/regress/regress-crbug-137689.js |
index eaf75f8d00ccd9123ed0f5232a91137845fc3973..ef79d240f8926a39c3fffe31c5f9b7de3a521a48 100644 |
--- a/test/mjsunit/compiler/optimized-closures.js |
+++ b/test/mjsunit/regress/regress-crbug-137689.js |
@@ -27,31 +27,21 @@ |
// Flags: --allow-natives-syntax |
-// Test optimized closures. |
- |
-var a = new Array(100); |
- |
-function f() { |
- var x=0; |
- for (var i=0; i<100; i++) { |
- var g = function goo(y) { |
- function h() { |
- if (goo.arguments[0] == 23) return -42; |
- return 42; |
- } |
- return x + y + h(y); |
- } |
- g(0); |
- %OptimizeFunctionOnNextCall(g); |
- a[i] = g(i); |
- } |
-} |
- |
-f(); |
-assertEquals(42, a[0]); |
-assertEquals(49, a[7]); |
-assertEquals(-19, a[23]); |
+function getter() { return 10; } |
+function setter(v) { } |
+function getter2() { return 20; } |
+var o = {}; |
+var o2 = {}; |
+Object.defineProperty(o, "foo", { get: getter, configurable: true }); |
+Object.defineProperty(o2, "foo", { get: getter, configurable: true }); |
+assertTrue(%HaveSameMap(o, o2)); |
+Object.defineProperty(o, "bar", { get: getter2 }); |
+Object.defineProperty(o2, "bar", { get: getter2 }); |
+assertTrue(%HaveSameMap(o, o2)); |
+Object.defineProperty(o, "foo", { set: setter, configurable: true }); |
+Object.defineProperty(o2, "foo", { set: setter, configurable: true }); |
+assertTrue(%HaveSameMap(o, o2)); |