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

Unified Diff: src/object-observe.js

Issue 254433002: Store JSGlobalProxy's identity hash directly on the proxy itself (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Re-introduce %UnwrapProxy to make Object.observe work Created 6 years, 8 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 | « src/factory.cc ('k') | src/objects.h » ('j') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/object-observe.js
diff --git a/src/object-observe.js b/src/object-observe.js
index c4ddd181d2841c479c3de34bd6d683554e2352bd..e822f0bd497588715e70c3300737b9e72a8e9134 100644
--- a/src/object-observe.js
+++ b/src/object-observe.js
@@ -80,9 +80,13 @@ function GetWeakMapWrapper() {
MapWrapper.prototype = {
get: function(key) {
+ key = %UnwrapGlobalProxy(key);
Toon Verwaest 2014/04/28 14:32:50 I'd strongly prefer merging UnwrapGlobalProxy with
adamk 2014/04/28 18:44:50 Done, factoring out the logic into WeakCollectionG
+ if (!IS_SPEC_OBJECT(key)) return UNDEFINED;
return %WeakCollectionGet(this.map_, key);
},
set: function(key, value) {
+ key = %UnwrapGlobalProxy(key);
+ if (!IS_SPEC_OBJECT(key)) return UNDEFINED;
%WeakCollectionSet(this.map_, key, value);
},
has: function(key) {
« no previous file with comments | « src/factory.cc ('k') | src/objects.h » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698