diff --git a/src/lib/collection.html b/src/lib/collection.html
index 0e68e38b39..e89fc1d2ad 100644
--- a/src/lib/collection.html
+++ b/src/lib/collection.html
@@ -46,10 +46,11 @@
} else {
this.pmap[item] = key;
}
- return key;
+ return '#' + key;
},
removeKey: function(key) {
+ key = this._parseKey(key);
this._removeFromMap(this.store[key]);
delete this.store[key];
},
@@ -70,17 +71,27 @@
getKey: function(item) {
if (item && typeof item == 'object') {
- return this.omap.get(item);
+ return '#' + this.omap.get(item);
} else {
- return this.pmap[item];
+ return '#' + this.pmap[item];
}
},
getKeys: function() {
- return Object.keys(this.store);
+ return Object.keys(this.store).map(function(key) {
+ return '#' + key;
+ });
+ },
+
+ _parseKey: function(key) {
+ if (key[0] == '#') {
+ return key.slice(1);
+ }
+ throw new Error('unexpected key ' + key);
},
setItem: function(key, item) {
+ key = this._parseKey(key);
var old = this.store[key];
if (old) {
this._removeFromMap(old);
@@ -94,6 +105,7 @@
},
getItem: function(key) {
+ key = this._parseKey(key);
return this.store[key];
},
diff --git a/src/standard/notify-path.html b/src/standard/notify-path.html
index 3c804acdd0..af58b91d5e 100644
--- a/src/standard/notify-path.html
+++ b/src/standard/notify-path.html
@@ -195,14 +195,20 @@
get: function(path, root) {
var prop = root || this;
var parts = this._getPathParts(path);
- var last = parts.pop();
- while (parts.length) {
- prop = prop[parts.shift()];
+ var array;
+ for (var i=0; i