Lines Matching full:the
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
10 * distributed under the License is distributed on an "AS IS" BASIS,
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
23 * @brief Provides the standard JavaScript engine capabilities.
26 …* including managing the engine lifecycle, compiling and running JS code, implementing JS/C++ cros…
35 * @brief Provides the JSVM API define.
38 …* including managing the engine lifecycle, compiling and running JS code, implementing JS/C++ cros…
49 // Use INT_MAX, this should only be consumed by the pre-processor anyway.
55 // The baseline version for JSVM-API.
56 // The JSVM_VERSION controls which version will be used by default when
57 // compilling a native addon. If the addon developer specifically wants to use
101 * @brief Check whether the given JSVM_Value is a BigInt Object.
103 * @param env The environment that the API is invoked under.
104 * @param value The JavaScript value to check.
105 * @param result Whether the given value is a BigInt Object.
107 * {@link JSVM_OK } if the function executed successfully.\n
108 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
115 * @brief Check whether the given JSVM_Value is a Boolean Object.
117 * @param env The environment that the API is invoked under.
118 * @param value The JavaScript value to check.
119 * @param result Whether the given value is a Boolean Object.
121 * {@link JSVM_OK } if the function executed successfully.\n
122 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
129 * @brief Check whether the given JSVM_Value is a String Object.
131 * @param env The environment that the API is invoked under.
132 * @param value The JavaScript value to check.
133 * @param result Whether the given value is a String Object.
135 * {@link JSVM_OK } if the function executed successfully.\n
136 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
143 * @brief Check whether the given JSVM_Value is a Number Object.
145 * @param env The environment that the API is invoked under.
146 * @param value The JavaScript value to check.
147 * @param result Whether the given value is a Number Object.
149 * {@link JSVM_OK } if the function executed successfully.\n
150 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
157 * @brief Check whether the given JSVM_Value is a Symbol Object.
159 * @param env The environment that the API is invoked under.
160 * @param value The JavaScript value to check.
161 * @param result Whether the given value is a Symbol Object.
163 * {@link JSVM_OK } if the function executed successfully.\n
164 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
171 * @brief This API returns the Symbol.asyncIterator of Well-Known Symbols.
173 * @param env The environment that the API is invoked under.
174 * @param result The Symbol.asyncIterator of Well-Known Symbols.
176 * {@link JSVM_OK } if the function executed successfully.\n
177 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
184 * @brief This API returns the Symbol.hasInstance of Well-Known Symbols.
186 * @param env The environment that the API is invoked under.
187 * @param result The Symbol.hasInstance of Well-Known Symbols.
189 * {@link JSVM_OK } if the function executed successfully.\n
190 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
197 * @brief This API returns the Symbol.isConcatSpreadable of Well-Known Symbols
199 * @param env The environment that the API is invoked under.
200 * @param result The Symbol.isConcatSpreadable of Well-Known Symbols.
202 * {@link JSVM_OK } if the function executed successfully.\n
203 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
210 * @brief This API returns the Symbol.match of Well-Known Symbols
212 * @param env The environment that the API is invoked under.
213 * @param result The Symbol.match of Well-Known Symbols.
215 * {@link JSVM_OK } if the function executed successfully.\n
216 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
223 * @brief This API returns the Symbol.replace of Well-Known Symbols
225 * @param env The environment that the API is invoked under.
226 * @param result The Symbol.replace of Well-Known Symbols.
228 * {@link JSVM_OK } if the function executed successfully.\n
229 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
236 * @brief This API returns the Symbol.search of Well-Known Symbols
238 * @param env The environment that the API is invoked under.
239 * @param result The Symbol.search of Well-Known Symbols.
241 * {@link JSVM_OK } if the function executed successfully.\n
242 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
249 * @brief This API returns the Symbol.split of Well-Known Symbols
251 * @param env The environment that the API is invoked under.
252 * @param result The Symbol.split of Well-Known Symbols.
254 * {@link JSVM_OK } if the function executed successfully.\n
255 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
262 * @brief This API returns the Symbol.toPrimitive of Well-Known Symbols
264 * @param env The environment that the API is invoked under.
265 * @param result The Symbol.toPrimitive of Well-Known Symbols.
267 * {@link JSVM_OK } if the function executed successfully.\n
268 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
275 * @brief This API returns the Symbol.unscopables of Well-Known Symbols
277 * @param env The environment that the API is invoked under.
278 * @param result The Symbol.unscopables of Well-Known Symbols.
280 * {@link JSVM_OK } if the function executed successfully.\n
281 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
288 * @brief This API returns the Symbol.toStringTag of Well-Known Symbols
290 * @param env The environment that the API is invoked under.
291 * @param result The Symbol.toStringTag of Well-Known Symbols.
293 * {@link JSVM_OK } if the function executed successfully.\n
294 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
301 * @brief This API returns the Symbol.iterator of Well-Known Symbols
303 * @param env The environment that the API is invoked under.
304 * @param result The Symbol.iterator of Well-Known Symbols.
306 * {@link JSVM_OK } if the function executed successfully.\n
307 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL.\n
316 * @param options: The options for initialize the JavaScript VM.
317 * @return Returns JSVM_OK if the API succeeded.
325 * @param options: The options for create the VM instance.
326 * @param result: The new VM instance.
327 * @return Returns JSVM_OK if the API succeeded.
333 * @brief This function controls how Microtasks are invoked of the vm. If the method is not
334 * called, the default microtask policy of vm is JSVM_MicrotaskPolicy::JSVM_MICROTASK_AUTO.
336 * @param vm The VM instance to set mircrotasks policy.
338 * @return Returns JSVM_OK if the API succeeded.
346 * @param vm: The VM instance to be Destroyed.
347 * @return Returns JSVM_OK if the API succeeded.
353 * @brief This API allocates a default JavaScript Proxy. It is the equivalent of
356 * @param env The environment that the API is invoked under.
357 * @param target A JSVM_Value representing the JavaScript Object which you want to proxy.
358 * @param handler A JSVM_Value representing the JavaScript Object that defines which
362 * {@link JSVM_OK } if the API succeeded. \n
363 * {@link JSVM_INVALID_ARG } if the any of the input arguments is NULL. \n
372 * @brief This API checks if the value passed in is a Proxy.
374 * @param env The environment that the API is invoked under.
375 * @param value The JavaScript value to check.
376 * @param isProxy Whether the given value is Proxy.
378 * {@link JSVM_OK } if the API succeeded. \n
379 * {@link JSVM_INVALID_ARG } if the any of the input arguments is NULL. \n
388 * @param env The environment that the API is invoked under.
390 * @param result Target of the given proxy.
392 * {@link JSVM_OK } if the API succeeded. \n
393 * {@link JSVM_INVALID_ARG } if the any of the input arguments is NULL. \n
401 * @brief This API open a new VM scope for the VM instance.
403 * @param vm: The VM instance to open scope for.
404 * @param result: The new VM scope.
405 * @return Returns JSVM_OK if the API succeeded.
411 * @brief This function close the VM scope for the VM instance.
413 * @param vm: The VM instance to close scope for.
414 * @param scope: The VM scope to be closed.
415 * @return Returns JSVM_OK if the API succeeded.
421 …* @brief This function create a new environment with optional properties for the context of the ne…
423 * @param vm: The VM instance that the env will be created in.
424 * @param propertyCount: The number of elements in the properties array.
425 * @param properties: The array of property descriptor.
426 * @param result: The new environment created.
427 * @return Returns JSVM_OK if the API succeeded.
436 * @brief This function create a new environment from the start snapshot of the vm.
438 * @param vm: The VM instance that the env will be created in.
439 * @param index: The index of the environment in the snapshot.
440 * @param result: The new environment created.
441 * @return Returns JSVM_OK if the API succeeded.
447 * @brief This function destroys the environment.
449 * @param env: The environment to be destroyed.
450 * @return Returns JSVM_OK if the API succeeded.
458 * @param env: The environment that the JSVM-API call is invoked under.
459 * @param result: The new environment scope.
460 * @return Returns JSVM_OK if the API succeeded.
466 * @brief This function closes the environment scope of the environment.
468 * @param env: The environment that the JSVM-API call is invoked under.
469 * @param scope: The environment scope to be closed.
470 * @return Returns JSVM_OK if the API succeeded.
476 * @brief This function retrieves the VM instance of the given environment.
478 * @param env: The environment that the JSVM-API call is invoked under.
479 * @param result: The VM instance of the environment.
480 * @return Returns JSVM_OK if the API succeeded.
486 * @brief This function compiles a string of JavaScript code and returns the compiled script.
488 * @param env: The environment that the JSVM-API call is invoked under.
489 * @param script: A JavaScript string containing the script yo be compiled.
490 * @param cachedData: Optional code cache data for the script.
491 * @param cacheDataLength: The length of cachedData array.
492 * @param eagerCompile: Whether to compile the script eagerly.
493 * @param cacheRejected: Whether the code cache rejected by compilation.
494 * @param result: The compiled script.
495 * @return Returns JSVM_OK if the API succeeded.
507 * @brief This function compiles a string of JavaScript code with the source code information
508 * and returns the compiled script.
510 * @param env: The environment that the JSVM-API call is invoked under.
511 * @param script: A JavaScript string containing the script to be compiled.
512 * @param cachedData: Optional code cache data for the script.
513 * @param cacheDataLength: The length of cachedData array.
514 * @param eagerCompile: Whether to compile the script eagerly.
515 * @param cacheRejected: Whether the code cache rejected by compilation.
516 * @param origin: The information of source code.
517 * @param result: The compiled script.
518 * @return Returns JSVM_OK if the API succeeded.
531 * @brief This function compiles a string of JavaScript code with the source code information
532 * and returns the compiled script.
534 * @param env: The environment that the JSVM-API call is invoked under.
535 * @param script: A JavaScript string containing the script to be compiled.
538 * @param result: The compiled script.
539 * @return Returns JSVM_OK if the API succeeded.
549 * @brief This function creates code cache for the compiled script.
551 * @param env: The environment that the JSVM-API call is invoked under.
553 * @param data: The data of the code cache.
554 * @param length: The length of the code cache data.
555 * @return Returns JSVM_OK if the API succeeded.
561 …* @brief This function executes a string of JavaScript code and returns its result with the follow…
562 …* Unlike eval, this function does not allow the script to access the current lexical scope, and th…
563 …* does not allow to access the module scope, meaning that pseudo-globals such as require will not …
564 …* The script can access the global scope. Function and var declarations in the script will be adde…
566 * to the global object.The value of this is global within the script.
568 * @param env: The environment that the API is invoked under.
569 * @param script: A JavaScript string containing the script to execute.
570 * @param result: The value resulting from having executed the script.
576 …* @brief This API associates data with the currently running JSVM environment. data can later be r…
579 * @param env: The environment that the JSVM-API call is invoked under.
580 * @param data: The data item to make available to bindings of this instance.
581 …* @param finalizeCb: The function to call when the environment is being torn down. The function re…
583 * @param finalizeHint: Optional hint to pass to the finalize callback during collection.
584 * @return Returns JSVM_OK if the API succeeded.
590 …* @brief This API retrieves data that was previously associated with the currently running JSVM en…
591 …* via OH_JSVM_SetInstanceData(). If no data is set, the call will succeed and data will be set to …
593 * @param env: The environment that the JSVM-API call is invoked under.
594 …* @param data: The data item that was previously associated with the currently running JSVM enviro…
596 * @return Returns JSVM_OK if the API succeeded.
602 …* @brief This API retrieves a JSVM_ExtendedErrorInfo structure with information about the last err…
605 * @param env: The environment that the JSVM-API call is invoked under.
606 * @param result: The JSVM_ExtendedErrorInfo structure with more information about the error.
607 * @return Returns JSVM_OK if the API succeeded.
613 * @brief This API throws the JavaScript value provided.
615 * @param env: The environment that the API is invoked under.
616 * @param error: The JavaScript value to be thrown.
617 * @return Returns JSVM_OK if the API succeeded.
623 * @brief This API throws a JavaScript Error with the text provided.
625 * @param env: The environment that the API is invoked under.
626 * @param code: Optional error code to be set on the error.
627 * @param msg: C string representing the text to be associated with the error.
628 * @return Returns JSVM_OK if the API succeeded.
634 * @brief This API throws a JavaScript TypeError with the text provided.
636 * @param env: The environment that the API is invoked under.
637 * @param code: Optional error code to be set on the error.
638 * @param msg: C string representing the text to be associated with the error.
639 * @return Returns JSVM_OK if the API succeeded.
645 * @brief This API throws a JavaScript RangeError with the text provided.
647 * @param env: The environment that the API is invoked under.
648 * @param code: Optional error code to be set on the error.
649 * @param msg: C string representing the text to be associated with the error.
650 * @return Returns JSVM_OK if the API succeeded.
656 * @brief This API throws a JavaScript SyntaxError with the text provided.
658 * @param env: The environment that the API is invoked under.
659 * @param code: Optional error code to be set on the error.
660 * @param msg: C string representing the text to be associated with the error.
661 * @return Returns JSVM_OK if the API succeeded.
669 * @param env: The environment that the API is invoked under.
670 * @param value: The JSVM_Value to be checked.
673 * @return Returns JSVM_OK if the API succeeded.
679 * @brief This API returns a JavaScript Error with the text provided.
681 * @param env: The environment that the API is invoked under.
682 …* @param code: Optional JSVM_Value with the string for the error code to be associated with the er…
683 …* @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Err…
684 * @param result: JSVM_Value representing the error created.
685 * @return Returns JSVM_OK if the API succeeded.
691 * @brief This API returns a JavaScript TypeError with the text provided.
693 * @param env: The environment that the API is invoked under.
694 …* @param code: Optional JSVM_Value with the string for the error code to be associated with the er…
695 …* @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Err…
696 * @param result: JSVM_Value representing the error created.
697 * @return Returns JSVM_OK if the API succeeded.
703 * @brief This API returns a JavaScript RangeError with the text provided.
705 * @param env: The environment that the API is invoked under.
706 …* @param code: Optional JSVM_Value with the string for the error code to be associated with the er…
707 …* @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Err…
708 * @param result: JSVM_Value representing the error created.
709 * @return Returns JSVM_OK if the API succeeded.
715 * @brief This API returns a JavaScript SyntaxError with the text provided.
717 * @param env: The environment that the API is invoked under.
718 …* @param code: Optional JSVM_Value with the string for the error code to be associated with the er…
719 …* @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Err…
720 * @param result: JSVM_Value representing the error created.
721 * @return Returns JSVM_OK if the API succeeded.
729 * @param env: The environment that the API is invoked under.
730 * @param result: The exception if one is pending, NULL otherwise.
731 * @return Returns JSVM_OK if the API succeeded.
739 * @param env: The environment that the API is invoked under.
741 * @return Returns JSVM_OK if the API succeeded.
749 * @param env: The environment that the API is invoked under.
750 * @param result: JSVM_Value representing the new scope.
751 * @return Returns JSVM_OK if the API succeeded.
757 * @brief This API closes the scope passed in. Scopes must be closed in the reverse
760 * @param env: The environment that the API is invoked under.
761 * @param scope: JSVM_Value representing the scope to be closed.
762 * @return Returns JSVM_OK if the API succeeded.
768 * @brief This API opens a new scope from which one object can be promoted to the outer scope.
770 * @param env: The environment that the API is invoked under.
771 * @param result: JSVM_Value representing the new scope.
772 * @return Returns JSVM_OK if the API succeeded.
778 * @brief This API closes the scope passed in. Scopes must be closed in the reverse order
781 * @param env: The environment that the API is invoked under.
782 * @param scope: JSVM_Value representing the scope to be closed.
783 * @return Returns JSVM_OK if the API succeeded.
789 * @brief This API promotes the handle to the JavaScript object so that it is valid for the lifetime
790 * of the outer scope. It can only be called once per scope. If it is called more than once an error
793 * @param env: The environment that the API is invoked under.
794 * @param scope: JSVM_Value representing the current scope.
795 * @param escapee: JSVM_Value representing the JavaScript Object to be escaped.
796 * @param result: JSVM_Value representing the handle to the escaped Object in the outer scope.
797 * @return Returns JSVM_OK if the API succeeded.
806 …* @brief This API creates a new reference with the specified reference count to the value passed i…
808 * @param env: The environment that the API is invoked under.
809 * @param value: The JSVM_Value for which a reference is being created.
810 * @param initialRefcount: Initial reference count for the new reference.
811 * @param result: JSVM_Ref pointing to the new reference.
812 * @return Returns JSVM_OK if the API succeeded.
821 * @brief This API creates a new reference with the specified reference count to the data passed in.
823 * @param env The environment that the API is invoked under.
824 * @param value The JSVM_Data for which a reference is being created.
825 * @param initialRefcount Initial reference count for the new reference.
826 * @param result JSVM_Ref pointing to the new reference.
828 * {@link JSVM_OK } if the function executed successfully.\n
829 …* {@link JSVM_INVALID_ARG } if any parameter is null or the value of initialRefcount is 0.…
838 * @brief his API deletes the reference passed in.
840 * @param env: The environment that the API is invoked under.
842 * @return Returns JSVM_OK if the API succeeded.
848 * @brief his API increments the reference count for the reference passed in and
849 * returns the resulting reference count.
851 * @param env: The environment that the API is invoked under.
852 * @param ref: JSVM_Ref for which the reference count will be incremented.
853 * @param result: The new reference count.
854 * @return Returns JSVM_OK if the API succeeded.
860 * @brief This API decrements the reference count for the reference passed in and
861 * returns the resulting reference count.
863 * @param env: The environment that the API is invoked under.
864 * @param ref: JSVM_Ref for which the reference count will be decremented.
865 * @param result: The new reference count.
866 * @return Returns JSVM_OK if the API succeeded.
872 * @brief If still valid, this API returns the JSVM_Value representing the
873 * JavaScript value associated with the JSVM_Ref. Otherwise, result will be NULL.
875 * @param env: The environment that the API is invoked under.
876 * @param ref: The JSVM_Ref for which the corresponding value is being requested.
877 * @param result: The JSVM_Value referenced by the JSVM_Ref.
878 * @return Returns JSVM_OK if the API succeeded.
884 * @brief If still valid, this API returns the JSVM_Data representing the
885 * JavaScript data associated with the JSVM_Ref. Otherwise, result will be NULL.
887 * @param env The environment that the API is invoked under.
888 * @param ref The JSVM_Ref for which the corresponding value is being requested.
889 * @param result The JSVM_Data referenced by the JSVM_Ref.
891 * {@link JSVM_OK } if the function executed successfully.\n
892 …* {@link JSVM_INVALID_ARG } if any parameter is null or the ref is not a reference to JSVM…
901 * @param env: The environment that the API is invoked under.
903 * @return Returns JSVM_OK if the API succeeded.
909 …* @brief This API returns a JSVM-API value corresponding to a JavaScript Array type. The Array's l…
910 …* is set to the passed-in length parameter. However, the underlying buffer is not guaranteed to be…
911 * by the VM when the array is created. That behavior is left to the underlying VM implementation.
913 * @param env: The environment that the API is invoked under.
914 * @param length: The initial length of the Array.
916 * @return Returns JSVM_OK if the API succeeded.
924 …* The ArrayBuffer allocated will have an underlying byte buffer whose size is determined by the le…
925 …* that's passed in. The underlying buffer is optionally returned back to the caller in case the ca…
926 …* directly manipulate the buffer. This buffer can only be written to directly from native code. To…
929 * @param env: The environment that the API is invoked under.
930 * @param byteLength: The length in bytes of the array buffer to create.
931 …* @param data: Pointer to the underlying byte buffer of the ArrayBuffer.data can optionally be ign…
933 * @return Returns JSVM_OK if the API succeeded.
939 * @brief This API allocate the memory of array buffer backing store.
942 * @param initialized: initialization status of the backing store memory.
943 * @param data: pointer that recieve the backing store memory pointer.
955 * @brief This API release the memory of an array buffer backing store.
957 * @param data: pointer to the backing store memory.
966 * @brief This API create an array buffer using the backing store data.
968 * @param env: The environment that the API is invoked under.
969 * @param data: pointer to the backing store memory.
971 * @param offset: start position of the array buffer in the backing store memory.
972 * @param arrayBufferSize: size of the array buffer.
973 * @param result: pointer that recieve the array buffer.
976 * Returns {@link JSVM_INVALID_ARG } if any of the following condition reached:\n
993 * @param env: The environment that the API is invoked under.
996 * @return Returns JSVM_OK if the API succeeded.
1004 …* The API adds a JSVM_Finalize callback which will be called when the JavaScript object just creat…
1005 …* collected.The created value is not an object, and therefore does not support additional properti…
1008 * @param env: The environment that the API is invoked under.
1009 * @param data: Raw pointer to the external data.
1010 …* @param finalizeCb: Optional callback to call when the external value is being collected. JSVM_Fi…
1012 * @param finalizeHint: Optional hint to pass to the finalize callback during collection.
1014 * @return Returns JSVM_OK if the API succeeded.
1024 …* @brief This API allocates a default JavaScript Object. It is the equivalent of doing new Object(…
1026 * @param env: The environment that the API is invoked under.
1028 * @return Returns JSVM_OK if the API succeeded.
1036 * @param env: The environment that the API is invoked under.
1037 …* @param description: Optional JSVM_Value which refers to a JavaScript string to be set as the des…
1038 * for the symbol.
1040 * @return Returns JSVM_OK if the API succeeded.
1046 …* @brief This API searches in the global registry for an existing symbol with the given descriptio…
1047 …* If the symbol already exists it will be returned, otherwise a new symbol will be created in the …
1049 * @param env: The environment that the API is invoked under.
1050 … @param utf8description: UTF-8 C string representing the text to be used as the description for th…
1051 …* @param length: The length of the description string in bytes, or JSVM_AUTO_LENGTH if it is null-…
1053 * @return Returns JSVM_OK if the API succeeded.
1061 * @param env The environment that the API is invoked under.
1062 …* @param description Optional JSVM_Value which refers to a JavaScript string to be set as the desc…
1063 * for the private key.
1066 * {@link JSVM_OK } if the function executed successfully.\n
1068 * {@link JSVM_STRING_EXPECTED } if the description is not a string.\n
1074 * @brief This API set a private property on the Object passed in.
1076 * @param env The environment that the API is invoked under.
1077 * @param object The object on which to set the private property.
1078 * @param key The private key of the property.
1079 * @param value The private property value.
1081 * {@link JSVM_OK } if the function executed successfully.\n
1082 …* {@link JSVM_INVALID_ARG } if any of the arguments is NULL or the key is not a private ke…
1084 …* {@link JSVM_GENERIC_FAILURE } if failed to set the private key but no exception is pendi…
1091 * @brief This API gets the requested private property from the Object passed in.
1093 * @param env The environment that the API is invoked under.
1094 * @param object The object from which to retrieve the private property.
1095 * @param key The private key of the property.
1096 * @param result The value of the private property.
1098 * {@link JSVM_OK } if the function executed successfully.\n
1099 …* {@link JSVM_INVALID_ARG } if any of the arguments is NULL or the key is not a private ke…
1101 …* {@link JSVM_GENERIC_FAILURE } if failed to get the private key but no exception is pendi…
1108 * @brief This API attempts to delete the property of the private key from object.
1110 * @param env The environment that the API is invoked under.
1111 * @param object The object to query.
1112 * @param key The private key of the property to delete.
1114 * {@link JSVM_OK } if the function executed successfully.\n
1115 …* {@link JSVM_INVALID_ARG } if any of the arguments is NULL or the key is not a private ke…
1117 …* {@link JSVM_GENERIC_FAILURE } if failed to delete the private key but no exception is pe…
1125 * objects provide an array-like view over an underlying data buffer where each element has the
1127 * be <= the size in bytes of the array passed in. If not, a RangeError exception is raised.
1129 * @param env: The environment that the API is invoked under.
1130 * @param type: Scalar datatype of the elements within the TypedArray.
1131 * @param length: Number of elements in the TypedArray.
1132 * @param arraybuffer: ArrayBuffer underlying the typed array.
1133 …* @param byteOffset: The byte offset within the ArrayBuffer from which to start projecting the Typ…
1135 * @return Returns JSVM_OK if the API succeeded.
1148 * of different size and type in the ArrayBuffer.It is required that byte_length + byte_offset is
1149 * less than or equal to the size in bytes of the array passed in. If not, a RangeError exception
1152 * @param env: The environment that the API is invoked under.
1153 * @param length: Number of elements in the DataView.
1154 * @param arraybuffer: ArrayBuffer underlying the DataView.
1155 …* @param byteOffset: The byte offset within the ArrayBuffer from which to start projecting the Dat…
1157 * @return Returns JSVM_OK if the API succeeded.
1167 * @brief This API is used to convert from the C int32_t type to the JavaScript number type.
1169 * @param env: The environment that the API is invoked under.
1172 * @return Returns JSVM_OK if the API succeeded.
1178 * @brief This API is used to convert from the C uint32_t type to the JavaScript number type.
1180 * @param env: The environment that the API is invoked under.
1183 * @return Returns JSVM_OK if the API succeeded.
1189 * @brief This API is used to convert from the C int64_t type to the JavaScript number type.
1191 * @param env: The environment that the API is invoked under.
1194 * @return Returns JSVM_OK if the API succeeded.
1200 * @brief This API is used to convert from the C double type to the JavaScript number type.
1202 * @param env: The environment that the API is invoked under.
1205 * @return Returns JSVM_OK if the API succeeded.
1211 * @brief This API converts the C int64_t type to the JavaScript BigInt type.
1213 * @param env: The environment that the API is invoked under.
1216 * @return Returns JSVM_OK if the API succeeded.
1222 * @brief This API converts the C uint64_t type to the JavaScript BigInt type.
1224 * @param env: The environment that the API is invoked under.
1227 * @return Returns JSVM_OK if the API succeeded.
1234 * The resulting BigInt is calculated as: (–1)sign_bit (words[0] × (264)0 + words[1] × (264)1 + …)
1236 * @param env: The environment that the API is invoked under.
1237 * @param signBit: Determines if the resulting BigInt will be positive or negative.
1238 * @param wordCount: The length of the words array.
1241 * @return Returns JSVM_OK if the API succeeded.
1252 * string. The native string is copied.
1254 * @param env: The environment that the API is invoked under.
1256 * @param length: The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated.
1258 * @return Returns JSVM_OK if the API succeeded.
1265 * string. The native string is copied.
1267 * @param env: The environment that the API is invoked under.
1269 * @param length: The length of the string in two-byte code units, or JSVM_AUTO_LENGTH
1272 * @return Returns JSVM_OK if the API succeeded.
1279 * string. The native string is copied.
1281 * @param env: The environment that the API is invoked under.
1283 * @param length: The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated.
1285 * @return Returns JSVM_OK if the API succeeded.
1291 * string. The native string is copied when failed to create external string.
1293 * @param env The environment that the API is invoked under.
1295 * @param length The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated.
1296 * @param finalizeCallback Optional callback to call when the external value is being collected.
1298 * @param finalizeHint Optional hint to pass to the finalize callback during collection.
1300 * @param copied flag indicate whether the external string is successfully created,
1303 * Returns {@link JSVM_OK } if the function executed successfully.\n
1317 * string. The native string is copied when failed to create external string.
1319 * @param env The environment that the API is invoked under.
1321 * @param length The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated.
1322 * @param finalizeCallback Optional callback to call when the external value is being collected.
1324 * @param finalizeHint Optional hint to pass to the finalize callback during collection.
1326 * @param copied flag indicate whether the external string is successfully created,
1329 * Returns {@link JSVM_OK } if the function executed successfully.\n
1343 * @brief This API returns the length of an array.
1345 * @param env: The environment that the API is invoked under.
1346 * @param value: JSVM_Value representing the JavaScript Array whose length is being queried.
1347 * @param result: uint32 representing length of the array.
1348 * @return Returns JSVM_OK if the API succeeded.
1354 * @brief This API is used to retrieve the underlying data buffer of an ArrayBuffer and its length.
1356 * @param env: The environment that the API is invoked under.
1357 * @param arraybuffer: JSVM_Value representing the ArrayBuffer being queried.
1358 * @param data: The underlying data buffer of the ArrayBuffer. If byte_length is 0, this may be NULL
1360 * @param byteLength: Length in bytes of the underlying data buffer.
1361 * @return Returns JSVM_OK if the API succeeded.
1370 * @brief This API returns the length of an array.
1372 * @param env: The environment that the API is invoked under.
1374 …* the equivalent of Object.getPrototypeOf (which is not the same as the function's prototype prope…
1375 * @param result: JSVM_Value representing prototype of the given object.
1376 * @return Returns JSVM_OK if the API succeeded.
1384 * @param env: The environment that the API is invoked under.
1385 * @param typedarray: JSVM_Value representing the TypedArray whose properties to query.
1386 * @param type: Scalar datatype of the elements within the TypedArray.
1387 * @param length: The number of elements in the TypedArray.
1388 …* @param data: The data buffer underlying the TypedArray adjusted by the byte_offset value so that…
1389 …* points to the first element in the TypedArray. If the length of the array is 0, this may be NULL…
1391 * @param arraybuffer: The ArrayBuffer underlying the TypedArray.
1392 …* @param byteOffset: The byte offset within the underlying native array at which the first element…
1393 …* the arrays is located. The value for the data parameter has already been adjusted so that data p…
1394 …* to the first element in the array. Therefore, the first byte of the native array would be at dat…
1395 * @return Returns JSVM_OK if the API succeeded.
1407 * @brief Any of the out parameters may be NULL if that property is unneeded.
1410 * @param env: The environment that the API is invoked under.
1411 * @param dataview: JSVM_Value representing the DataView whose properties to query.
1412 * @param bytelength: Number of bytes in the DataView.
1413 * @param data: The data buffer underlying the DataView.
1415 * @param arraybuffer: ArrayBuffer underlying the DataView.
1416 …* @param byteOffset: The byte offset within the data buffer from which to start projecting the Dat…
1417 * @return Returns JSVM_OK if the API succeeded.
1428 * @brief Returns JSVM_OK if the API succeeded. If a non-date JSVM_Value is
1429 * passed in it returns JSVM_date_expected.This API returns the C double
1430 * primitive of time value for the given JavaScript Date.
1432 * @param env: The environment that the API is invoked under.
1435 * since midnight at the beginning of 01 January, 1970 UTC.
1436 * @return Returns JSVM_OK if the API succeeded.
1442 * @brief This API returns the C boolean primitive equivalent of the given JavaScript Boolean.
1444 * @param env: The environment that the API is invoked under.
1446 * @param result: C boolean primitive equivalent of the given JavaScript Boolean.
1447 * @return Returns JSVM_OK if the API succeeded.
1454 * @brief This API returns the C double primitive equivalent of the given JavaScript number.
1456 * @param env: The environment that the API is invoked under.
1458 * @param result: C double primitive equivalent of the given JavaScript number.
1459 * @return Returns JSVM_OK if the API succeeded.
1466 * @brief This API returns the C int64_t primitive equivalent of the given JavaScript BigInt.
1467 * If needed it will truncate the value, setting lossless to false.
1469 * @param env: The environment that the API is invoked under.
1471 * @param result: C int64_t primitive equivalent of the given JavaScript BigInt.
1472 * @param lossless: Indicates whether the BigInt value was converted losslessly.
1473 …* @return Returns JSVM_OK if the API succeeded. If a non-BigInt is passed in it returns JSVM_BIGIN…
1479 * @brief This API returns the C uint64_t primitive equivalent of the given JavaScript BigInt.
1480 * If needed it will truncate the value, setting lossless to false.
1482 * @param env: The environment that the API is invoked under.
1484 * @param result: C uint64_t primitive equivalent of the given JavaScript BigInt.
1485 * @param lossless: Indicates whether the BigInt value was converted losslessly.
1486 …* @return Returns JSVM_OK if the API succeeded. If a non-BigInt is passed in it returns JSVM_BIGIN…
1492 …This API converts a single BigInt value into a sign bit, 64-bit little-endian array, and the number
1493 …* of elements in the array. signBit and words may be both set to NULL, in order to get only wordCo…
1495 * @param env: The environment that the API is invoked under.
1497 * @param signBit: Integer representing if the JavaScript BigInt is positive or negative.
1498 …* @param wordCount: Must be initialized to the length of the words array. Upon return, it will be …
1499 * the actual number of words that would be needed to store this BigInt.
1501 * @return Returns JSVM_OK if the API succeeded.
1511 …* @brief This API retrieves the external data pointer that was previously passed to OH_JSVM_Create…
1513 * @param env: The environment that the API is invoked under.
1515 * @param result: Pointer to the data wrapped by the JavaScript external value.
1516 …* @return Returns JSVM_OK if the API succeeded. If a non-external JSVM_Value is passed in it retur…
1522 * @brief This API returns the C int32 primitive equivalent of the given JavaScript number.
1524 * @param env: The environment that the API is invoked under.
1526 * @param result: C int32 primitive equivalent of the given JavaScript number.
1527 …* @return Returns JSVM_OK if the API succeeded. If a non-number JSVM_Value is passed in JSVM_NUMBE…
1533 * @brief This API returns the C int64 primitive equivalent of the given JavaScript number.
1535 * @param env: The environment that the API is invoked under.
1537 * @param result: C int64 primitive equivalent of the given JavaScript number.
1538 …* @return Returns JSVM_OK if the API succeeded. If a non-number JSVM_Value is passed in JSVM_NUMBE…
1544 * @brief This API returns the ISO-8859-1-encoded string corresponding the value passed in.
1546 * @param env: The environment that the API is invoked under.
1548 * @param buf: Buffer to write the ISO-8859-1-encoded string into. If NULL is passed in, the
1549 * length of the string in bytes and excluding the null terminator is returned in result.
1550 …* @param bufsize: Size of the destination buffer. When this value is insufficient, the returned st…
1552 * @param result: Number of bytes copied into the buffer, excluding the null terminator.
1553 …* @return Returns JSVM_OK if the API succeeded. If a non-number JSVM_Value is passed in JSVM_NUMBE…
1563 * @brief This API returns the UTF8-encoded string corresponding the value passed in.
1565 * @param env: The environment that the API is invoked under.
1567 * @param buf: Buffer to write the UTF8-encoded string into. If NULL is passed in, the length
1568 * of the string in bytes and excluding the null terminator is returned in result.
1569 * @param bufsize: Size of the destination buffer. When this value is insufficient, the returned
1571 * @param result: Number of bytes copied into the buffer, excluding the null terminator.
1572 …* @return Returns JSVM_OK if the API succeeded. If a non-number JSVM_Value is passed in JSVM_NUMBE…
1582 * @brief This API returns the UTF16-encoded string corresponding the value passed in.
1584 * @param env: The environment that the API is invoked under.
1586 * @param buf: Buffer to write the UTF16-LE-encoded string into. If NULL is passed in,
1587 * the length of the string in 2-byte code units and excluding the null terminator is returned.
1588 * @param bufsize: Size of the destination buffer. When this value is insufficient,
1589 * the returned string is truncated and null-terminated.
1590 * @param result: Number of 2-byte code units copied into the buffer, excluding the null terminator.
1591 …* @return Returns JSVM_OK if the API succeeded. If a non-number JSVM_Value is passed in JSVM_NUMBE…
1601 * @brief This API returns the C primitive equivalent of the given JSVM_Value as a uint32_t.
1603 * @param env: The environment that the API is invoked under.
1605 * @param result: C primitive equivalent of the given JSVM_Value as a uint32_t.
1606 * @return Returns JSVM_OK if the API succeeded.
1613 …* @brief This API is used to return the JavaScript singleton object that is used to represent the …
1615 * @param env: The environment that the API is invoked under.
1616 * @param value: The value of the boolean to retrieve.
1618 * @return Returns JSVM_OK if the API succeeded.
1624 * @brief This API returns the global object.
1626 * @param env: The environment that the API is invoked under.
1628 * @return Returns JSVM_OK if the API succeeded.
1634 * @brief This API returns the null object.
1636 * @param env: The environment that the API is invoked under.
1638 * @return Returns JSVM_OK if the API succeeded.
1644 * @brief This API returns the Undefined object.
1646 * @param env: The environment that the API is invoked under.
1648 * @return Returns JSVM_OK if the API succeeded.
1654 * @brief This API implements the abstract operation ToBoolean()
1656 * @param env: The environment that the API is invoked under.
1657 * @param value: The JavaScript value to coerce.
1658 * @param result: JSVM_Value representing the coerced JavaScript Boolean.
1659 * @return Returns JSVM_OK if the API succeeded.
1665 * @brief This API implements the abstract operation ToNumber() as defined. This
1666 * function potentially runs JS code if the passed-in value is an object.
1668 * @param env: The environment that the API is invoked under.
1669 * @param value: The JavaScript value to coerce.
1670 * @param result: JSVM_Value representing the coerced JavaScript number.
1671 * @return Returns JSVM_OK if the API succeeded.
1677 * @brief This API implements the abstract operation ToObject().
1679 * @param env: The environment that the API is invoked under.
1680 * @param value: The JavaScript value to coerce.
1681 * @param result: JSVM_Value representing the coerced JavaScript Object.
1682 * @return Returns JSVM_OK if the API succeeded.
1688 * @brief This API implements the abstract operation ToString().This
1689 * function potentially runs JS code if the passed-in value is an object.
1691 * @param env: The environment that the API is invoked under.
1692 * @param value: The JavaScript value to coerce.
1693 * @param result: JSVM_Value representing the coerced JavaScript string.
1694 * @return Returns JSVM_OK if the API succeeded.
1700 * @brief This API represents behavior similar to invoking the typeof Operator
1701 * on the object as defined. However, there are some differences:It has support
1706 * @param env: The environment that the API is invoked under.
1707 * @param value: The JavaScript value whose type to query.
1708 * @param result: The type of the JavaScript value.
1709 * @return Returns JSVM_OK if the API succeeded.
1715 * @brief This API represents invoking the instanceof Operator on the object.
1717 * @param env: The environment that the API is invoked under.
1718 * @param object: The JavaScript value to check.
1719 * @param constructor: The JavaScript function object of the constructor function
1722 * @return Returns JSVM_OK if the API succeeded.
1730 * @param vm The environment that the API is invoked under.
1731 * @param triggerTime The timing of GC callback trigger.
1732 * @param handler When Trigger gc, the callback function will be called.
1733 * @param gcType The type of gc.
1734 * @param userData The native pointer data.
1736 * {@link JSVM_OK } if the function executed successfully.\n
1737 …* {@link JSVM_INVALID_ARG } if the vm or the handler is NULL or the handler has been added…
1750 * @param vm The environment that the API is invoked under.
1751 * @param triggerTime The timing of GC callback trigger.
1752 * @param handler When Trigger gc, the callback function will be called.
1753 * @param userData The native pointer data.
1755 * {@link JSVM_OK } if the function executed successfully.\n
1756 …* {@link JSVM_INVALID_ARG } if the vm or the handler is NULL, or the handler has been remo…
1757 * or the handler has never been added.\n
1768 * only the last time takes effect. When handler is null, the previous setting is canceled.
1770 * @param vm The environment that the API is invoked under.
1771 * @param handler The handler for OOM Error.
1773 * {@link JSVM_OK } if the function executed successfully.\n
1781 * @brief This API is used to enable/disable the given debug option for a certain JSVM_Env.
1783 * @param env The environment that the API is invoked under.
1784 * @param debugOption The debug option to be changed.
1785 * @param isEnabled Whether to enable or disable the debug option.
1787 * {@link JSVM_OK } if the function executed successfully.\n
1796 * only the last time takes effect. When handler is null, the previous setting is canceled.
1798 * @param vm The environment that the API is invoked under.
1799 * @param handler The handler for Fatal Error.
1801 * {@link JSVM_OK } if the function executed successfully.\n
1810 * only the last time takes effect. When handler is null, the previous setting is canceled.
1812 * @param vm The environment that the API is invoked under.
1813 * @param handler The handler for Promise Reject.
1815 * {@link JSVM_OK } if the function executed successfully.\n
1823 * @brief This API represents invoking the IsArray operation on the object
1825 * @param env: The environment that the API is invoked under.
1826 * @param value: The JavaScript value to check.
1827 * @param result: Whether the given object is an array.
1828 * @return Returns JSVM_OK if the API succeeded.
1834 * @brief This API checks if the Object passed in is an array buffer.
1836 * @param env: The environment that the API is invoked under.
1837 * @param value: The JavaScript value to check.
1838 * @param result: Whether the given object is an ArrayBuffer.
1839 * @return Returns JSVM_OK if the API succeeded.
1845 * @brief This API checks if the Object passed in is a date.
1847 * @param env: The environment that the API is invoked under.
1848 * @param value: The JavaScript value to check.
1849 * @param result: Whether the given JSVM_Value represents a JavaScript Date object.
1850 * @return Returns JSVM_OK if the API succeeded.
1856 * @brief This API checks if the Object passed in is a typed array.
1858 * @param env: The environment that the API is invoked under.
1859 * @param value: The JavaScript value to check.
1860 * @param result: Whether the given JSVM_Value represents a TypedArray.
1861 * @return Returns JSVM_OK if the API succeeded.
1867 * @brief This API checks if the Object passed in is a DataView.
1869 * @param env: The environment that the API is invoked under.
1870 * @param value: The JavaScript value to check.
1871 * @param result: Whether the given JSVM_Value represents a DataView.
1872 * @return Returns JSVM_OK if the API succeeded.
1878 * @brief This API represents the invocation of the Strict Equality algorithm.
1879 * Returns true only when both the type and value are equal.
1881 * @param env: The environment that the API is invoked under.
1882 * @param lhs: The JavaScript value to check.
1883 * @param rhs: The JavaScript value to check against.
1884 * @param result: Whether the two JSVM_Value objects are equal.
1885 * @return Returns JSVM_OK if the API succeeded.
1891 * @brief This API represents the invocation of the Relaxed Equality algorithm.
1892 * Returns true as long as the values are equal, regardless of type.
1894 * @param env: The environment that the API is invoked under.
1895 * @param lhs: The JavaScript value to check.
1896 * @param rhs: The JavaScript value to check against.
1897 * @param result: Whether the two JSVM_Value objects are relaxed equal.
1898 * @return Returns JSVM_OK if the API succeeded.
1904 * @brief This API represents the invocation of the ArrayBuffer detach operation.
1906 * @param env: The environment that the API is invoked under.
1907 * @param arraybuffer: The JavaScript ArrayBuffer to be detached.
1908 * @return Returns JSVM_OK if the API succeeded.If a non-detachable ArrayBuffer
1915 * @brief This API represents the invocation of the ArrayBuffer IsDetachedBuffer operation.
1917 * @param env: The environment that the API is invoked under.
1918 * @param value: The JavaScript ArrayBuffer to be checked.
1919 * @param result: Whether the arraybuffer is detached.
1920 * @return Returns JSVM_OK if the API succeeded.
1926 * @brief This API returns the names of the enumerable properties of object as an array of
1927 * strings. The properties of object whose key is a symbol will not be included.
1929 * @param env: The environment that the API is invoked under.
1930 * @param object: The object from which to retrieve the properties.
1932 * the property names of the object. The API can be used to iterate over result using
1934 * @return Returns JSVM_OK if the API succeeded.
1940 * @brief This API returns an array containing the names of the available properties
1943 * @param env: The environment that the API is invoked under.
1944 * @param object: The object from which to retrieve the properties.
1949 * that represent the property names of the object. OH_JSVM_GetArrayLength and
1951 * @return Returns JSVM_OK if the API succeeded.
1962 * @brief This API set a property on the Object passed in.
1964 * @param env: The environment that the API is invoked under.
1965 * @param object: The object on which to set the property.
1966 * @param key: The name of the property to set.
1967 * @param value: The property value.
1968 * @return Returns JSVM_OK if the API succeeded.
1974 * @brief This API gets the requested property from the Object passed in.
1976 * @param env: The environment that the API is invoked under.
1977 * @param object: The object from which to retrieve the property.
1978 * @param key: The name of the property to retrieve.
1979 * @param result: The value of the property.
1980 * @return Returns JSVM_OK if the API succeeded.
1986 * @brief This API checks if the Object passed in has the named property.
1988 * @param env: The environment that the API is invoked under.
1989 * @param object: The object to query.
1990 * @param key: The name of the property whose existence to check.
1991 * @param result: Whether the property exists on the object or not.
1992 * @return Returns JSVM_OK if the API succeeded.
1998 * @brief This API attempts to delete the key own property from object.
2000 * @param env: The environment that the API is invoked under.
2001 * @param object: The object to query.
2002 * @param key: The name of the property to delete.
2003 * @param result: Whether the property deletion succeeded or not. result
2005 * @return Returns JSVM_OK if the API succeeded.
2011 * @brief This API checks if the Object passed in has the named own property.
2015 * @param env: The environment that the API is invoked under.
2016 * @param object: The object to query.
2017 * @param key: The name of the own property whose existence to check.
2018 * @param result: Whether the own property exists on the object or not.
2019 * @return Returns JSVM_OK if the API succeeded.
2026 * a JSVM_Value created from the string passed in as utf8Name.
2028 * @param env: The environment that the API is invoked under.
2029 * @param object: The object on which to set the property.
2030 * @param utf8Name: The name of the property to set.
2031 * @param value: The property value.
2032 * @return Returns JSVM_OK if the API succeeded.
2042 * a JSVM_Value created from the string passed in as utf8Name.
2044 * @param env: The environment that the API is invoked under.
2045 * @param object: The object from which to retrieve the property.
2046 * @param utf8Name: The name of the property to get.
2047 * @param result: The value of the property.
2048 * @return Returns JSVM_OK if the API succeeded.
2058 * a JSVM_Value created from the string passed in as utf8Name.
2060 * @param env: The environment that the API is invoked under.
2061 * @param object: The object to query.
2062 * @param utf8Name: The name of the property whose existence to check.
2063 * @param result: Whether the property exists on the object or not.
2064 * @return Returns JSVM_OK if the API succeeded.
2070 * @brief This API sets an element on the Object passed in.
2072 * @param env: The environment that the API is invoked under.
2073 * @param object: The object from which to set the properties.
2074 * @param index: The index of the property to set.
2075 * @param value: The property value.
2076 * @return Returns JSVM_OK if the API succeeded.
2082 * @brief This API gets the element at the requested index.
2084 * @param env: The environment that the API is invoked under.
2085 * @param object: The object from which to retrieve the property.
2086 * @param index: The index of the property to get.
2087 * @param result: The value of the property.
2088 * @return Returns JSVM_OK if the API succeeded.
2094 * @brief This API returns if the Object passed in has an element
2095 * at the requested index.
2097 * @param env: The environment that the API is invoked under.
2098 * @param object: The object to query.
2099 * @param index: The index of the property whose existence to check.
2100 * @param result: Whether the property exists on the object or not.
2101 * @return Returns JSVM_OK if the API succeeded.
2107 * @brief This API attempts to delete the specified index from object.
2109 * @param env: The environment that the API is invoked under.
2110 * @param object: The object to query.
2111 * @param index: The index of the property to delete.
2112 * @param result: Whether the element deletion succeeded or not. result
2114 * @return Returns JSVM_OK if the API succeeded.
2120 * @brief This method allows the efficient definition of multiple properties
2121 * on a given object. The properties are defined using property descriptors.
2122 * Given an array of such property descriptors, this API will set the properties
2123 * on the object one at a time, as defined by DefineOwnProperty().
2125 * @param env: The environment that the API is invoked under.
2126 * @param object: The object from which to retrieve the properties.
2127 * @param propertyCount: The number of elements in the properties array.
2128 * @param properties: The array of property descriptors.
2129 * @return Returns JSVM_OK if the API succeeded.
2140 * changing the enumerability, configurability, or writability of existing
2141 * properties, and prevents the values of existing properties from being changed.
2142 * It also prevents the object's prototype from being changed.
2144 * @param env: The environment that the API is invoked under.
2145 * @param object: The object to freeze.
2146 * @return Returns JSVM_OK if the API succeeded.
2155 * @param env: The environment that the API is invoked under.
2156 * @param object: The object to seal.
2157 * @return Returns JSVM_OK if the API succeeded.
2164 * a native add-on. This is the primary mechanism of calling back from the
2167 * @param env: The environment that the API is invoked under.
2168 * @param recv: The this value passed to the called function.
2169 * @param func: JSVM_Value representing the JavaScript function to be invoked.
2170 * @param argc: The count of elements in the argv array.
2171 …* @param argv: Array of JSVM_values representing JavaScript values passed in as arguments to the f…
2172 * @param result: JSVM_Value representing the JavaScript object returned.
2173 * @return Returns JSVM_OK if the API succeeded.
2185 * code. This is the primary mechanism to allow calling into the add-on's native
2186 * code from JavaScript.The newly created function is not automatically visible
2188 * object that is visible to JavaScript, in order for the function to be accessible
2191 * @param env: The environment that the API is invoked under.
2192 * @param utf8Name: Optional name of the function encoded as UTF8. This is visible
2193 * within JavaScript as the new function object's name property.
2194 * @param length: The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it
2196 * @param cb: The native function which should be called when this function
2198 * @param result: JSVM_Value representing the JavaScript function object for the newly
2200 * @return Returns JSVM_OK if the API succeeded.
2211 * the call like the arguments and the this pointer from a given callback info.
2213 * @param env: The environment that the API is invoked under.
2214 * @param cbinfo: The callback info passed into the callback function.
2215 * @param argc: Specifies the length of the provided argv array and receives the
2217 * @param argv: C array of JSVM_values to which the arguments will be copied. If
2218 * there are more arguments than the provided count, only the requested number of
2219 * arguments are copied. If there are fewer arguments provided than claimed, the
2222 * @param thisArg: Receives the JavaScript this argument for the call. thisArg
2224 * @param data: Receives the data pointer for the callback. data can optionally
2226 * @return Returns JSVM_OK if the API succeeded.
2237 * @brief This API returns the new.target of the constructor call. If the
2238 * current callback is not a constructor call, the result is NULL.
2240 * @param env: The environment that the API is invoked under.
2241 * @param cbinfo: The callback info passed into the callback function.
2242 * @param result: The new.target of the constructor call.
2243 * @return Returns JSVM_OK if the API succeeded.
2250 * a given JSVM_Value that represents the constructor for the object.
2252 * @param env: The environment that the API is invoked under.
2253 …* @param constructor: JSVM_Value representing the JavaScript function to be invoked as a construct…
2254 * @param argc: The count of elements in the argv array.
2255 * @param argv: Array of JavaScript values as JSVM_Value representing the arguments to
2256 * the constructor. If argc is zero this parameter may be omitted by passing in NULL.
2257 * @param result: JSVM_Value representing the JavaScript object returned, which
2258 * in this case is the constructed object.
2259 * @return Returns JSVM_OK if the API succeeded.
2269 * @brief When wrapping a C++ class, the C++ constructor callback passed via constructor
2270 * should be a static method on the class that calls the actual class constructor, then
2271 * wraps the new C++ instance in a JavaScript object, and returns the wrapper object.
2273 * @param env: The environment that the API is invoked under.
2274 * @param utf8name: Name of the JavaScript constructor function. For clarity, it is
2275 * recommended to use the C++ class name when wrapping a C++ class.
2276 * @param length: The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it
2278 …* @param constructor: Struct include callback function that handles constructing instances of the …
2279 * When wrapping a C++ class, this method must be a static member with the JSVM_Callback.callback
2281 * Include Optional data to be passed to the constructor callback as the data
2282 * property of the callback info. JSVM_Callback provides more details.
2283 * @param propertyCount: Number of items in the properties array argument.
2285 * properties, accessors, and methods on the class See JSVM_PropertyDescriptor.
2286 * @param result: A JSVM_Value representing the constructor function for the class.
2287 * @return Returns JSVM_OK if the API succeeded.
2299 * @brief Wraps a native instance in a JavaScript object. The native instance can
2302 * @param env: The environment that the API is invoked under.
2303 * @param jsObject: The JavaScript object that will be the wrapper for the native object.
2304 * @param nativeObject: The native instance that will be wrapped in the JavaScript object.
2305 * @param finalizeCb: Optional native callback that can be used to free the native instance
2306 * when the JavaScript object has been garbage-collected.
2307 * @param finalizeHint: Optional contextual hint that is passed to the finalize callback.
2308 * properties, accessors, and methods on the class See JSVM_PropertyDescriptor.
2309 * @param result: Optional reference to the wrapped object.
2310 * @return Returns JSVM_OK if the API succeeded.
2321 * @brief When JavaScript code invokes a method or property accessor on the class, the corresponding
2322 * JSVM_Callback is invoked. If the callback is for an instance method or accessor, then the this
2323 * argument to the callback is the wrapper object; the wrapped C++ instance that is the target of
2324 * the call can be obtained then by calling OH_JSVM_Unwrap() on the wrapper object.
2326 * @param env: The environment that the API is invoked under.
2327 * @param jsObject: The object associated with the native instance.
2328 * @param result: Pointer to the wrapped native instance.
2329 * @return Returns JSVM_OK if the API succeeded.
2335 * @brief Retrieves a native instance that was previously wrapped in the JavaScript object jsObject
2336 …* using OH_JSVM_Wrap() and removes the wrapping. If a finalize callback was associated with the wr…
2337 * it will no longer be called when the JavaScript object becomes garbage-collected.
2339 * @param env: The environment that the API is invoked under.
2340 * @param jsObject: The object associated with the native instance.
2341 * @param result: Pointer to the wrapped native instance.
2342 * @return Returns JSVM_OK if the API succeeded.
2348 * @brief Associates the value of the typeTag pointer with the JavaScript object or external.
2349 * OH_JSVM_CheckObjectTypeTag() can then be used to compare the tag that was attached to the
2350 * object with one owned by the addon to ensure that the object has the right type.
2351 * If the object already has an associated type tag, this API will return JSVM_INVALID_ARG.
2353 * @param env: The environment that the API is invoked under.
2354 * @param value: The JavaScript object or external to be marked.
2355 * @param typeTag: The tag with which the object is to be marked.
2356 * @return Returns JSVM_OK if the API succeeded.
2362 * @brief Compares the pointer given as typeTag with any that can be found on js object.
2366 * @param env: The environment that the API is invoked under.
2367 * @param value: The JavaScript object or external whose type tag to examine.
2368 * @param typeTag: The tag with which to compare any tag found on the object.
2369 …* @param result: Whether the type tag given matched the type tag on the object. false is also retu…
2370 * if no type tag was found on the object.
2371 * @return Returns JSVM_OK if the API succeeded.
2382 * @param env: The environment that the API is invoked under.
2383 * @param jsObject: The JavaScript object to which the native data will be attached.
2385 * @param finalizeCb: Native callback that will be used to free the native data when the
2387 * @param finalizeHint: Optional contextual hint that is passed to the finalize callback.
2388 * @param result: Optional reference to the JavaScript object.
2389 * @return Returns JSVM_OK if the API succeeded.
2400 * @brief This API returns the highest JSVM-API version supported by the JSVM runtime.
2406 * @param env: The environment that the API is invoked under.
2407 * @param result: The highest version of JSVM-API supported.
2408 * @return Returns JSVM_OK if the API succeeded.
2414 * @brief Return information of the VM.
2416 * @param result: The information of the VM.
2417 * @return Returns JSVM_OK if the API succeeded.
2423 * @brief This function gives V8 an indication of the amount of externally
2429 * @param env: The environment that the API is invoked under.
2430 * @param changeInBytes: The change in externally allocated memory that is kept
2432 * @param result: The adjusted value
2433 * @return Returns JSVM_OK if the API succeeded.
2439 * @brief This function notifies the VM that the system is running low on memory
2442 * @param env: The environment that the API is invoked under.
2443 * @param level: The memory pressure level set to the current VM.
2444 * @return Returns JSVM_OK if the API succeeded.
2452 * @param env: The environment that the API is invoked under.
2455 * resp. reject the associated promise.
2456 * @param promise: The JavaScript promise associated with the deferred object.
2457 * @return Returns JSVM_OK if the API succeeded.
2463 * @brief This API resolves a JavaScript promise by way of the deferred object with
2465 * for which the corresponding deferred object is available. This effectively means
2466 * that the promise must have been created using OH_JSVM_CreatePromise() and the deferred
2469 * @param env: The environment that the API is invoked under.
2470 * @param deferred: The deferred object whose associated promise to resolve.
2471 * @param resolution: The value with which to resolve the promise.
2472 * @return Returns JSVM_OK if the API succeeded.
2478 * @brief This API rejects a JavaScript promise by way of the deferred object with
2480 * for which the corresponding deferred object is available. This effectively means
2481 * that the promise must have been created using OH_JSVM_CreatePromise() and the deferred
2484 * @param env: The environment that the API is invoked under.
2485 * @param deferred: The deferred object whose associated promise to resolve.
2486 * @param rejection: The value with which to reject the promise.
2487 * @return Returns JSVM_OK if the API succeeded.
2494 * @param env: The environment that the API is invoked under.
2495 * @param value: The value to examine
2497 * @return Returns JSVM_OK if the API succeeded.
2504 * @param env The environment that the API is invoked under.
2505 * @param promise The promise to be handled.
2506 * @param onFulfilled The function to be invoked if promise is resolved.
2507 * @param onRejected The function to be invoked if promise is rejected.
2510 * {@link JSVM_OK } if the API succeeded. \n
2511 * {@link JSVM_INVALID_ARG } if the arguments are invalid. \n
2512 * {@link JSVM_INVALID_TYPE } if the arguments are invalid Javascript type. \n
2514 * {@link JSVM_GENERIC_FAILURE} if the API failed. \n
2526 * @param env: The environment that the API is invoked under.
2527 * @param jsonString: The string to parse.
2528 * @param result: The parse value if successful.
2529 * @return Returns JSVM_OK if the API succeeded.
2535 * @brief This API stringifies the object and returns it as string if successful.
2536 * @param env: The environment that the API is invoked under.
2537 * @param jsonObject: The object to stringify.
2538 * @param result: The string if successfully stringified.
2539 * @return Returns JSVM_OK if the API succeeded.
2545 * @brief This API create the startup snapshot of the VM.
2546 * @param vm: The environment that the API is invoked under.
2547 * @param contextCount: The object to stringify.
2548 * @param contexts: The array of contexts to add to the snapshot.
2549 * @param blobData: The snapshot data.
2550 * @param blobSize: The size of snapshot data.
2551 * @return Returns JSVM_OK if the API succeeded.
2561 * @brief This function returns a set of statistics data of the heap of the VM.
2563 * @param vm: The VM whose heap statistics are returned.
2564 * @param result: The heap statistics data.
2565 * @return Returns JSVM_OK if the API succeeded.
2573 * @param vm: The VM to start CPU profiler for.
2574 * @param result: The pointer to the CPU profiler.
2575 * @return Returns JSVM_OK if the API succeeded.
2581 * @brief This function stops the CPU profiler and output to the stream.
2583 * @param vm: THe VM to start CPU profiler for.
2584 * @param profiler: The CPU profiler to stop.
2585 * @param stream: The output stream callback for receiving the data.
2586 * @param streamData: Optional data to be passed to the stream callback.
2587 * @return Returns JSVM_OK if the API succeeded.
2596 * @brief This funciton takes the current heap snapshot and output to the stream.
2598 * @param vm: The VM whose heap snapshot is taken.
2599 * @param stream: The output stream callback for receiving the data.
2600 * @param streamData: Optional data to be passed to the stream callback.
2601 * @return Returns JSVM_OK if the API succeeded.
2609 * @param env: The environment that the API is invoked under.
2610 * @param host: The host to listen to for inspector connections.
2611 * @param port: The port to listen to for inspector connections.
2612 * @return Returns JSVM_OK if the API succeeded.
2620 * @param env: The environment that the API is invoked under.
2621 * @return Returns JSVM_OK if the API succeeded.
2630 * @param env: The environment that the API is invoked under.
2631 * @param breakNextLine: Whether break on the next line of JavaScript code.
2632 * @return Returns JSVM_OK if the API succeeded.
2638 * @brief When packaging C++classes, the C++constructor callback passed through the constructor
2639 * triggers the corresponding callback function when getter, setter, call, and other
2640 * behaviors occur on the instance object, handles the user's custom behavior, and then wraps
2641 * the new C++instance in a JavaScript object and returns the wrapper object.
2643 * @param env: The environment that the API is invoked under.
2644 * @param utf8name: Name of the JavaScript constructor function. For clarity, it is
2645 * recommended to use the C++ class name when wrapping a C++ class.
2646 * @param length: The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it
2648 …* @param constructor: Struct include callback function that handles constructing instances of the …
2649 * When wrapping a C++ class, this method must be a static member with the JSVM_Callback.callback
2651 * Include Optional data to be passed to the constructor callback as the data
2652 * property of the callback info. JSVM_Callback provides more details.
2653 * @param propertyCount: Number of items in the properties array argument.
2655 * properties, accessors, and methods on the class See JSVM_PropertyDescriptor.
2656 * @param propertyHandlerCfg: The instance object triggers the corresponding callback function.
2658 * @param result: A JSVM_Value representing the constructor function for the class.
2659 * @return Returns JSVM_OK if the API succeeded.
2673 * @brief Determines whether the current thread holds the lock for the specified environment.
2674 * Only threads that hold locks can use the environment.
2676 * @param env: The environment that the API is invoked under.
2677 …* @param isLocked: Flag indicating whether the current thread holds the lock for the specified env…
2678 * @return Returns JSVM_OK if the API succeeded.
2684 …* @brief Acquire the lock for the specified environment. Only threads that hold locks can use the …
2686 * @param env: The environment that the API is invoked under.
2687 * @return Returns JSVM_OK if the API succeeded.
2693 …* @brief Release the lock for the specified environment. Only threads that hold locks can use the …
2695 * @param env: The environment that the API is invoked under.
2696 * @return Returns JSVM_OK if the API succeeded.
2702 * @brief Starts the running of the task queue inside the VM.
2705 * @param env: The VM instance on which to start the task queue.
2706 * @param result: Whether the task queue was successfully started.
2707 * @return Returns JSVM_OK if the API succeeded.
2713 …* @brief Check to see if there are any microtasks waiting in the queue, and if there are, execute …
2715 * @param env: The VM instance on which to check microtasks.
2716 * @return Returns JSVM_OK if the API succeeded.
2722 * @brief This API checks if the value passed in is callable.
2724 * @param env: The VM instance on which to check microtasks.
2725 * @param value: The JavaScript value to check.
2726 * @param isCallable: Whether the given value is callable.
2727 * @return Returns JSVM_OK if the API succeeded.
2733 * @brief This API checks if the value passed in is undefined.
2736 * @param env: The VM instance on which to check microtasks.
2737 * @param value: The JavaScript value to check.
2738 * @param isUndefined: Whether the given value is Undefined.
2745 * @brief This API checks if the value passed in is a null object.
2748 * @param env: The VM instance on which to check microtasks.
2749 * @param value: The JavaScript value to check.
2750 * @param isNull: Whether the given value is Null.
2757 * @brief This API checks if the value passed in is either a null or an undefined object.
2760 * @param env: The VM instance on which to check microtasks.
2761 * @param value: The JavaScript value to check.
2762 * @param isNullOrUndefined: Whether the given value is Null or Undefined.
2769 * @brief This API checks if the value passed in is a boolean.
2772 * @param env: The VM instance on which to check microtasks.
2773 * @param value: The JavaScript value to check.
2774 * @param isBoolean: Whether the given value is Boolean.
2781 * @brief This API checks if the value passed in is a number.
2784 * @param env: The VM instance on which to check microtasks.
2785 * @param value: The JavaScript value to check.
2786 * @param isNumber: Whether the given value is Number.
2793 * @brief This API checks if the value passed in is a string.
2796 * @param env: The VM instance on which to check microtasks.
2797 * @param value: The JavaScript value to check.
2798 * @param isString: Whether the given value is String.
2805 * @brief This API checks if the value passed in is a symbol.
2808 * @param env: The VM instance on which to check microtasks.
2809 * @param value: The JavaScript value to check.
2810 * @param isSymbol: Whether the given value is Symbol.
2817 * @brief This API checks if the value passed in is a function.
2820 * @param env: The VM instance on which to check microtasks.
2821 * @param value: The JavaScript value to check.
2822 * @param isFunction: Whether the given value is Function.
2829 * @brief This API checks if the value passed in is an object.
2831 * @param env: The VM instance on which to check microtasks.
2832 * @param value: The JavaScript value to check.
2833 * @param isObject: Whether the given value is Object.
2840 * @brief This API checks if the value passed in is a bigInt.
2843 * @param env: The VM instance on which to check microtasks.
2844 * @param value: The JavaScript value to check.
2845 * @param isBigInt: Whether the given value is BigInt.
2852 * @brief This API checks if the value passed in is a constructor.
2854 * @param env: The environment that the API is invoked under.
2855 * @param value: The JavaScript value to check.
2856 * @param isConstructor: Whether the given value is Constructor.
2857 * @return Returns JSVM_OK if the API succeeded. Returns JSVM_INVALID_ARG if the API failed.
2863 * @brief This API returns the JavaScript value of the regular expression
2864 * corresponding to the input.
2865 * The interface may throw an exception.
2867 * @param env: The environment that the API is invoked under.
2868 * @param value: The JavaScript string to convert to a regular expression.
2872 * {@link JSVM_OK } If the API succeeded.\n
2873 * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n
2874 * {@link JSVM_STRING_EXPECTED } If the value of 'value' is not a string.\n
2876 * {@link JSVM_PENDING_EXCEPTION } If the API throws an exception during runtime.\n
2887 * @param env: The environment that the API is invoked under.
2889 * @return Returns JSVM_OK if the API succeeded. Returns JSVM_INVALID_ARG if the API failed.
2895 * @brief This API checks if the value passed in is a Map.
2897 * @param env: The environment that the API is invoked under.
2898 * @param value: The JavaScript value to check.
2899 * @param isMap: Whether the given value is Map.
2900 * @return Returns JSVM_OK if the API succeeded. Returns JSVM_INVALID_ARG if the API failed.
2908 * @param env: The environment that the API is invoked under.
2910 * @return Returns JSVM_OK if the API succeeded.
2916 * @brief This API checks if the value passed in is a Set.
2918 * @param env: The environment that the API is invoked under.
2919 * @param value: The JavaScript value to check.
2920 * @param isSet: Whether the given value is Set.
2921 * @return Returns JSVM_OK if the API succeeded.
2927 * @brief This API returns the Object prototype.
2929 * @param env: The environment that the API is invoked under.
2931 * @param result: JSVM_Value representing prototype of the given object.
2932 * @return Returns JSVM_OK if the API succeeded.
2938 * @brief This API set the prototype on the Object passed in.
2940 * @param env: The environment that the API is invoked under.
2941 * @param object: The object on which to set the prototype.
2942 * @param prototype: The prototype value.
2943 * @return Returns JSVM_OK if the API succeeded.
2949 * @brief This API implements the abstract operation `ToBigInt()`.
2951 * @param env: The environment that the API is invoked under.
2952 * @param value: The JavaScript value to coerce.
2953 * @param result: JSVM_Value representing the coerced JavaScript BigInt.
2954 * @return Returns JSVM_OK if the API succeeded. Returns JSVM_BIGINT_EXPECTED if the
2961 * @brief This API checks if the value passed in is a JavaScript RegExp object.
2963 * @param env: The environment that the API is invoked under.
2964 * @param value: The JavaScript value to check.
2965 * @param result: Whether the given value is RegExp.
2966 * @return Returns JSVM_OK if the API succeeded.
2974 * @param env: The environment that the API is invoked under.
2975 …* @param funcName: A string containing the function's name. Pass NULL to create an anonymous funct…
2976 * @param length: The length of the funcName in bytes, or JSVM_AUTO_LENGTH if it
2978 * @param argc: The count of elements in the argv array.
2979 …* @param argv: Array of JSVM_Values representing JavaScript strings passed in as arguments to the …
2980 * @param script: A JavaScript string containing the script to use as the function's body.
2981 * @param result: JSVM_Value representing the JavaScript function object for the newly
2983 …* @return Returns JSVM_OK if the API succeeded. Returns JSVM_GENERIC_FAILURE if the input script f…
2997 * beyond the current scope.
2999 * @param env: The environment that the API is invoked under.
3000 * @param script: A JavaScript string containing the script to be retained.
3002 * {@link JSVM_OK } if the API succeeded. \n
3003 * {@link JSVM_INVALID_ARG } if the script is empty or already retained. \n
3009 * @brief This function release the script retained by OH_JSVM_RetainScript
3011 * @param env: The environment that the API is invoked under.
3012 * @param script: A JavaScript string containing the script to be retained.
3014 * {@link JSVM_OK } if the API succeeded. \n
3015 * {@link JSVM_INVALID_ARG } if the script is empty or not retained. \n
3023 * @param env: The environment that the API is invoked under.
3024 * @param pid: A process id to identify the inspector connection.
3025 * @param name: An alias for the inspector that under a specific pid.
3028 * Returns {@link JSVM_OK } if the function executed successfully.\n
3038 * @param env: The environment that the API is invoked under.
3043 * @param cacheRejected: Output parameter representing whether the provided cacheData is rejected.
3046 * Returns {@link JSVM_OK } if the function executed successfully.\n
3062 * @brief Compile the function with the specified index in the WebAssembly module
3063 * into the specified optimization level.
3065 * @param env: The environment that the API is invoked under.
3066 * @param wasmModule: The WebAssembly module to which the function to compiled belongs.
3067 * @param functionIndex: The index of the function to be compiled, should never be out of range.
3068 * @param optLevel: Optimization level the function will be compiled with.
3070 * Returns {@link JSVM_OK } if the function executed successfully.\n
3083 * @brief Check whether the given JSVM_Value is a WebAssembly module.
3085 * @param env: The environment that the API is invoked under.
3086 * @param value: The JavaScript value to check.
3087 * @param result: Whether the given value is a WebAssembly module.
3089 * Returns {@link JSVM_OK } if the function executed successfully.\n
3090 * Returns {@link JSVM_INVALID_ARG } if any of the input arguments is NULL.\n
3099 * @param env: The environment that the API is invoked under.
3100 * @param wasmModule: The compiled WebAssembly module.
3104 * Returns {@link JSVM_OK } if the function executed successfully.\n
3105 * Returns {@link JSVM_INVALID_ARG } if any of the input arguments is NULL.\n
3118 * @param env: The environment that the API is invoked under.
3119 * @param cacheData: The cache data to be released, double free is undefined behaviors.
3120 * @param cacheType: The type of cache data.
3122 * Returns {@link JSVM_OK } if the function executed successfully.\n
3123 …* Returns {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL or cacheType i…
3132 * @param count The count of trace categories.
3137 * {@link JSVM_OK } if the function executed successfully.\n
3150 * @param stream The output stream callback for receiving the data.
3151 * @param streamData Data passed to the stream callback.
3153 * {@link JSVM_OK } if the function executed successfully.\n
3161 * @brief When wrapping a C++ class, the C++ constructor callback passed via constructor
3162 * should be a static method on the class that calls the actual class constructor, then
3163 * wraps the new C++ instance in a JavaScript object according to the different Options
3164 * passed in, and returns the wrapper object.
3166 * @param env The environment that the API is invoked under.
3167 * @param utf8name Name of the JavaScript constructor function. For clarity, it is
3168 * recommended to use the C++ class name when wrapping a C++ class.
3169 * @param length The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it
3171 …* @param constructor Struct include callback function that handles constructing instances of the c…
3172 * When wrapping a C++ class, this method must be a static member with the JSVM_Callback.callback
3174 * Include Optional data to be passed to the constructor callback as the data
3175 * property of the callback info. JSVM_Callback provides more details.
3176 * @param propertyCount Number of items in the properties array argument.
3178 * properties, accessors, and methods on the class See JSVM_PropertyDescriptor.
3179 * @param parentClass The parent-class of the currently defined class.
3182 * @param result A JSVM_Value representing the constructor function for the class.
3184 * {@link JSVM_OK } if the function executed successfully. \n
3185 * {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL. \n
3186 …* {@link JSVM_GENERIC_FAILURE} if the input utf8name | constructor | properties is invalid…