force experimental and playground flag when whitelisting/optionalising transformers

This commit is contained in:
Sebastian McKenzie
2015-02-12 07:45:50 +11:00
parent faa10df84c
commit 7953eb560e

View File

@@ -176,6 +176,15 @@ File.prototype.normalizeOptions = function (opts) {
"`reactCompat` - backwards compatibility will be removed in v4.0.0");
}
var ensureEnabled = function (key) {
var namespace = transform.namespaces[key];
if (namespace === "playground") opts.playground = true;
if (namespace === "experimental") opts.experimental = true;
};
each(opts.whitelist, ensureEnabled);
each(opts.optional, ensureEnabled);
return opts;
};