Skip to content

Commit

Permalink
Merge f371dd6 into 792fdab
Browse files Browse the repository at this point in the history
  • Loading branch information
inetfuture committed Apr 2, 2015
2 parents 792fdab + f371dd6 commit d3e6f8e
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions utf8.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,10 @@

// Some AMD build optimizers, like r.js, check for specific condition patterns
// like the following:
if (
typeof define == 'function' &&
typeof define.amd == 'object' &&
define.amd
) {
define(function() {
return utf8;
});
} else if (freeExports && !freeExports.nodeType) {
//
// Check exports first, in case of loading a browserfied library in AMD style,
// should use exports instead of define a AMD module
if (freeExports && !freeExports.nodeType) {
if (freeModule) { // in Node.js or RingoJS v0.8.0+
freeModule.exports = utf8;
} else { // in Narwhal or RingoJS v0.7.0-
Expand All @@ -237,6 +232,14 @@
hasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);
}
}
} else if (
typeof define == 'function' &&
typeof define.amd == 'object' &&
define.amd
) {
define(function() {
return utf8;
});
} else { // in Rhino or a web browser
root.utf8 = utf8;
}
Expand Down

0 comments on commit d3e6f8e

Please sign in to comment.