diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-04-20 03:09:25 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-04-24 16:14:29 +0200 |
commit | 82f2b76e25a4a67e01ec67e5ebe39d14ad771ea8 (patch) | |
tree | 965f6eb89b84d65a62b49008fd972c004832ccd1 /node_modules/babel-messages/lib | |
parent | e6e0cbc387c2a77b48e4065c229daa65bf1aa0fa (diff) | |
download | wallet-core-82f2b76e25a4a67e01ec67e5ebe39d14ad771ea8.tar.xz |
Reorganize module loading.
We now use webpack instead of SystemJS, effectively bundling modules
into one file (plus commons chunks) for every entry point. This results
in a much smaller extension size (almost half). Furthermore we use
yarn/npm even for extension run-time dependencies. This relieves us
from manually vendoring and building dependencies. It's also easier to
understand for new developers familiar with node.
Diffstat (limited to 'node_modules/babel-messages/lib')
-rw-r--r-- | node_modules/babel-messages/lib/index.js | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/node_modules/babel-messages/lib/index.js b/node_modules/babel-messages/lib/index.js index 9565195a6..39e023ece 100644 --- a/node_modules/babel-messages/lib/index.js +++ b/node_modules/babel-messages/lib/index.js @@ -1,4 +1,4 @@ -/*istanbul ignore next*/"use strict"; +"use strict"; exports.__esModule = true; exports.MESSAGES = undefined; @@ -8,24 +8,17 @@ var _stringify = require("babel-runtime/core-js/json/stringify"); var _stringify2 = _interopRequireDefault(_stringify); exports.get = get; -/*istanbul ignore next*/exports.parseArgs = parseArgs; +exports.parseArgs = parseArgs; -var /*istanbul ignore next*/_util = require("util"); +var _util = require("util"); -/*istanbul ignore next*/ var util = _interopRequireWildcard(_util); -/*istanbul ignore next*/ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/** - * Mapping of messages to be used in Babel. - * Messages can include $0-style placeholders. - */ - -var MESSAGES = /*istanbul ignore next*/exports.MESSAGES = { +var MESSAGES = exports.MESSAGES = { tailCallReassignmentDeopt: "Function reference has been reassigned, so it will probably be dereferenced, therefore we can't optimise this with confidence", classesIllegalBareSuper: "Illegal use of bare super", classesIllegalSuperCall: "Direct super call is illegal in non-constructor, use super.$1() instead", @@ -61,42 +54,28 @@ var MESSAGES = /*istanbul ignore next*/exports.MESSAGES = { pluginInvalidProperty: "Plugin $2 specified in $1 provided an invalid property of $3" }; -/** - * Get a message with $0 placeholders replaced by arguments. - */ - -/* eslint max-len: 0 */ - function get(key) { - /*istanbul ignore next*/ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var msg = MESSAGES[key]; - if (!msg) throw new ReferenceError( /*istanbul ignore next*/"Unknown message " + /*istanbul ignore next*/(0, _stringify2.default)(key)); + if (!msg) throw new ReferenceError("Unknown message " + (0, _stringify2.default)(key)); - // stringify args args = parseArgs(args); - // replace $0 placeholders with args return msg.replace(/\$(\d+)/g, function (str, i) { return args[i - 1]; }); } -/** - * Stingify arguments to be used inside messages. - */ - function parseArgs(args) { return args.map(function (val) { if (val != null && val.inspect) { return val.inspect(); } else { try { - return (/*istanbul ignore next*/(0, _stringify2.default)(val) || val + "" - ); + return (0, _stringify2.default)(val) || val + ""; } catch (e) { return util.inspect(val); } |