add error for decorators not being implemented yet

This commit is contained in:
Sebastian McKenzie
2015-11-12 01:49:01 -08:00
parent 2d3760c1f7
commit 69fb1854d7
11 changed files with 8 additions and 138 deletions

View File

@@ -70,12 +70,18 @@ export default function ({ types: t }) {
return false;
}
function doError(path) {
throw path.buildCodeFrameError("Decorators are not supported yet in 6.x pending proposal update.");
}
return {
inherits: require("babel-plugin-syntax-decorators"),
visitor: {
ClassExpression(path) {
if (!hasDecorators(path)) return;
doError(path);
explodeClass(path);
let ref = path.scope.generateDeclaredUidIdentifier("ref");
@@ -92,6 +98,7 @@ export default function ({ types: t }) {
ClassDeclaration(path) {
if (!hasDecorators(path)) return;
doError(path);
explodeClass(path);
let ref = path.node.id;
@@ -105,6 +112,7 @@ export default function ({ types: t }) {
ObjectExpression(path) {
if (!hasDecorators(path)) return;
doError(path);
}
}
};