Merge pull request #3362 from hzoo/err-babel-5-plugin
Show a better error when trying to use a babel 5 plugin
This commit is contained in:
commit
54a064b970
@ -26,6 +26,10 @@ export { traverse };
|
||||
import OptionManager from "../transformation/file/options/option-manager";
|
||||
export { OptionManager };
|
||||
|
||||
export function Plugin(alias) {
|
||||
throw new Error(`The (${alias}) Babel 5 plugin is being run with Babel 6.`);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
import Pipeline from "../transformation/pipeline";
|
||||
|
||||
20
packages/babel-core/test/option-manager.js
Normal file
20
packages/babel-core/test/option-manager.js
Normal file
@ -0,0 +1,20 @@
|
||||
var assert = require("assert");
|
||||
var OptionManager = require("../lib/transformation/file/options/option-manager");
|
||||
|
||||
suite("option-manager", function () {
|
||||
suite("memoisePluginContainer", function () {
|
||||
test("throws for babel 5 plugin", function() {
|
||||
return assert.throws(
|
||||
function () {
|
||||
OptionManager.memoisePluginContainer(
|
||||
function (ref) {
|
||||
var Plugin = ref.Plugin;
|
||||
return new Plugin("object-assign", {});
|
||||
}
|
||||
);
|
||||
},
|
||||
/Babel 5 plugin is being run with Babel 6/
|
||||
);
|
||||
})
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user