Skip to content

Instantly share code, notes, and snippets.

@drewfish
Created December 4, 2013 21:51
Show Gist options
  • Save drewfish/7796239 to your computer and use it in GitHub Desktop.
Save drewfish/7796239 to your computer and use it in GitHub Desktop.
polyfill registration for Intl.MessageFormatter strawman
(function (root, factory) {
var MessageFormatter = factory();
// register in -all- the module systems (at once)
if (typeof define === 'function' && define.amd) {
defined('IntlMessageFormatter', MessageFormatter);
}
if (typeof exports === 'object') {
module.exports = MessageFormatter;
}
if (root) {
root.IntlMessageFormatter = MessageFormatter;
}
})(typeof global !== 'undefined' ? global : this, function() {
"use strict";
function MessageFormatter() {
...
}
...
return MessageFormatter;
});
@caridy
Copy link

caridy commented Dec 5, 2013

We should not use a name when calling define. AMD, just like ES6 and CJS will support anonymous modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment