From 981d3e40f84b2ee9c081a6cf7228c56e18fa8e92 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sun, 1 Feb 2015 16:20:32 +1100 Subject: [PATCH] add canRun check for playground transformers --- lib/6to5/transformation/transformer-pass.js | 2 ++ lib/6to5/transformation/transformer.js | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/6to5/transformation/transformer-pass.js b/lib/6to5/transformation/transformer-pass.js index 48d7866ef9..95a013f68f 100644 --- a/lib/6to5/transformation/transformer-pass.js +++ b/lib/6to5/transformation/transformer-pass.js @@ -41,6 +41,8 @@ TransformerPass.prototype.canRun = function () { if (transformer.experimental && !opts.experimental) return false; + if (transformer.playground && !opts.playground) return false; + return true; }; diff --git a/lib/6to5/transformation/transformer.js b/lib/6to5/transformation/transformer.js index 6ef8575369..4ec0c92803 100644 --- a/lib/6to5/transformation/transformer.js +++ b/lib/6to5/transformation/transformer.js @@ -17,6 +17,7 @@ var each = require("lodash/collection/each"); function Transformer(key, transformer, opts) { this.manipulateOptions = transformer.manipulateOptions; this.experimental = !!transformer.experimental; + this.playground = !!transformer.playground; this.secondPass = !!transformer.secondPass; this.optional = !!transformer.optional; this.handlers = this.normalise(transformer);