![]() |
![]() |
![]() |
Seed Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <seed/seed.h> SeedScript; SeedScript * seed_make_script (SeedContext ctx, const gchar *js, const gchar *source_url, gint line_number); SeedValue seed_evaluate (SeedContext ctx, SeedScript *s, SeedObject this); SeedValue seed_simple_evaluate (SeedContext ctx, gchar *source, SeedException *exception); SeedScript * seed_script_new_from_file (SeedContext ctx, gchar *file); SeedException seed_script_exception (SeedScript *s);
typedef struct { JSStringRef script; JSValueRef exception; JSStringRef source_url; gint line_number; } SeedScript;
SeedScript * seed_make_script (SeedContext ctx, const gchar *js, const gchar *source_url, gint line_number);
Creates a new SeedScript instance with js
as the contents, then
checks for proper syntax.
|
A SeedContext. |
|
A string representing the contents of the script. |
|
The filename of the script, for reference in errors, or NULL .
|
|
The line number of the beginning of the script, for reference
in error messages, or NULL .
|
Returns : |
The newly created SeedScript. |
SeedValue seed_evaluate (SeedContext ctx, SeedScript *s, SeedObject this);
Evaluates a SeedScript with this
as the global "this" object.
|
A SeedContext. |
|
A SeedScript to evaluate. |
|
The object which should be assigned to the "this" global. |
Returns : |
The SeedValue returned by evaluating the script. |
SeedValue seed_simple_evaluate (SeedContext ctx, gchar *source, SeedException *exception);
Evaluates a string of JavaScript.
|
A SeedContext. |
|
A string representing the JavaScript to evaluate. |
|
A SeedException pointer to store an exception in. |
Returns : |
The SeedValue returned by evaluating the script. |
SeedScript * seed_script_new_from_file (SeedContext ctx, gchar *file);
Uses seed_make_script()
to create a SeedScript from the contents of file
.
|
A SeedContext. |
|
The filename of the script to load. |
Returns : |
The newly created SeedScript. |
SeedException seed_script_exception (SeedScript *s);
|
A SeedScript. |
Returns : |
A JSValueRef representing the exception of s .
|