mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
Whitelist specific ES6 features we want for now.
This commit is contained in:
@ -110,7 +110,7 @@ module Tilt
|
|||||||
|
|
||||||
def generate_source(scope)
|
def generate_source(scope)
|
||||||
js_source = ::JSON.generate(data, quirks_mode: true)
|
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}()"
|
"new module.exports.Compiler(#{js_source}, '#{module_name(scope.root_path, scope.logical_path)}', #{compiler_options}).#{compiler_method}()"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user