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

Unified Diff: src/object-observe.js

Issue 11361172: Fix InternalObjectHashTable to properly update table ref in observationState (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added test case Created 8 years, 1 month 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 | « no previous file | test/cctest/test-object-observe.cc » ('j') | no next file with comments »
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 5214f7a143953b23df47c1c2a6e66fd5d5e2dd23..086159f9cb81db03ecfa87ec87a1a4fdb588e4ef 100644
--- a/src/object-observe.js
+++ b/src/object-observe.js
@@ -38,25 +38,25 @@ if (IS_UNDEFINED(observationState.observerInfoMap)) {
observationState.observerPriority = 0;
}
-function InternalObjectHashTable(table) {
- this.table = table;
+function InternalObjectHashTable(tableName) {
+ this.tableName = tableName;
}
InternalObjectHashTable.prototype = {
get: function(key) {
- return %ObjectHashTableGet(this.table, key);
+ return %ObjectHashTableGet(observationState[this.tableName], key);
},
set: function(key, value) {
- this.table = %ObjectHashTableSet(this.table, key, value);
+ observationState[this.tableName] =
+ %ObjectHashTableSet(observationState[this.tableName], key, value);
},
has: function(key) {
- return %ObjectHashTableHas(this.table, key);
+ return %ObjectHashTableHas(observationState[this.tableName], key);
}
};
-var observerInfoMap = new InternalObjectHashTable(
- observationState.observerInfoMap);
-var objectInfoMap = new InternalObjectHashTable(observationState.objectInfoMap);
+var observerInfoMap = new InternalObjectHashTable('observerInfoMap');
+var objectInfoMap = new InternalObjectHashTable('objectInfoMap');
function ObjectObserve(object, callback) {
if (!IS_SPEC_OBJECT(object))
« no previous file with comments | « no previous file | test/cctest/test-object-observe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698