Skip to content

Commit

Permalink
register in all available module systems
Browse files Browse the repository at this point in the history
We (@caridy, @ericf, @juandopazo, @drewfish and a few others) had a discussion
and thought it might be valuable to register the module in all available
module systems (CommonJS, AMD, and polyfilling the global).
  • Loading branch information
drewfish committed Dec 3, 2013
1 parent 4bf2d84 commit e487f10
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions Intl.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,18 @@
if (root && root.Intl) {
root.OldIntl = root.Intl;
}
// Follow Universal Module Definition, specifically...
// https://github.com/umdjs/umd/blob/master/returnExportsGlobal.js
var Intl = factory();
// register in -all- the module systems (at once)
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(function () {
return (root.Intl = factory());
});
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root.Intl = factory();
defined('Intl', Intl);
}
if (typeof exports === 'object') {
module.exports = Intl;
}
if (root) {
root.Intl = Intl;
}
})(this, function() {
})(typeof global !== 'undefined' ? global : this, function() {
"use strict";
var
Intl = {},
Expand Down

0 comments on commit e487f10

Please sign in to comment.