evaluate_in_object


Description:

public Value evaluate_in_object (string code, ssize_t length, void* object_instance, Class? object_class, string uri, uint line_number, out Value object)

Evaluate code and create an new object where symbols defined in code will be added as properties, instead of being added to this global object.

The new object is returned as object parameter. Similar to how Value.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.

Parameters:

this

a Context

code

a JavaScript script to evaluate

length

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

object_instance

an object instance

object_class

a Class or null to use the default

uri

the source URI

line_number

the starting line number

object

return location for a Value.

Returns:

a Value representing the last value generated by the script.




2022 vala-language.org