Skip to content

Commit

Permalink
expose the source of the factory making code so it can be reused
Browse files Browse the repository at this point in the history
  • Loading branch information
dperini committed Jul 19, 2013
1 parent 8776de9 commit 15dd42f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/nwmatcher-base.js
Expand Up @@ -35,10 +35,12 @@
factory(browserGlobal, exports);
return exports;
};
module.factory = factory;
} else {
factory(global,
(global.NW || (global.NW = global.Object())) &&
(global.NW.Dom || (global.NW.Dom = global.Object())));
global.NW.Dom.factory = factory;
}

})(this, function(global, exports) {
Expand Down
2 changes: 2 additions & 0 deletions src/nwmatcher-noqsa.js
Expand Up @@ -35,10 +35,12 @@
factory(browserGlobal, exports);
return exports;
};
module.factory = factory;
} else {
factory(global,
(global.NW || (global.NW = global.Object())) &&
(global.NW.Dom || (global.NW.Dom = global.Object())));
global.NW.Dom.factory = factory;
}

})(this, function(global, exports) {
Expand Down
2 changes: 2 additions & 0 deletions src/nwmatcher.js
Expand Up @@ -37,12 +37,14 @@
factory(browserGlobal, exports);
return exports;
};
module.factory = factory;
} else {
// in a browser environment, the nwmatcher functions will operate on
// the "global" loading them and be attached to "global.NW.Dom"
factory(global,
(global.NW || (global.NW = global.Object())) &&
(global.NW.Dom || (global.NW.Dom = global.Object())));
global.NW.Dom.factory = factory;
}

})(this, function(global, exports) {
Expand Down

0 comments on commit 15dd42f

Please sign in to comment.