add unsupportedOutputType to messages.js

This commit is contained in:
Ondrej Kraus 2015-03-05 13:17:10 +01:00
parent 71f5c9791d
commit 623be068c4
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -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) {