add unsupportedOutputType to messages.js
This commit is contained in:
parent
71f5c9791d
commit
623be068c4
@ -1,5 +1,6 @@
|
||||
import buildHelpers from "./build-helpers";
|
||||
import generator from "./generation";
|
||||
import * as messages from "./messages";
|
||||
import * as util from "./util";
|
||||
import t from "./types";
|
||||
|
||||
@ -62,7 +63,7 @@ export default function (whitelist, outputType = "global") {
|
||||
} else if (outputType === "var") {
|
||||
tree = buildVar(namespace, builder);
|
||||
} else {
|
||||
throw new Error("Unsupported output type");
|
||||
throw new Error(messages.get("unsupportedOutputType", outputType));
|
||||
}
|
||||
|
||||
return generator(tree).code;
|
||||
|
||||
@ -20,7 +20,8 @@ export var messages = {
|
||||
didYouMean: "Did you mean $1?",
|
||||
evalInStrictMode: "eval is not allowed in strict mode",
|
||||
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"
|
||||
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"
|
||||
};
|
||||
|
||||
export function get(key) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user