Index: test/mjsunit/harmony/proxies-function.js |
diff --git a/test/mjsunit/harmony/proxies-function.js b/test/mjsunit/harmony/proxies-function.js |
index 6b8d098442f16fba27bf4647a8d1b2ddc7e4a377..8c91e9ba9ef12fdec6cbb00b69216b63c6981973 100644 |
--- a/test/mjsunit/harmony/proxies-function.js |
+++ b/test/mjsunit/harmony/proxies-function.js |
@@ -53,8 +53,7 @@ var receiver |
function TestCall(isStrict, callTrap) { |
assertEquals(42, callTrap(5, 37)) |
- // TODO(rossberg): strict mode seems to be broken on x64... |
- // assertSame(isStrict ? undefined : global_object, receiver) |
+ assertSame(isStrict ? undefined : global_object, receiver) |
var handler = { |
get: function(r, k) { |
@@ -67,8 +66,7 @@ function TestCall(isStrict, callTrap) { |
receiver = 333 |
assertEquals(42, f(11, 31)) |
- // TODO(rossberg): strict mode seems to be broken on x64... |
- // assertSame(isStrict ? undefined : global_object, receiver) |
+ assertSame(isStrict ? undefined : global_object, receiver) |
receiver = 333 |
assertEquals(42, o.f(10, 32)) |
assertSame(o, receiver) |
@@ -746,3 +744,31 @@ function TestCalls() { |
TestCalls() |
*/ |
+ |
+var realms = [Realm.create(), Realm.create()]; |
+Realm.shared = {}; |
+ |
+Realm.eval(realms[0], "function f() { return this; };"); |
+Realm.eval(realms[0], "Realm.shared.f = f;"); |
+Realm.eval(realms[0], "Realm.shared.fg = this;"); |
+Realm.eval(realms[1], "function g() { return this; };"); |
+Realm.eval(realms[1], "Realm.shared.g = g;"); |
+Realm.eval(realms[1], "Realm.shared.gg = this;"); |
+ |
+var fp = Proxy.createFunction({}, Realm.shared.f); |
+var gp = Proxy.createFunction({}, Realm.shared.g); |
+ |
+for (var i = 0; i < 10; i++) { |
+ assertEquals(Realm.shared.fg, fp()); |
+ assertEquals(Realm.shared.gg, gp()); |
+ |
+ with (this) { |
+ assertEquals(Realm.shared.fg, fp()); |
+ assertEquals(Realm.shared.gg, gp()); |
+ } |
+ |
+ with ({}) { |
+ assertEquals(Realm.shared.fg, fp()); |
+ assertEquals(Realm.shared.gg, gp()); |
+ } |
+} |