From 162bc905a656bcf98e7c6b1d11893bb85c4f4b86 Mon Sep 17 00:00:00 2001 From: Peeyush Kushwaha Date: Sat, 17 Jun 2017 13:38:04 +0530 Subject: [PATCH] Throw if both decorators decorators-stage-2 used --- src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.js b/src/index.js index 09a5c40cbe..d8e41d389a 100755 --- a/src/index.js +++ b/src/index.js @@ -62,6 +62,10 @@ function getParserClass(pluginsFromOptions: $ReadOnlyArray): Class= 0 && pluginList.indexOf("decorators-stage-2") >= 0) { + throw new Error("Cannot use decorators and decorators-stage-2 plugin together"); + } + const key = pluginList.join("/"); let cls = parserClassCache[key]; if (!cls) {