Skip to content
Browse files

Fixed #attach() with a default target object

  • Loading branch information...
1 parent 229b586 commit 7738277f010613744fddbf1e647206440bb48429 @gabrieleds gabrieleds committed
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/bike.js
View
12 lib/bike.js
@@ -82,17 +82,17 @@ Bike.base = require('./bike/base');;
*/
Bike.attach = Bike.extend = function(target, namespaces){
- if(target){
- target.define = Bike.define;
- target.create = Bike.create;
- target.namespace = Bike.namespace;
- }
+ target = target || {};
+
+ target.define = Bike.define;
+ target.create = Bike.create;
+ target.namespace = Bike.namespace;
if(namespaces){
Bike.namespace(namespaces);
}
- return target; //Bike;
+ return target;
};
/**

0 comments on commit 7738277

Please sign in to comment.
Something went wrong with that request. Please try again.