rename selfContained transformer to runtime

This commit is contained in:
Sebastian McKenzie 2015-02-21 17:20:59 +11:00
parent 5deaeba3a0
commit 55357a331d
29 changed files with 11 additions and 9 deletions

View File

@ -176,7 +176,7 @@ File.prototype.normalizeOptions = function (opts) {
}
if (opts.externalHelpers) {
this.set("runtimeIdentifier", t.identifier("babelHelpers"));
this.set("helpersNamespace", t.identifier("babelHelpers"));
}
opts.blacklist = transform._ensureTransformerNames("blacklist", opts.blacklist);
@ -333,7 +333,7 @@ File.prototype.addHelper = function (name) {
var declar = program._declarations && program._declarations[name];
if (declar) return declar.id;
var runtime = this.get("runtimeIdentifier");
var runtime = this.get("helpersNamespace");
if (runtime) {
name = t.identifier(t.toIdentifier(name));
return t.memberExpression(runtime, name);

View File

@ -1 +1,3 @@
{}
{
"selfContained": "runtime"
}

View File

@ -79,7 +79,7 @@ module.exports = {
// needs to be after `regenerator` due to needing `regeneratorRuntime` references
// needs to be after `es6.forOf` due to needing `Symbol.iterator` references
// needs to be before `es6.modules` due to dynamic imports
selfContained: require("./other/self-contained"),
runtime: require("./other/runtime"),
// needs to be before `_blockHoist` due to function hoisting etc
"es6.modules": require("./es6/modules"),

View File

@ -82,7 +82,7 @@ exports.Program = function (node, parent, scope, file) {
};
exports.pre = function (file) {
file.setDynamic("runtimeIdentifier", function () {
file.setDynamic("helpersNamespace", function () {
return file.addImport("babel-runtime/helpers", "babelHelpers");
});

View File

@ -0,0 +1,4 @@
{
"optional": ["runtime"],
"experimental": true
}

View File

@ -1,4 +0,0 @@
{
"optional": ["selfContained"],
"experimental": true
}