Closed dreamiurg closed 8 years ago
Alright, I figured out that load() is present only for v8 shell.cc
https://code.google.com/p/v8/source/browse/trunk/samples/shell.cc
That is correct. By default, the JavaScript environment is pristine. No function that is not in the JS spec is available. Note that you could implement load()
in Ruby though:
ctx = V8::Context.new
ctx['load'] = lambda do |this, filename|
ctx.load filename
end
ctx.eval('load("file.js")')
I can't figure out how to load JS code from a separate file from within JS code running in this Ruby wrapper.
Example code:
Error message: