JSContext.createInGroup constructor
JSContext.createInGroup({
- JSContextGroup? group,
- JSClass? globalObjectClass,
Creates a global JavaScript execution context in the context group provided.
JSGlobalContextCreateInGroup allocates a global object and populates it with
all the built-in JavaScript objects, such as Object, Function, String, and Array.
group
(JSContextGroup) The context group to use. The created global context retains the group. Pass NULL to create a unique group for the context.
globalObjectClass
(JSClass) The class to use when creating the global object. Pass NULL to use the default object class.
@result
(JSGlobalContext) A JSGlobalContext with a global object of class globalObjectClass and a context group equal to group.
Implementation
JSContext.createInGroup({
JSContextGroup? group,
JSClass? globalObjectClass,
}) : this._pointer = JSContextRef.jSGlobalContextCreateInGroup(
group == null ? JSContextRef.jSContextGroupCreate() : group.pointer,
globalObjectClass == null ? nullptr : globalObjectClass.pointer);