Have paper.install() use Base.each().

This commit is contained in:
Jürg Lehni 2011-05-14 13:14:43 +03:00
parent d64fe1f179
commit 9ef31616d5

View file

@ -58,9 +58,11 @@ var PaperScope = Base.extend({
* paper.install(window);
*/
install: function(scope) {
for (var i in this) {
scope[i] = this[i];
}
// Use scope as side-car (= 'this' inside iterator), and have it
// returned at the end.
return Base.each(this, function(value, key) {
this[key] = value;
}, scope);
}
});