class Opal::CliRunners::Quickjs

QuickJS is Fabrice Bellard’s minimalistic JavaScript engine github.com/bellard/quickjs

Public Class Methods

call(data) click to toggle source
# File lib/opal/cli_runners/quickjs.rb, line 12
def self.call(data)
  exe = ENV['QJS_PATH'] || 'qjs'

  opts = Shellwords.shellwords(ENV['QJS_OPTS'] || '')

  SystemRunner.call(data) do |tempfile|
    [exe, '--std', *opts, tempfile.path, *data[:argv]]
  end
rescue Errno::ENOENT
  raise MissingQuickjs, 'Please install QuickJS to be able to run Opal scripts.'
end