Permalink
Browse files

Prefix doesn't have a problem with non-existent `module` var. Closed #8

  • Loading branch information...
1 parent d409320 commit 9be8781d3b9e10bed33a16787a29028f9e5765bc @logicalparadox logicalparadox committed Jan 26, 2012
Showing with 8 additions and 5 deletions.
  1. +2 −1 dist/backbone.iobind.js
  2. +1 −1 dist/backbone.iobind.min.js
  3. +2 −1 dist/backbone.iosync.js
  4. +1 −1 dist/backbone.iosync.min.js
  5. +2 −1 lib/prefix.js
View
@@ -4,7 +4,8 @@
if (typeof window === 'undefined' || typeof require === 'function') {
_ = require('underscore');
Backbone = require('backbone');
- exports = module.exports = Backbone;
+ exports = Backbone;
+ if (module) module.exports = exports;
} else {
_ = this._;
Backbone = this.Backbone;

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -4,7 +4,8 @@
if (typeof window === 'undefined' || typeof require === 'function') {
_ = require('underscore');
Backbone = require('backbone');
- exports = module.exports = Backbone;
+ exports = Backbone;
+ if (module) module.exports = exports;
} else {
_ = this._;
Backbone = this.Backbone;
@@ -5,4 +5,4 @@
* https://github.com/logicalparadox/backbone.iobind
*/
-(function(a){var b,c,d;typeof window=="undefined"||typeof require=="function"?(b=require("underscore"),c=require("backbone"),d=module.exports=c):(b=this._,c=this.Backbone,d=this),c.sync=function(a,d,e){var f=function(a){return!a||!a.url?null:b.isFunction(a.url)?a.url():a.url},g=f(d).split("/"),h=g[0]!==""?g[0]:g[1],i=b.extend({req:h+":"+a},e);!i.data&&d&&(i.data=d.toJSON()||{});var j=d.socket||window.socket||c.socket;j.emit(h+":"+a,i.data,function(a,b){a?e.error(a):e.success(b)})}})()
+(function(a){var b,c,d;typeof window=="undefined"||typeof require=="function"?(b=require("underscore"),c=require("backbone"),d=c,module&&(module.exports=d)):(b=this._,c=this.Backbone,d=this),c.sync=function(a,d,e){var f=function(a){return!a||!a.url?null:b.isFunction(a.url)?a.url():a.url},g=f(d).split("/"),h=g[0]!==""?g[0]:g[1],i=b.extend({req:h+":"+a},e);!i.data&&d&&(i.data=d.toJSON()||{});var j=d.socket||window.socket||c.socket;j.emit(h+":"+a,i.data,function(a,b){a?e.error(a):e.success(b)})}})()
View
@@ -4,7 +4,8 @@
if (typeof window === 'undefined' || typeof require === 'function') {
_ = require('underscore');
Backbone = require('backbone');
- exports = module.exports = Backbone;
+ exports = Backbone;
+ if (module) module.exports = exports;
} else {
_ = this._;
Backbone = this.Backbone;

0 comments on commit 9be8781

Please sign in to comment.