class ExecJS::GraalJSRuntime

Public Instance Methods

available?() click to toggle source
# File lib/execjs/graaljs_runtime.rb, line 125
def available?
  return @available if defined?(@available)

  unless RUBY_ENGINE == "truffleruby"
    return @available = false
  end

  unless defined?(Polyglot::InnerContext)
    warn "TruffleRuby #{RUBY_ENGINE_VERSION} does not have support for inner contexts, use a more recent version", uplevel: 0 if $VERBOSE
    return @available = false
  end

  unless Polyglot.languages.include? "js"
    warn "The language 'js' is not available, you likely need to `export TRUFFLERUBYOPT='--jvm --polyglot'`", uplevel: 0 if $VERBOSE
    warn "You also need to install the 'js' component, see https://github.com/oracle/truffleruby/blob/master/doc/user/polyglot.md#installing-other-languages", uplevel: 0 if $VERBOSE
    return @available = false
  end

  @available = true
end
name() click to toggle source
# File lib/execjs/graaljs_runtime.rb, line 121
def name
  "GraalVM (Graal.js)"
end