ソースを参照

dont use Object.assign

Adam Shaw 8 年 前
コミット
1fddbb3001
1 ファイル変更6 行追加6 行削除
  1. 6 6
      src/common/Class.js

+ 6 - 6
src/common/Class.js

@@ -8,12 +8,12 @@ function Class() { }
 // Called on a class to create a subclass.
 // Last argument contains instance methods. Any argument before the last are considered mixins.
 Class.extend = function() {
-	var members = Object.assign.apply( // collapse all object args into one object
-		Object,
-		[ {} ].concat( // prepend empty object, as the destination
-			Array.prototype.slice.call(arguments) // needs to be a true array for concat
-		)
-	);
+	var members = {};
+	var i;
+
+	for (i = 0; i < arguments.length; i++) {
+		copyOwnProps(arguments[i], members);
+	}
 
 	return extendClass(this, members);
 };