JS add on specific to Opal
6 7 8 9 10
# File 'lib/platform_specific/opal/extensions/js.rb', line 6 def self.eval(string) clean_str = string.gsub('return', '') result = `eval(#{clean_str})` Native(result) end
12 13 14
# File 'lib/platform_specific/opal/extensions/js.rb', line 12 def self.global JS.eval('window') end