Whitelist specific ES6 features we want for now.

This commit is contained in:
Robin Ward 2015-02-06 13:44:17 -05:00
parent a65e0a80ba
commit 9584990477

View File

@ -110,7 +110,7 @@ module Tilt
def generate_source(scope)
js_source = ::JSON.generate(data, quirks_mode: true)
js_source = "to5.transform(#{js_source}, {ast: false, blacklist: ['es6.modules', 'useStrict']})['code']"
js_source = "to5.transform(#{js_source}, {ast: false, whitelist: ['es6.constants', 'es6.properties.shorthand', 'es6.arrowFunctions', 'es6.blockScoping']})['code']"
"new module.exports.Compiler(#{js_source}, '#{module_name(scope.root_path, scope.logical_path)}', #{compiler_options}).#{compiler_method}()"
end