Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (13 sloc) 380 Bytes
require 'java'
require 'rubygems'
require 'mvn:rhino:js'
java_import org.mozilla.javascript.Context
context = Context.enter
scope = context.init_standard_objects
code = %[
var javascriptInMyJavaInMyRuby = function() {
return "Can you say polyglot programming?!";
};
javascriptInMyJavaInMyRuby();
]
puts context.evaluate_string scope, code, "example-1.js", 1, nil
Something went wrong with that request. Please try again.