v8  3.28.71(node0.12.18)
V8 is Google's open source JavaScript engine
ScriptCompiler Class Reference

#include <v8.h>

Data Structures

struct  CachedData
 
class  Source
 

Public Types

enum  CompileOptions {
  kNoCompileOptions = 0, kProduceParserCache, kConsumeParserCache, kProduceCodeCache,
  kConsumeCodeCache, kProduceDataToCache
}
 

Static Public Member Functions

static Local< UnboundScriptCompileUnbound (Isolate *isolate, Source *source, CompileOptions options=kNoCompileOptions)
 
static Local< ScriptCompile (Isolate *isolate, Source *source, CompileOptions options=kNoCompileOptions)
 

Detailed Description

For compiling scripts.

Definition at line 1017 of file v8.h.

Member Enumeration Documentation

Enumerator
kNoCompileOptions 
kProduceParserCache 
kConsumeParserCache 
kProduceCodeCache 
kConsumeCodeCache 
kProduceDataToCache 

Definition at line 1090 of file v8.h.

Member Function Documentation

static Local<Script> Compile ( Isolate isolate,
Source source,
CompileOptions  options = kNoCompileOptions 
)
static

Compiles the specified script (bound to current context).

Parameters
sourceScript source code.
pre_dataPre-parsing data, as obtained by ScriptData::PreCompile() using pre_data speeds compilation if it's done multiple times. Owned by caller, no references are kept when this function returns.
Returns
Compiled script object, bound to the context that was active when this function was called. When run it will always use this context.
static Local<UnboundScript> CompileUnbound ( Isolate isolate,
Source source,
CompileOptions  options = kNoCompileOptions 
)
static

Compiles the specified script (context-independent). Cached data as part of the source object can be optionally produced to be consumed later to speed up compilation of identical source scripts.

Note that when producing cached data, the source must point to NULL for cached data. When consuming cached data, the cached data must have been produced by the same version of V8.

Parameters
sourceScript source code.
Returns
Compiled script object (context independent; for running it must be bound to a context).

The documentation for this class was generated from the following file: