Skip to content
This repository was archived by the owner on May 19, 2018. It is now read-only.

Decorators Stage 2 Parsing #587

Merged
merged 14 commits into from
Jun 22, 2017
Prev Previous commit
Next Next commit
Throw if both decorators decorators-stage-2 used
  • Loading branch information
peey committed Jun 17, 2017
commit 162bc905a656bcf98e7c6b1d11893bb85c4f4b86
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ function getParserClass(pluginsFromOptions: $ReadOnlyArray<string>): Class<Parse
pluginList.unshift("estree");
}

if (pluginList.indexOf("decorators") >= 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) {
Expand Down