Runtime::Context
# File lib/execjs/external_runtime.rb, line 32 def call(identifier, *args) eval "#{identifier}.apply(this, #{JSON.encode(args)})" end
# File lib/execjs/external_runtime.rb, line 46 def compile(source) @runtime.send(:runner_source).dup.tap do |output| output.sub!('#{source}') do source end output.sub!('#{encoded_source}') do encoded_source = encode_unicode_codepoints(source) JSON.encode("(function(){ #{encoded_source} })()") end output.sub!('#{json2_source}') do IO.read(ExecJS.root + "/support/json2.js") end end end
# File lib/execjs/external_runtime.rb, line 37 def compile_to_tempfile(source) tempfile = Tempfile.open(['execjs', '.js']) tempfile.write compile(source) tempfile.close yield tempfile ensure tempfile.close! end
Generated with the Darkfish Rdoc Generator 2.