diff options
Diffstat (limited to 'node_modules/babel-messages')
-rw-r--r-- | node_modules/babel-messages/.npmignore | 3 | ||||
-rw-r--r-- | node_modules/babel-messages/README.md | 18 | ||||
-rw-r--r-- | node_modules/babel-messages/lib/index.js | 105 | ||||
-rw-r--r-- | node_modules/babel-messages/package.json | 101 |
4 files changed, 227 insertions, 0 deletions
diff --git a/node_modules/babel-messages/.npmignore b/node_modules/babel-messages/.npmignore new file mode 100644 index 000000000..47cdd2c65 --- /dev/null +++ b/node_modules/babel-messages/.npmignore @@ -0,0 +1,3 @@ +src +test +node_modules diff --git a/node_modules/babel-messages/README.md b/node_modules/babel-messages/README.md new file mode 100644 index 000000000..297cd0c83 --- /dev/null +++ b/node_modules/babel-messages/README.md @@ -0,0 +1,18 @@ +# babel-messages + +> Collection of debug messages used by Babel. + +## Install + +```sh +$ npm install babel-messages +``` + +## Usage + +```js +import * as messages from 'babel-messages'; + +messages.get('tailCallReassignmentDeopt'); +// > "Function reference has been..." +``` diff --git a/node_modules/babel-messages/lib/index.js b/node_modules/babel-messages/lib/index.js new file mode 100644 index 000000000..9565195a6 --- /dev/null +++ b/node_modules/babel-messages/lib/index.js @@ -0,0 +1,105 @@ +/*istanbul ignore next*/"use strict"; + +exports.__esModule = true; +exports.MESSAGES = undefined; + +var _stringify = require("babel-runtime/core-js/json/stringify"); + +var _stringify2 = _interopRequireDefault(_stringify); + +exports.get = get; +/*istanbul ignore next*/exports.parseArgs = parseArgs; + +var /*istanbul ignore next*/_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 = { + 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", + scopeDuplicateDeclaration: "Duplicate declaration $1", + settersNoRest: "Setters aren't allowed to have a rest", + noAssignmentsInForHead: "No assignments allowed in for-in/of head", + expectedMemberExpressionOrIdentifier: "Expected type MemberExpression or Identifier", + invalidParentForThisNode: "We don't know how to handle this node within the current parent - please open an issue", + readOnly: "$1 is read-only", + unknownForHead: "Unknown node type $1 in ForStatement", + didYouMean: "Did you mean $1?", + codeGeneratorDeopt: "Note: The code generator has deoptimised the styling of $1 as it exceeds the max of $2.", + missingTemplatesDirectory: "no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues", + unsupportedOutputType: "Unsupported output type $1", + illegalMethodName: "Illegal method name $1", + lostTrackNodePath: "We lost track of this node's position, likely because the AST was directly manipulated", + + modulesIllegalExportName: "Illegal export $1", + modulesDuplicateDeclarations: "Duplicate module declarations with the same source but in different scopes", + + undeclaredVariable: "Reference to undeclared variable $1", + undeclaredVariableType: "Referencing a type alias outside of a type annotation", + undeclaredVariableSuggestion: "Reference to undeclared variable $1 - did you mean $2?", + + traverseNeedsParent: "You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a $1 node without passing scope and parentPath.", + traverseVerifyRootFunction: "You passed `traverse()` a function when it expected a visitor object, are you sure you didn't mean `{ enter: Function }`?", + traverseVerifyVisitorProperty: "You passed `traverse()` a visitor object with the property $1 that has the invalid property $2", + traverseVerifyNodeType: "You gave us a visitor for the node type $1 but it's not a valid type", + + pluginNotObject: "Plugin $2 specified in $1 was expected to return an object when invoked but returned $3", + pluginNotFunction: "Plugin $2 specified in $1 was expected to return a function but returned $3", + pluginUnknown: "Unknown plugin $1 specified in $2 at $3, attempted to resolve relative to $4", + 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)); + + // 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 + "" + ); + } catch (e) { + return util.inspect(val); + } + } + }); +}
\ No newline at end of file diff --git a/node_modules/babel-messages/package.json b/node_modules/babel-messages/package.json new file mode 100644 index 000000000..c543a7a7e --- /dev/null +++ b/node_modules/babel-messages/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + { + "raw": "babel-messages@^6.8.0", + "scope": null, + "escapedName": "babel-messages", + "name": "babel-messages", + "rawSpec": "^6.8.0", + "spec": ">=6.8.0 <7.0.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/babel-generator" + ] + ], + "_from": "babel-messages@>=6.8.0 <7.0.0", + "_id": "babel-messages@6.8.0", + "_inCache": true, + "_location": "/babel-messages", + "_nodeVersion": "5.1.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/babel-messages-6.8.0.tgz_1462232650913_0.2572917281650007" + }, + "_npmUser": { + "name": "hzoo", + "email": "hi@henryzoo.com" + }, + "_npmVersion": "3.8.6", + "_phantomChildren": {}, + "_requested": { + "raw": "babel-messages@^6.8.0", + "scope": null, + "escapedName": "babel-messages", + "name": "babel-messages", + "rawSpec": "^6.8.0", + "spec": ">=6.8.0 <7.0.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-generator", + "/babel-traverse" + ], + "_resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.8.0.tgz", + "_shasum": "bf504736ca967e6d65ef0adb5a2a5f947c8e0eb9", + "_shrinkwrap": null, + "_spec": "babel-messages@^6.8.0", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/babel-generator", + "author": { + "name": "Sebastian McKenzie", + "email": "sebmck@gmail.com" + }, + "dependencies": { + "babel-runtime": "^6.0.0" + }, + "description": "Collection of debug messages used by Babel.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "bf504736ca967e6d65ef0adb5a2a5f947c8e0eb9", + "tarball": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.8.0.tgz" + }, + "homepage": "https://babeljs.io/", + "license": "MIT", + "main": "lib/index.js", + "maintainers": [ + { + "name": "amasad", + "email": "amjad.masad@gmail.com" + }, + { + "name": "hzoo", + "email": "hi@henryzoo.com" + }, + { + "name": "jmm", + "email": "npm-public@jessemccarthy.net" + }, + { + "name": "loganfsmyth", + "email": "loganfsmyth@gmail.com" + }, + { + "name": "sebmck", + "email": "sebmck@gmail.com" + }, + { + "name": "thejameskyle", + "email": "me@thejameskyle.com" + } + ], + "name": "babel-messages", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel/tree/master/packages/babel-messages" + }, + "scripts": {}, + "version": "6.8.0" +} |