Struct v8::script::Script
[−]
[src]
pub struct Script(_, _);
A compiled JavaScript script, tied to a Context which was active when the script was compiled.
Methods
impl Script
[src]
fn compile(isolate: &Isolate,
context: &Context,
source: &String)
-> Result<Script>
context: &Context,
source: &String)
-> Result<Script>
Compiles the specified source code into a compiled script.
fn compile_with_name(isolate: &Isolate,
context: &Context,
name: &Value,
source: &String)
-> Result<Script>
context: &Context,
name: &Value,
source: &String)
-> Result<Script>
Compiles the specified source code into a compiled script.
The specified name will be reported as the script's origin and will show up in stack traces, for example.
fn run(&self, context: &Context) -> Result<Value>
Runs this script in the specified context.
If the script returns a value, meaning that the last line of the script evaluates to an expression or there is an explicit return, that value will be returned from this method. If the script throws an exception, that will reslt in this method also throwing an exception.
Trait Implementations
impl Debug for Script
[src]
impl Clone for Script
[src]
fn clone(&self) -> Script
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more