Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: test/mjsunit/harmony/proxies-function.js

Issue 157543002: A64: Synchronize with r18581. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/harmony/promises.js ('k') | test/mjsunit/harmony/symbols.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7b07d424236ff4c30b233ce3238e3cea55f1f90f 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(this, fp());
+ assertEquals(this, gp());
+ }
+
+ with ({}) {
+ assertEquals(Realm.shared.fg, fp());
+ assertEquals(Realm.shared.gg, gp());
+ }
+}
« no previous file with comments | « test/mjsunit/harmony/promises.js ('k') | test/mjsunit/harmony/symbols.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698