From 9ef31616d54282556033061b48796a1543ed7442 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrg=20Lehni?= <juerg@scratchdisk.com>
Date: Sat, 14 May 2011 13:14:43 +0300
Subject: [PATCH] Have paper.install() use Base.each().

---
 src/paper.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/paper.js b/src/paper.js
index fd8126df..bc4d5294 100644
--- a/src/paper.js
+++ b/src/paper.js
@@ -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);
 	}
 });