Value.this
- this(JSCValue* jSCValue, bool ownedRef)
- this(Context context, PtrArray array)
- this(Context context, string[] strv)
- this(Context context, bool value)
- this(Context context, string name, GCallback callback, void* userData, GDestroyNotify destroyNotify, GType returnType)
- this(Context context, string name, GCallback callback, void* userData, GDestroyNotify destroyNotify, GType returnType, GType[] parameterTypes)
- this(Context context)
- this(Context context, double number)
- this(Context context, void* instance_, Class jscClass)
- this(Context context, string string_)
- this(Context context, Bytes bytes)
javascriptcore Value Value
constructorsfunctionsstatic functionsvariables
Create a function in @context. If @name is %NULL an anonymous function will be created. When the function is called by JavaScript or jsc_value_function_call(), @callback is called receiving an #GPtrArray of #JSCValue<!-- -->s with the arguments and then @user_data as last parameter. When the function is cleared in @context, @destroy_notify is called with @user_data as parameter.
Note that the value returned by @callback must be fully transferred. In case of boxed types, you could use %G_TYPE_POINTER instead of the actual boxed #GType to ensure that the instance owned by #JSCClass is used. If you really want to return a new copy of the boxed type, use #JSC_TYPE_VALUE and return a #JSCValue created with jsc_value_new_object() that receives the copy as instance parameter.