Context.evaluateInObject

Evaluate @code and create an new object where symbols defined in @code will be added as properties, instead of being added to @context global object. The new object is returned as @object parameter. Similar to how jsc_value_new_object() works, if @object_instance is not %NULL @object_class must be provided too. The @line_number is the starting line number in @uri; the value is one-based so the first line is 1. @uri and @line_number will be shown in exceptions and they don't affect the behavior of the script.

class Context
evaluateInObject
(
string code
,
ptrdiff_t length
,,,
string uri
,,)

Parameters

code string

a JavaScript script to evaluate

length ptrdiff_t

length of @code, or -1 if @code is a nul-terminated string

objectInstance void*

an object instance

objectClass Class

a #JSCClass or %NULL to use the default

uri string

the source URI

lineNumber uint

the starting line number

object Value

return location for a #JSCValue.

Return Value

Type: Value

a #JSCValue representing the last value generated by the script.

Meta