From 7fc28cb63fdb0b2c01ecae7d92ab506cf7596cf5 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Tue, 31 Mar 2015 23:47:40 +1100 Subject: [PATCH] move deprecation check down --- src/babel/transformation/file/index.js | 6 ++++-- src/babel/transformation/transformers/es7/decorators.js | 1 - src/babel/transformation/transformers/es7/do-expressions.js | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/babel/transformation/file/index.js b/src/babel/transformation/file/index.js index aa50ba0fbd..becf278c0d 100644 --- a/src/babel/transformation/file/index.js +++ b/src/babel/transformation/file/index.js @@ -104,12 +104,14 @@ export default class File { for (let key in File.options) { let option = File.options[key]; + + var val = opts[key]; + if (!val && option.optional) continue; + if (option.deprecated) { throw new Error("Deprecated option " + key + ": " + option.deprecated); } - var val = opts[key]; - if (!val && option.optional) continue; if (val == null) val = option.default || val; var optionParser = optionParsers[option.type]; diff --git a/src/babel/transformation/transformers/es7/decorators.js b/src/babel/transformation/transformers/es7/decorators.js index 4353ce600c..576c7fb7c0 100644 --- a/src/babel/transformation/transformers/es7/decorators.js +++ b/src/babel/transformation/transformers/es7/decorators.js @@ -1,5 +1,4 @@ export var metadata = { - experimental: true, optional: true, stage: 1 }; diff --git a/src/babel/transformation/transformers/es7/do-expressions.js b/src/babel/transformation/transformers/es7/do-expressions.js index e587061e3d..787dba3219 100644 --- a/src/babel/transformation/transformers/es7/do-expressions.js +++ b/src/babel/transformation/transformers/es7/do-expressions.js @@ -1,7 +1,6 @@ import * as t from "../../../types"; export var metadata = { - experimental: true, optional: true, stage: 0 };