When hoisting variables, try to merge in assignments that follow.

This commit is contained in:
Mihai Bazon
2012-12-05 12:30:25 +02:00
parent dbe33bbfc5
commit 320c110b33
3 changed files with 79 additions and 29 deletions

View File

@@ -255,6 +255,14 @@ Dictionary.prototype = {
this._values["$" + key] = val;
return this;
},
add: function(key, val) {
if (this.has(key)) {
this.get(key).push(val);
} else {
this.set(key, [ val ]);
}
return this;
},
get: function(key) { return this._values["$" + key] },
del: function(key) {
if (this.has(key)) {