require 'js'

script =<<EOM
// define Document class
function write() {return arguments.join('')}
function Document() { this.write = write }

var document = new Document;

// main
document.write("The now time is: ", new Date(), "\n");
EOM

p JS::evaluate(script)
