• Home
  • Raw
  • Download

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
104 * @param options: The options for initialize the JavaScript VM.
105 * @return Returns JSVM_OK if the API succeeded.
113 * @param options: The options for create the VM instance.
114 * @param result: The new VM instance.
115 * @return Returns JSVM_OK if the API succeeded.
124 * @param vm: The VM instance to be Destroyed.
125 * @return Returns JSVM_OK if the API succeeded.
131 * @brief This API open a new VM scope for the VM instance.
133 * @param vm: The VM instance to open scope for.
134 * @param result: The new VM scope.
135 * @return Returns JSVM_OK if the API succeeded.
142 * @brief This function close the VM scope for the VM instance.
144 * @param vm: The VM instance to close scope for.
145 * @param scope: The VM scope to be closed.
146 * @return Returns JSVM_OK if the API succeeded.
153 …* @brief This function create a new environment with optional properties for the context of the ne…
155 * @param vm: The VM instance that the env will be created in.
156 * @param propertyCount: The number of elements in the properties array.
157 * @param properties: The array of property descriptor.
158 * @param result: The new environment created.
159 * @return Returns JSVM_OK if the API succeeded.
168 * @brief This function create a new environment from the start snapshot of the vm.
170 * @param vm: The VM instance that the env will be created in.
171 * @param index: The index of the environment in the snapshot.
172 * @param result: The new environment created.
173 * @return Returns JSVM_OK if the API succeeded.
181 * @brief This function destroys the environment.
183 * @param env: The environment to be destroyed.
184 * @return Returns JSVM_OK if the API succeeded.
192 * @param env: The environment that the JSVM-API call is invoked under.
193 * @param result: The new environment scope.
194 * @return Returns JSVM_OK if the API succeeded.
201 * @brief This function closes the environment scope of the environment.
203 * @param env: The environment that the JSVM-API call is invoked under.
204 * @param scope: The environment scope to be closed.
205 * @return Returns JSVM_OK if the API succeeded.
212 * @brief This function retrieves the VM instance of the given environment.
214 * @param env: The environment that the JSVM-API call is invoked under.
215 * @param result: The VM instance of the environment.
216 * @return Returns JSVM_OK if the API succeeded.
223 * @brief This function compiles a string of JavaScript code and returns the compiled script.
225 * @param env: The environment that the JSVM-API call is invoked under.
226 * @param script: A JavaScript string containing the script yo be compiled.
227 * @param cachedData: Optional code cache data for the script.
228 * @param cacheDataLength: The length of cachedData array.
229 * @param eagerCompile: Whether to compile the script eagerly.
230 * @param cacheRejected: Whether the code cache rejected by compilation.
231 * @param result: The compiled script.
232 * @return Returns JSVM_OK if the API succeeded.
244 * @brief This function compiles a string of JavaScript code with the source code information
245 * and returns the compiled script.
247 * @param env: The environment that the JSVM-API call is invoked under.
248 * @param script: A JavaScript string containing the script to be compiled.
249 * @param cachedData: Optional code cache data for the script.
250 * @param cacheDataLength: The length of cachedData array.
251 * @param eagerCompile: Whether to compile the script eagerly.
252 * @param cacheRejected: Whether the code cache rejected by compilation.
253 * @param origin: The information of source code.
254 * @param result: The compiled script.
255 * @return Returns JSVM_OK if the API succeeded.
268 * @brief This function compiles a string of JavaScript code with the source code information
269 * and returns the compiled script.
271 * @param env: The environment that the JSVM-API call is invoked under.
272 * @param script: A JavaScript string containing the script to be compiled.
275 * @param result: The compiled script.
276 * @return Returns JSVM_OK if the API succeeded.
286 * @brief This function creates code cache for the compiled script.
288 * @param env: The environment that the JSVM-API call is invoked under.
290 * @param data: The data of the code cache.
291 * @param length: The length of the code cache data.
292 * @return Returns JSVM_OK if the API succeeded.
301 …* @brief This function executes a string of JavaScript code and returns its result with the follow…
302 …* Unlike eval, this function does not allow the script to access the current lexical scope, and th…
303 …* does not allow to access the module scope, meaning that pseudo-globals such as require will not …
304 …* The script can access the global scope. Function and var declarations in the script will be adde…
306 * to the global object.The value of this is global within the script.
308 * @param env: The environment that the API is invoked under.
309 * @param script: A JavaScript string containing the script to execute.
310 * @param result: The value resulting from having executed the script.
318 …* @brief This API associates data with the currently running JSVM environment. data can later be r…
321 * @param env: The environment that the JSVM-API call is invoked under.
322 * @param data: The data item to make available to bindings of this instance.
323 …* @param finalizeCb: The function to call when the environment is being torn down. The function re…
325 * @param finalizeHint: Optional hint to pass to the finalize callback during collection.
326 * @return Returns JSVM_OK if the API succeeded.
335 …* @brief This API retrieves data that was previously associated with the currently running JSVM en…
336 …* via OH_JSVM_SetInstanceData(). If no data is set, the call will succeed and data will be set to …
338 * @param env: The environment that the JSVM-API call is invoked under.
339 …* @param data: The data item that was previously associated with the currently running JSVM enviro…
341 * @return Returns JSVM_OK if the API succeeded.
348 …* @brief This API retrieves a JSVM_ExtendedErrorInfo structure with information about the last err…
351 * @param env: The environment that the JSVM-API call is invoked under.
352 * @param result: The JSVM_ExtendedErrorInfo structure with more information about the error.
353 * @return Returns JSVM_OK if the API succeeded.
360 * @brief This API throws the JavaScript value provided.
362 * @param env: The environment that the API is invoked under.
363 * @param error: The JavaScript value to be thrown.
364 * @return Returns JSVM_OK if the API succeeded.
371 * @brief This API throws a JavaScript Error with the text provided.
373 * @param env: The environment that the API is invoked under.
374 * @param code: Optional error code to be set on the error.
375 * @param msg: C string representing the text to be associated with the error.
376 * @return Returns JSVM_OK if the API succeeded.
384 * @brief This API throws a JavaScript TypeError with the text provided.
386 * @param env: The environment that the API is invoked under.
387 * @param code: Optional error code to be set on the error.
388 * @param msg: C string representing the text to be associated with the error.
389 * @return Returns JSVM_OK if the API succeeded.
397 * @brief This API throws a JavaScript RangeError with the text provided.
399 * @param env: The environment that the API is invoked under.
400 * @param code: Optional error code to be set on the error.
401 * @param msg: C string representing the text to be associated with the error.
402 * @return Returns JSVM_OK if the API succeeded.
410 * @brief This API throws a JavaScript SyntaxError with the text provided.
412 * @param env: The environment that the API is invoked under.
413 * @param code: Optional error code to be set on the error.
414 * @param msg: C string representing the text to be associated with the error.
415 * @return Returns JSVM_OK if the API succeeded.
425 * @param env: The environment that the API is invoked under.
426 * @param value: The JSVM_Value to be checked.
429 * @return Returns JSVM_OK if the API succeeded.
437 * @brief This API returns a JavaScript Error with the text provided.
439 * @param env: The environment that the API is invoked under.
440 …* @param code: Optional JSVM_Value with the string for the error code to be associated with the er…
441 …* @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Err…
442 * @param result: JSVM_Value representing the error created.
443 * @return Returns JSVM_OK if the API succeeded.
452 * @brief This API returns a JavaScript TypeError with the text provided.
454 * @param env: The environment that the API is invoked under.
455 …* @param code: Optional JSVM_Value with the string for the error code to be associated with the er…
456 …* @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Err…
457 * @param result: JSVM_Value representing the error created.
458 * @return Returns JSVM_OK if the API succeeded.
467 * @brief This API returns a JavaScript RangeError with the text provided.
469 * @param env: The environment that the API is invoked under.
470 …* @param code: Optional JSVM_Value with the string for the error code to be associated with the er…
471 …* @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Err…
472 * @param result: JSVM_Value representing the error created.
473 * @return Returns JSVM_OK if the API succeeded.
482 * @brief This API returns a JavaScript SyntaxError with the text provided.
484 * @param env: The environment that the API is invoked under.
485 …* @param code: Optional JSVM_Value with the string for the error code to be associated with the er…
486 …* @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Err…
487 * @param result: JSVM_Value representing the error created.
488 * @return Returns JSVM_OK if the API succeeded.
499 * @param env: The environment that the API is invoked under.
500 * @param result: The exception if one is pending, NULL otherwise.
501 * @return Returns JSVM_OK if the API succeeded.
510 * @param env: The environment that the API is invoked under.
512 * @return Returns JSVM_OK if the API succeeded.
521 * @param env: The environment that the API is invoked under.
522 * @param result: JSVM_Value representing the new scope.
523 * @return Returns JSVM_OK if the API succeeded.
530 * @brief This API closes the scope passed in. Scopes must be closed in the reverse
533 * @param env: The environment that the API is invoked under.
534 * @param scope: JSVM_Value representing the scope to be closed.
535 * @return Returns JSVM_OK if the API succeeded.
542 * @brief This API opens a new scope from which one object can be promoted to the outer scope.
544 * @param env: The environment that the API is invoked under.
545 * @param result: JSVM_Value representing the new scope.
546 * @return Returns JSVM_OK if the API succeeded.
553 * @brief This API closes the scope passed in. Scopes must be closed in the reverse order
556 * @param env: The environment that the API is invoked under.
557 * @param scope: JSVM_Value representing the scope to be closed.
558 * @return Returns JSVM_OK if the API succeeded.
565 * @brief This API promotes the handle to the JavaScript object so that it is valid for the lifetime
566 * of the outer scope. It can only be called once per scope. If it is called more than once an error
569 * @param env: The environment that the API is invoked under.
570 * @param scope: JSVM_Value representing the current scope.
571 * @param escapee: JSVM_Value representing the JavaScript Object to be escaped.
572 * @param result: JSVM_Value representing the handle to the escaped Object in the outer scope.
573 * @return Returns JSVM_OK if the API succeeded.
582 …* @brief This API creates a new reference with the specified reference count to the value passed i…
584 * @param env: The environment that the API is invoked under.
585 * @param value: The JSVM_Value for which a reference is being created.
586 * @param initialRefcount: Initial reference count for the new reference.
587 * @param result: JSVM_Ref pointing to the new reference.
588 * @return Returns JSVM_OK if the API succeeded.
597 * @brief his API deletes the reference passed in.
599 * @param env: The environment that the API is invoked under.
601 * @return Returns JSVM_OK if the API succeeded.
608 * @brief his API increments the reference count for the reference passed in and
609 * returns the resulting reference count.
611 * @param env: The environment that the API is invoked under.
612 * @param ref: JSVM_Ref for which the reference count will be incremented.
613 * @param result: The new reference count.
614 * @return Returns JSVM_OK if the API succeeded.
622 * @brief This API decrements the reference count for the reference passed in and
623 * returns the resulting reference count.
625 * @param env: The environment that the API is invoked under.
626 * @param ref: JSVM_Ref for which the reference count will be decremented.
627 * @param result: The new reference count.
628 * @return Returns JSVM_OK if the API succeeded.
636 * @brief If still valid, this API returns the JSVM_Value representing the
637 * JavaScript value associated with the JSVM_Ref. Otherwise, result will be NULL.
639 * @param env: The environment that the API is invoked under.
640 * @param ref: The JSVM_Ref for which the corresponding value is being requested.
641 * @param result: The JSVM_Value referenced by the JSVM_Ref.
642 * @return Returns JSVM_OK if the API succeeded.
652 * @param env: The environment that the API is invoked under.
654 * @return Returns JSVM_OK if the API succeeded.
662 …* @brief This API returns a JSVM-API value corresponding to a JavaScript Array type. The Array's l…
663 …* is set to the passed-in length parameter. However, the underlying buffer is not guaranteed to be…
664 * by the VM when the array is created. That behavior is left to the underlying VM implementation.
666 * @param env: The environment that the API is invoked under.
667 * @param length: The initial length of the Array.
669 * @return Returns JSVM_OK if the API succeeded.
679 …* The ArrayBuffer allocated will have an underlying byte buffer whose size is determined by the le…
680 …* that's passed in. The underlying buffer is optionally returned back to the caller in case the ca…
681 …* directly manipulate the buffer. This buffer can only be written to directly from native code. To…
684 * @param env: The environment that the API is invoked under.
685 * @param byteLength: The length in bytes of the array buffer to create.
686 …* @param data: Pointer to the underlying byte buffer of the ArrayBuffer.data can optionally be ign…
688 * @return Returns JSVM_OK if the API succeeded.
697 * @brief This API allocate the memory of array buffer backing store.
700 * @param initialized: initialization status of the backing store memory.
701 * @param data: pointer that recieve the backing store memory pointer.
713 * @brief This API release the memory of an array buffer backing store.
715 * @param data: pointer to the backing store memory.
724 * @brief This API create an array buffer using the backing store data.
726 * @param env: The environment that the API is invoked under.
727 * @param data: pointer to the backing store memory.
729 * @param offset: start position of the array buffer in the backing store memory.
730 * @param arrayBufferSize: size of the array buffer.
731 * @param result: pointer that recieve the array buffer.
734 * Returns {@link JSVM_INVALID_ARG } if any of the following condition reached:\n
751 * @param env: The environment that the API is invoked under.
754 * @return Returns JSVM_OK if the API succeeded.
764 …* The API adds a JSVM_Finalize callback which will be called when the JavaScript object just creat…
765 …* collected.The created value is not an object, and therefore does not support additional properti…
768 * @param env: The environment that the API is invoked under.
769 * @param data: Raw pointer to the external data.
770 …* @param finalizeCb: Optional callback to call when the external value is being collected. JSVM_Fi…
772 * @param finalizeHint: Optional hint to pass to the finalize callback during collection.
774 * @return Returns JSVM_OK if the API succeeded.
784 …* @brief This API allocates a default JavaScript Object. It is the equivalent of doing new Object(…
786 * @param env: The environment that the API is invoked under.
788 * @return Returns JSVM_OK if the API succeeded.
797 * @param env: The environment that the API is invoked under.
798 …* @param description: Optional JSVM_Value which refers to a JavaScript string to be set as the des…
799 * for the symbol.
801 * @return Returns JSVM_OK if the API succeeded.
809 …* @brief This API searches in the global registry for an existing symbol with the given descriptio…
810 …* If the symbol already exists it will be returned, otherwise a new symbol will be created in the
812 * @param env: The environment that the API is invoked under.
813 … @param utf8description: UTF-8 C string representing the text to be used as the description for th…
814 …* @param length: The length of the description string in bytes, or JSVM_AUTO_LENGTH if it is null-…
816 * @return Returns JSVM_OK if the API succeeded.
826 * objects provide an array-like view over an underlying data buffer where each element has the
828 * be <= the size in bytes of the array passed in. If not, a RangeError exception is raised.
830 * @param env: The environment that the API is invoked under.
831 * @param type: Scalar datatype of the elements within the TypedArray.
832 * @param length: Number of elements in the TypedArray.
833 * @param arraybuffer: ArrayBuffer underlying the typed array.
834 …* @param byteOffset: The byte offset within the ArrayBuffer from which to start projecting the Typ…
836 * @return Returns JSVM_OK if the API succeeded.
849 * of different size and type in the ArrayBuffer.It is required that byte_length + byte_offset is
850 * less than or equal to the size in bytes of the array passed in. If not, a RangeError exception
853 * @param env: The environment that the API is invoked under.
854 * @param length: Number of elements in the DataView.
855 * @param arraybuffer: ArrayBuffer underlying the DataView.
856 …* @param byteOffset: The byte offset within the ArrayBuffer from which to start projecting the Dat…
858 * @return Returns JSVM_OK if the API succeeded.
868 * @brief This API is used to convert from the C int32_t type to the JavaScript number type.
870 * @param env: The environment that the API is invoked under.
873 * @return Returns JSVM_OK if the API succeeded.
881 * @brief This API is used to convert from the C uint32_t type to the JavaScript number type.
883 * @param env: The environment that the API is invoked under.
886 * @return Returns JSVM_OK if the API succeeded.
894 * @brief This API is used to convert from the C int64_t type to the JavaScript number type.
896 * @param env: The environment that the API is invoked under.
899 * @return Returns JSVM_OK if the API succeeded.
907 * @brief This API is used to convert from the C double type to the JavaScript number type.
909 * @param env: The environment that the API is invoked under.
912 * @return Returns JSVM_OK if the API succeeded.
920 * @brief This API converts the C int64_t type to the JavaScript BigInt type.
922 * @param env: The environment that the API is invoked under.
925 * @return Returns JSVM_OK if the API succeeded.
933 * @brief This API converts the C uint64_t type to the JavaScript BigInt type.
935 * @param env: The environment that the API is invoked under.
938 * @return Returns JSVM_OK if the API succeeded.
947 * The resulting BigInt is calculated as: (–1)sign_bit (words[0] × (264)0 + words[1] × (264)1 + …)
949 * @param env: The environment that the API is invoked under.
950 * @param signBit: Determines if the resulting BigInt will be positive or negative.
951 * @param wordCount: The length of the words array.
954 * @return Returns JSVM_OK if the API succeeded.
965 * string. The native string is copied.
967 * @param env: The environment that the API is invoked under.
969 * @param length: The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated.
971 * @return Returns JSVM_OK if the API succeeded.
981 * string. The native string is copied.
983 * @param env: The environment that the API is invoked under.
985 * @param length: The length of the string in two-byte code units, or JSVM_AUTO_LENGTH
988 * @return Returns JSVM_OK if the API succeeded.
998 * string. The native string is copied.
1000 * @param env: The environment that the API is invoked under.
1002 * @param length: The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated.
1004 * @return Returns JSVM_OK if the API succeeded.
1013 * @brief This API returns the length of an array.
1015 * @param env: The environment that the API is invoked under.
1016 * @param value: JSVM_Value representing the JavaScript Array whose length is being queried.
1017 * @param result: uint32 representing length of the array.
1018 * @return Returns JSVM_OK if the API succeeded.
1026 * @brief This API is used to retrieve the underlying data buffer of an ArrayBuffer and its length.
1028 * @param env: The environment that the API is invoked under.
1029 * @param arraybuffer: JSVM_Value representing the ArrayBuffer being queried.
1030 * @param data: The underlying data buffer of the ArrayBuffer. If byte_length is 0, this may be NULL
1032 * @param byteLength: Length in bytes of the underlying data buffer.
1033 * @return Returns JSVM_OK if the API succeeded.
1042 * @brief This API returns the length of an array.
1044 * @param env: The environment that the API is invoked under.
1046 …* the equivalent of Object.getPrototypeOf (which is not the same as the function's prototype prope…
1047 * @param result: JSVM_Value representing prototype of the given object.
1048 * @return Returns JSVM_OK if the API succeeded.
1058 * @param env: The environment that the API is invoked under.
1059 * @param typedarray: JSVM_Value representing the TypedArray whose properties to query.
1060 * @param type: Scalar datatype of the elements within the TypedArray.
1061 * @param length: The number of elements in the TypedArray.
1062 …* @param data: The data buffer underlying the TypedArray adjusted by the byte_offset value so that…
1063 …* points to the first element in the TypedArray. If the length of the array is 0, this may be NULL…
1065 * @param arraybuffer: The ArrayBuffer underlying the TypedArray.
1066 …* @param byteOffset: The byte offset within the underlying native array at which the first element…
1067 …* the arrays is located. The value for the data parameter has already been adjusted so that data p…
1068 …* to the first element in the array. Therefore, the first byte of the native array would be at dat…
1069 * @return Returns JSVM_OK if the API succeeded.
1081 * @brief Any of the out parameters may be NULL if that property is unneeded.
1084 * @param env: The environment that the API is invoked under.
1085 * @param dataview: JSVM_Value representing the DataView whose properties to query.
1086 * @param bytelength: Number of bytes in the DataView.
1087 * @param data: The data buffer underlying the DataView.
1089 * @param arraybuffer: ArrayBuffer underlying the DataView.
1090 …* @param byteOffset: The byte offset within the data buffer from which to start projecting the Dat…
1091 * @return Returns JSVM_OK if the API succeeded.
1102 * @brief Returns JSVM_OK if the API succeeded. If a non-date JSVM_Value is
1103 * passed in it returns JSVM_date_expected.This API returns the C double
1104 * primitive of time value for the given JavaScript Date.
1106 * @param env: The environment that the API is invoked under.
1109 * since midnight at the beginning of 01 January, 1970 UTC.
1110 * @return Returns JSVM_OK if the API succeeded.
1118 * @brief This API returns the C boolean primitive equivalent of the given JavaScript Boolean.
1120 * @param env: The environment that the API is invoked under.
1122 * @param result: C boolean primitive equivalent of the given JavaScript Boolean.
1123 * @return Returns JSVM_OK if the API succeeded.
1132 * @brief This API returns the C double primitive equivalent of the given JavaScript number.
1134 * @param env: The environment that the API is invoked under.
1136 * @param result: C double primitive equivalent of the given JavaScript number.
1137 * @return Returns JSVM_OK if the API succeeded.
1146 * @brief This API returns the C int64_t primitive equivalent of the given JavaScript BigInt.
1147 * If needed it will truncate the value, setting lossless to false.
1149 * @param env: The environment that the API is invoked under.
1151 * @param result: C int64_t primitive equivalent of the given JavaScript BigInt.
1152 * @param lossless: Indicates whether the BigInt value was converted losslessly.
1153 …* @return Returns JSVM_OK if the API succeeded. If a non-BigInt is passed in it returns JSVM_BIGIN…
1162 * @brief This API returns the C uint64_t primitive equivalent of the given JavaScript BigInt.
1163 * If needed it will truncate the value, setting lossless to false.
1165 * @param env: The environment that the API is invoked under.
1167 * @param result: C uint64_t primitive equivalent of the given JavaScript BigInt.
1168 * @param lossless: Indicates whether the BigInt value was converted losslessly.
1169 …* @return Returns JSVM_OK if the API succeeded. If a non-BigInt is passed in it returns JSVM_BIGIN…
1178 …This API converts a single BigInt value into a sign bit, 64-bit little-endian array, and the number
1179 …* of elements in the array. signBit and words may be both set to NULL, in order to get only wordCo…
1181 * @param env: The environment that the API is invoked under.
1183 * @param signBit: Integer representing if the JavaScript BigInt is positive or negative.
1184 …* @param wordCount: Must be initialized to the length of the words array. Upon return, it will be …
1185 * the actual number of words that would be needed to store this BigInt.
1187 * @return Returns JSVM_OK if the API succeeded.
1197 …* @brief This API retrieves the external data pointer that was previously passed to OH_JSVM_Create…
1199 * @param env: The environment that the API is invoked under.
1201 * @param result: Pointer to the data wrapped by the JavaScript external value.
1202 …* @return Returns JSVM_OK if the API succeeded. If a non-external JSVM_Value is passed in it retur…
1210 * @brief This API returns the C int32 primitive equivalent of the given JavaScript number.
1212 * @param env: The environment that the API is invoked under.
1214 * @param result: C int32 primitive equivalent of the given JavaScript number.
1215 …* @return Returns JSVM_OK if the API succeeded. If a non-number JSVM_Value is passed in JSVM_NUMBE…
1223 * @brief This API returns the C int64 primitive equivalent of the given JavaScript number.
1225 * @param env: The environment that the API is invoked under.
1227 * @param result: C int64 primitive equivalent of the given JavaScript number.
1228 …* @return Returns JSVM_OK if the API succeeded. If a non-number JSVM_Value is passed in JSVM_NUMBE…
1236 * @brief This API returns the ISO-8859-1-encoded string corresponding the value passed in.
1238 * @param env: The environment that the API is invoked under.
1240 * @param buf: Buffer to write the ISO-8859-1-encoded string into. If NULL is passed in, the
1241 * length of the string in bytes and excluding the null terminator is returned in result.
1242 …* @param bufsize: Size of the destination buffer. When this value is insufficient, the returned st…
1244 * @param result: Number of bytes copied into the buffer, excluding the null terminator.
1245 …* @return Returns JSVM_OK if the API succeeded. If a non-number JSVM_Value is passed in JSVM_NUMBE…
1255 * @brief This API returns the UTF8-encoded string corresponding the value passed in.
1257 * @param env: The environment that the API is invoked under.
1259 * @param buf: Buffer to write the UTF8-encoded string into. If NULL is passed in, the length
1260 * of the string in bytes and excluding the null terminator is returned in result.
1261 * @param bufsize: Size of the destination buffer. When this value is insufficient, the returned
1263 * @param result: Number of bytes copied into the buffer, excluding the null terminator.
1264 …* @return Returns JSVM_OK if the API succeeded. If a non-number JSVM_Value is passed in JSVM_NUMBE…
1274 * @brief This API returns the UTF16-encoded string corresponding the value passed in.
1276 * @param env: The environment that the API is invoked under.
1278 * @param buf: Buffer to write the UTF16-LE-encoded string into. If NULL is passed in,
1279 * the length of the string in 2-byte code units and excluding the null terminator is returned.
1280 * @param bufsize: Size of the destination buffer. When this value is insufficient,
1281 * the returned string is truncated and null-terminated.
1282 * @param result: Number of 2-byte code units copied into the buffer, excluding the null terminator.
1283 …* @return Returns JSVM_OK if the API succeeded. If a non-number JSVM_Value is passed in JSVM_NUMBE…
1293 * @brief This API returns the C primitive equivalent of the given JSVM_Value as a uint32_t.
1295 * @param env: The environment that the API is invoked under.
1297 * @param result: C primitive equivalent of the given JSVM_Value as a uint32_t.
1298 * @return Returns JSVM_OK if the API succeeded.
1307 …* @brief This API is used to return the JavaScript singleton object that is used to represent the
1309 * @param env: The environment that the API is invoked under.
1310 * @param value: The value of the boolean to retrieve.
1312 * @return Returns JSVM_OK if the API succeeded.
1320 * @brief This API returns the global object.
1322 * @param env: The environment that the API is invoked under.
1324 * @return Returns JSVM_OK if the API succeeded.
1331 * @brief This API returns the null object.
1333 * @param env: The environment that the API is invoked under.
1335 * @return Returns JSVM_OK if the API succeeded.
1342 * @brief This API returns the Undefined object.
1344 * @param env: The environment that the API is invoked under.
1346 * @return Returns JSVM_OK if the API succeeded.
1353 * @brief This API implements the abstract operation ToBoolean()
1355 * @param env: The environment that the API is invoked under.
1356 * @param value: The JavaScript value to coerce.
1357 * @param result: JSVM_Value representing the coerced JavaScript Boolean.
1358 * @return Returns JSVM_OK if the API succeeded.
1366 * @brief This API implements the abstract operation ToNumber() as defined. This
1367 * function potentially runs JS code if the passed-in value is an object.
1369 * @param env: The environment that the API is invoked under.
1370 * @param value: The JavaScript value to coerce.
1371 * @param result: JSVM_Value representing the coerced JavaScript number.
1372 * @return Returns JSVM_OK if the API succeeded.
1380 * @brief This API implements the abstract operation ToObject().
1382 * @param env: The environment that the API is invoked under.
1383 * @param value: The JavaScript value to coerce.
1384 * @param result: JSVM_Value representing the coerced JavaScript Object.
1385 * @return Returns JSVM_OK if the API succeeded.
1393 * @brief This API implements the abstract operation ToString().This
1394 * function potentially runs JS code if the passed-in value is an object.
1396 * @param env: The environment that the API is invoked under.
1397 * @param value: The JavaScript value to coerce.
1398 * @param result: JSVM_Value representing the coerced JavaScript string.
1399 * @return Returns JSVM_OK if the API succeeded.
1407 * @brief This API represents behavior similar to invoking the typeof Operator
1408 * on the object as defined. However, there are some differences:It has support
1413 * @param env: The environment that the API is invoked under.
1414 * @param value: The JavaScript value whose type to query.
1415 * @param result: The type of the JavaScript value.
1416 * @return Returns JSVM_OK if the API succeeded.
1424 * @brief This API represents invoking the instanceof Operator on the object.
1426 * @param env: The environment that the API is invoked under.
1427 * @param object: The JavaScript value to check.
1428 * @param constructor: The JavaScript function object of the constructor function
1431 * @return Returns JSVM_OK if the API succeeded.
1440 * @brief This API represents invoking the IsArray operation on the object
1442 * @param env: The environment that the API is invoked under.
1443 * @param value: The JavaScript value to check.
1444 * @param result: Whether the given object is an array.
1445 * @return Returns JSVM_OK if the API succeeded.
1453 * @brief This API checks if the Object passed in is an array buffer.
1455 * @param env: The environment that the API is invoked under.
1456 * @param value: The JavaScript value to check.
1457 * @param result: Whether the given object is an ArrayBuffer.
1458 * @return Returns JSVM_OK if the API succeeded.
1466 * @brief This API checks if the Object passed in is a date.
1468 * @param env: The environment that the API is invoked under.
1469 * @param value: The JavaScript value to check.
1470 * @param result: Whether the given JSVM_Value represents a JavaScript Date object.
1471 * @return Returns JSVM_OK if the API succeeded.
1479 * @brief This API checks if the Object passed in is a typed array.
1481 * @param env: The environment that the API is invoked under.
1482 * @param value: The JavaScript value to check.
1483 * @param result: Whether the given JSVM_Value represents a TypedArray.
1484 * @return Returns JSVM_OK if the API succeeded.
1492 * @brief This API checks if the Object passed in is a DataView.
1494 * @param env: The environment that the API is invoked under.
1495 * @param value: The JavaScript value to check.
1496 * @param result: Whether the given JSVM_Value represents a DataView.
1497 * @return Returns JSVM_OK if the API succeeded.
1505 * @brief This API represents the invocation of the Strict Equality algorithm.
1506 * Returns true only when both the type and value are equal.
1508 * @param env: The environment that the API is invoked under.
1509 * @param lhs: The JavaScript value to check.
1510 * @param rhs: The JavaScript value to check against.
1511 * @param result: Whether the two JSVM_Value objects are equal.
1512 * @return Returns JSVM_OK if the API succeeded.
1521 * @brief This API represents the invocation of the Relaxed Equality algorithm.
1522 * Returns true as long as the values are equal, regardless of type.
1524 * @param env: The environment that the API is invoked under.
1525 * @param lhs: The JavaScript value to check.
1526 * @param rhs: The JavaScript value to check against.
1527 * @param result: Whether the two JSVM_Value objects are relaxed equal.
1528 * @return Returns JSVM_OK if the API succeeded.
1537 * @brief This API represents the invocation of the ArrayBuffer detach operation.
1539 * @param env: The environment that the API is invoked under.
1540 * @param arraybuffer: The JavaScript ArrayBuffer to be detached.
1541 * @return Returns JSVM_OK if the API succeeded.If a non-detachable ArrayBuffer
1549 * @brief This API represents the invocation of the ArrayBuffer IsDetachedBuffer operation.
1551 * @param env: The environment that the API is invoked under.
1552 * @param value: The JavaScript ArrayBuffer to be checked.
1553 * @param result: Whether the arraybuffer is detached.
1554 * @return Returns JSVM_OK if the API succeeded.
1562 * @brief This API returns the names of the enumerable properties of object as an array of
1563 * strings. The properties of object whose key is a symbol will not be included.
1565 * @param env: The environment that the API is invoked under.
1566 * @param object: The object from which to retrieve the properties.
1568 * the property names of the object. The API can be used to iterate over result using
1570 * @return Returns JSVM_OK if the API succeeded.
1578 * @brief This API returns an array containing the names of the available properties
1581 * @param env: The environment that the API is invoked under.
1582 * @param object: The object from which to retrieve the properties.
1587 * that represent the property names of the object. OH_JSVM_GetArrayLength and
1589 * @return Returns JSVM_OK if the API succeeded.
1600 * @brief This API set a property on the Object passed in.
1602 * @param env: The environment that the API is invoked under.
1603 * @param object: The object on which to set the property.
1604 * @param key: The name of the property to set.
1605 * @param value: The property value.
1606 * @return Returns JSVM_OK if the API succeeded.
1615 * @brief This API gets the requested property from the Object passed in.
1617 * @param env: The environment that the API is invoked under.
1618 * @param object: The object from which to retrieve the property.
1619 * @param key: The name of the property to retrieve.
1620 * @param result: The value of the property.
1621 * @return Returns JSVM_OK if the API succeeded.
1630 * @brief This API checks if the Object passed in has the named property.
1632 * @param env: The environment that the API is invoked under.
1633 * @param object: The object to query.
1634 * @param key: The name of the property whose existence to check.
1635 * @param result: Whether the property exists on the object or not.
1636 * @return Returns JSVM_OK if the API succeeded.
1645 * @brief This API attempts to delete the key own property from object.
1647 * @param env: The environment that the API is invoked under.
1648 * @param object: The object to query.
1649 * @param key: The name of the property to delete.
1650 * @param result: Whether the property deletion succeeded or not. result
1652 * @return Returns JSVM_OK if the API succeeded.
1661 * @brief This API checks if the Object passed in has the named own property.
1665 * @param env: The environment that the API is invoked under.
1666 * @param object: The object to query.
1667 * @param key: The name of the own property whose existence to check.
1668 * @param result: Whether the own property exists on the object or not.
1669 * @return Returns JSVM_OK if the API succeeded.
1679 * a JSVM_Value created from the string passed in as utf8Name.
1681 * @param env: The environment that the API is invoked under.
1682 * @param object: The object on which to set the property.
1683 * @param utf8Name: The name of the property to set.
1684 * @param value: The property value.
1685 * @return Returns JSVM_OK if the API succeeded.
1695 * a JSVM_Value created from the string passed in as utf8Name.
1697 * @param env: The environment that the API is invoked under.
1698 * @param object: The object from which to retrieve the property.
1699 * @param utf8Name: The name of the property to get.
1700 * @param result: The value of the property.
1701 * @return Returns JSVM_OK if the API succeeded.
1711 * a JSVM_Value created from the string passed in as utf8Name.
1713 * @param env: The environment that the API is invoked under.
1714 * @param object: The object to query.
1715 * @param utf8Name: The name of the property whose existence to check.
1716 * @param result: Whether the property exists on the object or not.
1717 * @return Returns JSVM_OK if the API succeeded.
1726 * @brief This API sets an element on the Object passed in.
1728 * @param env: The environment that the API is invoked under.
1729 * @param object: The object from which to set the properties.
1730 * @param index: The index of the property to set.
1731 * @param value: The property value.
1732 * @return Returns JSVM_OK if the API succeeded.
1741 * @brief This API gets the element at the requested index.
1743 * @param env: The environment that the API is invoked under.
1744 * @param object: The object from which to retrieve the property.
1745 * @param index: The index of the property to get.
1746 * @param result: The value of the property.
1747 * @return Returns JSVM_OK if the API succeeded.
1756 * @brief This API returns if the Object passed in has an element
1757 * at the requested index.
1759 * @param env: The environment that the API is invoked under.
1760 * @param object: The object to query.
1761 * @param index: The index of the property whose existence to check.
1762 * @param result: Whether the property exists on the object or not.
1763 * @return Returns JSVM_OK if the API succeeded.
1772 * @brief This API attempts to delete the specified index from object.
1774 * @param env: The environment that the API is invoked under.
1775 * @param object: The object to query.
1776 * @param index: The index of the property to delete.
1777 * @param result: Whether the element deletion succeeded or not. result
1779 * @return Returns JSVM_OK if the API succeeded.
1788 * @brief This method allows the efficient definition of multiple properties
1789 * on a given object. The properties are defined using property descriptors.
1790 * Given an array of such property descriptors, this API will set the properties
1791 * on the object one at a time, as defined by DefineOwnProperty().
1793 * @param env: The environment that the API is invoked under.
1794 * @param object: The object from which to retrieve the properties.
1795 * @param propertyCount: The number of elements in the properties array.
1796 * @param properties: The array of property descriptors.
1797 * @return Returns JSVM_OK if the API succeeded.
1808 * changing the enumerability, configurability, or writability of existing
1809 * properties, and prevents the values of existing properties from being changed.
1810 * It also prevents the object's prototype from being changed.
1812 * @param env: The environment that the API is invoked under.
1813 * @param object: The object to freeze.
1814 * @return Returns JSVM_OK if the API succeeded.
1824 * @param env: The environment that the API is invoked under.
1825 * @param object: The object to seal.
1826 * @return Returns JSVM_OK if the API succeeded.
1834 * a native add-on. This is the primary mechanism of calling back from the
1837 * @param env: The environment that the API is invoked under.
1838 * @param recv: The this value passed to the called function.
1839 * @param func: JSVM_Value representing the JavaScript function to be invoked.
1840 * @param argc: The count of elements in the argv array.
1841 …* @param argv: Array of JSVM_values representing JavaScript values passed in as arguments to the f…
1842 * @param result: JSVM_Value representing the JavaScript object returned.
1843 * @return Returns JSVM_OK if the API succeeded.
1855 * code. This is the primary mechanism to allow calling into the add-on's native
1856 * code from JavaScript.The newly created function is not automatically visible
1858 * object that is visible to JavaScript, in order for the function to be accessible
1861 * @param env: The environment that the API is invoked under.
1862 * @param utf8Name: Optional name of the function encoded as UTF8. This is visible
1863 * within JavaScript as the new function object's name property.
1864 * @param length: The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it
1866 * @param cb: The native function which should be called when this function
1868 * @param result: JSVM_Value representing the JavaScript function object for the newly
1870 * @return Returns JSVM_OK if the API succeeded.
1881 * the call like the arguments and the this pointer from a given callback info.
1883 * @param env: The environment that the API is invoked under.
1884 * @param cbinfo: The callback info passed into the callback function.
1885 * @param argc: Specifies the length of the provided argv array and receives the
1887 * @param argv: C array of JSVM_values to which the arguments will be copied. If
1888 * there are more arguments than the provided count, only the requested number of
1889 * arguments are copied. If there are fewer arguments provided than claimed, the
1892 * @param thisArg: Receives the JavaScript this argument for the call. thisArg
1894 * @param data: Receives the data pointer for the callback. data can optionally
1896 * @return Returns JSVM_OK if the API succeeded.
1907 * @brief This API returns the new.target of the constructor call. If the
1908 * current callback is not a constructor call, the result is NULL.
1910 * @param env: The environment that the API is invoked under.
1911 * @param cbinfo: The callback info passed into the callback function.
1912 * @param result: The new.target of the constructor call.
1913 * @return Returns JSVM_OK if the API succeeded.
1922 * a given JSVM_Value that represents the constructor for the object.
1924 * @param env: The environment that the API is invoked under.
1925 …* @param constructor: JSVM_Value representing the JavaScript function to be invoked as a construct…
1926 * @param argc: The count of elements in the argv array.
1927 * @param argv: Array of JavaScript values as JSVM_Value representing the arguments to
1928 * the constructor. If argc is zero this parameter may be omitted by passing in NULL.
1929 * @param result: JSVM_Value representing the JavaScript object returned, which
1930 * in this case is the constructed object.
1931 * @return Returns JSVM_OK if the API succeeded.
1941 * @brief When wrapping a C++ class, the C++ constructor callback passed via constructor
1942 * should be a static method on the class that calls the actual class constructor, then
1943 * wraps the new C++ instance in a JavaScript object, and returns the wrapper object.
1945 * @param env: The environment that the API is invoked under.
1946 * @param utf8name: Name of the JavaScript constructor function. For clarity, it is
1947 * recommended to use the C++ class name when wrapping a C++ class.
1948 * @param length: The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it
1950 …* @param constructor: Struct include callback function that handles constructing instances of the
1951 * When wrapping a C++ class, this method must be a static member with the JSVM_Callback.callback
1953 * Include Optional data to be passed to the constructor callback as the data
1954 * property of the callback info. JSVM_Callback provides more details.
1955 * @param propertyCount: Number of items in the properties array argument.
1957 * properties, accessors, and methods on the class See JSVM_PropertyDescriptor.
1958 * @param result: A JSVM_Value representing the constructor function for the class.
1959 * @return Returns JSVM_OK if the API succeeded.
1971 * @brief Wraps a native instance in a JavaScript object. The native instance can
1974 * @param env: The environment that the API is invoked under.
1975 * @param jsObject: The JavaScript object that will be the wrapper for the native object.
1976 * @param nativeObject: The native instance that will be wrapped in the JavaScript object.
1977 * @param finalizeCb: Optional native callback that can be used to free the native instance
1978 * when the JavaScript object has been garbage-collected.
1979 * @param finalizeHint: Optional contextual hint that is passed to the finalize callback.
1980 * properties, accessors, and methods on the class See JSVM_PropertyDescriptor.
1981 * @param result: Optional reference to the wrapped object.
1982 * @return Returns JSVM_OK if the API succeeded.
1993 * @brief When JavaScript code invokes a method or property accessor on the class, the corresponding
1994 * JSVM_Callback is invoked. If the callback is for an instance method or accessor, then the this
1995 * argument to the callback is the wrapper object; the wrapped C++ instance that is the target of
1996 * the call can be obtained then by calling OH_JSVM_Unwrap() on the wrapper object.
1998 * @param env: The environment that the API is invoked under.
1999 * @param jsObject: The object associated with the native instance.
2000 * @param result: Pointer to the wrapped native instance.
2001 * @return Returns JSVM_OK if the API succeeded.
2009 * @brief Retrieves a native instance that was previously wrapped in the JavaScript object jsObject
2010 …* using OH_JSVM_Wrap() and removes the wrapping. If a finalize callback was associated with the wr…
2011 * it will no longer be called when the JavaScript object becomes garbage-collected.
2013 * @param env: The environment that the API is invoked under.
2014 * @param jsObject: The object associated with the native instance.
2015 * @param result: Pointer to the wrapped native instance.
2016 * @return Returns JSVM_OK if the API succeeded.
2024 * @brief Associates the value of the typeTag pointer with the JavaScript object or external.
2025 * OH_JSVM_CheckObjectTypeTag() can then be used to compare the tag that was attached to the
2026 * object with one owned by the addon to ensure that the object has the right type.
2027 * If the object already has an associated type tag, this API will return JSVM_INVALID_ARG.
2029 * @param env: The environment that the API is invoked under.
2030 * @param value: The JavaScript object or external to be marked.
2031 * @param typeTag: The tag with which the object is to be marked.
2032 * @return Returns JSVM_OK if the API succeeded.
2040 * @brief Compares the pointer given as typeTag with any that can be found on js object.
2044 * @param env: The environment that the API is invoked under.
2045 * @param value: The JavaScript object or external whose type tag to examine.
2046 * @param typeTag: The tag with which to compare any tag found on the object.
2047 …* @param result: Whether the type tag given matched the type tag on the object. false is also retu…
2048 * if no type tag was found on the object.
2049 * @return Returns JSVM_OK if the API succeeded.
2060 * @param env: The environment that the API is invoked under.
2061 * @param jsObject: The JavaScript object to which the native data will be attached.
2063 * @param finalizeCb: Native callback that will be used to free the native data when the
2065 * @param finalizeHint: Optional contextual hint that is passed to the finalize callback.
2066 * @param result: Optional reference to the JavaScript object.
2067 * @return Returns JSVM_OK if the API succeeded.
2078 * @brief This API returns the highest JSVM-API version supported by the JSVM runtime.
2084 * @param env: The environment that the API is invoked under.
2085 * @param result: The highest version of JSVM-API supported.
2086 * @return Returns JSVM_OK if the API succeeded.
2093 * @brief Return information of the VM.
2095 * @param result: The information of the VM.
2096 * @return Returns JSVM_OK if the API succeeded.
2102 * @brief This function gives V8 an indication of the amount of externally
2108 * @param env: The environment that the API is invoked under.
2109 * @param changeInBytes: The change in externally allocated memory that is kept
2111 * @param result: The adjusted value
2112 * @return Returns JSVM_OK if the API succeeded.
2120 * @brief This function notifies the VM that the system is running low on memory
2123 * @param env: The environment that the API is invoked under.
2124 * @param level: The memory pressure level set to the current VM.
2125 * @return Returns JSVM_OK if the API succeeded.
2134 * @param env: The environment that the API is invoked under.
2137 * resp. reject the associated promise.
2138 * @param promise: The JavaScript promise associated with the deferred object.
2139 * @return Returns JSVM_OK if the API succeeded.
2147 * @brief This API resolves a JavaScript promise by way of the deferred object with
2149 * for which the corresponding deferred object is available. This effectively means
2150 * that the promise must have been created using OH_JSVM_CreatePromise() and the deferred
2153 * @param env: The environment that the API is invoked under.
2154 * @param deferred: The deferred object whose associated promise to resolve.
2155 * @param resolution: The value with which to resolve the promise.
2156 * @return Returns JSVM_OK if the API succeeded.
2164 * @brief This API rejects a JavaScript promise by way of the deferred object with
2166 * for which the corresponding deferred object is available. This effectively means
2167 * that the promise must have been created using OH_JSVM_CreatePromise() and the deferred
2170 * @param env: The environment that the API is invoked under.
2171 * @param deferred: The deferred object whose associated promise to resolve.
2172 * @param rejection: The value with which to reject the promise.
2173 * @return Returns JSVM_OK if the API succeeded.
2182 * @param env: The environment that the API is invoked under.
2183 * @param value: The value to examine
2185 * @return Returns JSVM_OK if the API succeeded.
2194 * @param env: The environment that the API is invoked under.
2195 * @param jsonString: The string to parse.
2196 * @param result: The parse value if successful.
2197 * @return Returns JSVM_OK if the API succeeded.
2205 * @brief This API stringifies the object and returns it as string if successful.
2206 * @param env: The environment that the API is invoked under.
2207 * @param jsonObject: The object to stringify.
2208 * @param result: The string if successfully stringified.
2209 * @return Returns JSVM_OK if the API succeeded.
2217 * @brief This API create the startup snapshot of the VM.
2218 * @param vm: The environment that the API is invoked under.
2219 * @param contextCount: The object to stringify.
2220 * @param contexts: The array of contexts to add to the snapshot.
2221 * @param blobData: The snapshot data.
2222 * @param blobSize: The size of snapshot data.
2223 * @return Returns JSVM_OK if the API succeeded.
2233 * @brief This function returns a set of statistics data of the heap of the VM.
2235 * @param vm: The VM whose heap statistics are returned.
2236 * @param result: The heap statistics data.
2237 * @return Returns JSVM_OK if the API succeeded.
2246 * @param vm: The VM to start CPU profiler for.
2247 * @param result: The pointer to the CPU profiler.
2248 * @return Returns JSVM_OK if the API succeeded.
2255 * @brief This function stops the CPU profiler and output to the stream.
2257 * @param vm: THe VM to start CPU profiler for.
2258 * @param profiler: The CPU profiler to stop.
2259 * @param stream: The output stream callback for receiving the data.
2260 * @param streamData: Optional data to be passed to the stream callback.
2261 * @return Returns JSVM_OK if the API succeeded.
2270 * @brief This funciton takes the current heap snapshot and output to the stream.
2272 * @param vm: The VM whose heap snapshot is taken.
2273 * @param stream: The output stream callback for receiving the data.
2274 * @param streamData: Optional data to be passed to the stream callback.
2275 * @return Returns JSVM_OK if the API succeeded.
2285 * @param env: The environment that the API is invoked under.
2286 * @param host: The host to listen to for inspector connections.
2287 * @param port: The port to listen to for inspector connections.
2288 * @return Returns JSVM_OK if the API succeeded.
2298 * @param env: The environment that the API is invoked under.
2299 * @return Returns JSVM_OK if the API succeeded.
2308 * @param env: The environment that the API is invoked under.
2309 * @param breakNextLine: Whether break on the next line of JavaScript code.
2310 * @return Returns JSVM_OK if the API succeeded.
2317 * @brief When packaging C++classes, the C++constructor callback passed through the constructor
2318 * triggers the corresponding callback function when getter, setter, call, and other
2319 * behaviors occur on the instance object, handles the user's custom behavior, and then wraps
2320 * the new C++instance in a JavaScript object and returns the wrapper object.
2322 * @param env: The environment that the API is invoked under.
2323 * @param utf8name: Name of the JavaScript constructor function. For clarity, it is
2324 * recommended to use the C++ class name when wrapping a C++ class.
2325 * @param length: The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it
2327 …* @param constructor: Struct include callback function that handles constructing instances of the
2328 * When wrapping a C++ class, this method must be a static member with the JSVM_Callback.callback
2330 * Include Optional data to be passed to the constructor callback as the data
2331 * property of the callback info. JSVM_Callback provides more details.
2332 * @param propertyCount: Number of items in the properties array argument.
2334 * properties, accessors, and methods on the class See JSVM_PropertyDescriptor.
2335 * @param propertyHandlerCfg: The instance object triggers the corresponding callback function.
2337 * @param result: A JSVM_Value representing the constructor function for the class.
2338 * @return Returns JSVM_OK if the API succeeded.
2352 * @brief Determines whether the current thread holds the lock for the specified environment.
2353 * Only threads that hold locks can use the environment.
2355 * @param env: The environment that the API is invoked under.
2356 …* @param isLocked: Flag indicating whether the current thread holds the lock for the specified env…
2357 * @return Returns JSVM_OK if the API succeeded.
2364 …* @brief Acquire the lock for the specified environment. Only threads that hold locks can use the
2366 * @param env: The environment that the API is invoked under.
2367 * @return Returns JSVM_OK if the API succeeded.
2373 …* @brief Release the lock for the specified environment. Only threads that hold locks can use the
2375 * @param env: The environment that the API is invoked under.
2376 * @return Returns JSVM_OK if the API succeeded.
2382 * @brief Starts the running of the task queue inside the VM.
2385 * @param env: The VM instance on which to start the task queue.
2386 * @param result: Whether the task queue was successfully started.
2387 * @return Returns JSVM_OK if the API succeeded.
2394 …* @brief Check to see if there are any microtasks waiting in the queue, and if there are, execute …
2396 * @param env: The VM instance on which to check microtasks.
2397 * @return Returns JSVM_OK if the API succeeded.
2403 * @brief This API checks if the value passed in is callable.
2405 * @param env: The VM instance on which to check microtasks.
2406 * @param value: The JavaScript value to check.
2407 * @param isCallable: Whether the given value is callable.
2408 * @return Returns JSVM_OK if the API succeeded.
2415 * @brief This API checks if the value passed in is undefined.
2418 * @param env: The VM instance on which to check microtasks.
2419 * @param value: The JavaScript value to check.
2420 * @param isUndefined: Whether the given value is Undefined.
2429 * @brief This API checks if the value passed in is a null object.
2432 * @param env: The VM instance on which to check microtasks.
2433 * @param value: The JavaScript value to check.
2434 * @param isNull: Whether the given value is Null.
2443 * @brief This API checks if the value passed in is either a null or an undefined object.
2446 * @param env: The VM instance on which to check microtasks.
2447 * @param value: The JavaScript value to check.
2448 * @param isNullOrUndefined: Whether the given value is Null or Undefined.
2457 * @brief This API checks if the value passed in is a boolean.
2460 * @param env: The VM instance on which to check microtasks.
2461 * @param value: The JavaScript value to check.
2462 * @param isBoolean: Whether the given value is Boolean.
2471 * @brief This API checks if the value passed in is a number.
2474 * @param env: The VM instance on which to check microtasks.
2475 * @param value: The JavaScript value to check.
2476 * @param isNumber: Whether the given value is Number.
2485 * @brief This API checks if the value passed in is a string.
2488 * @param env: The VM instance on which to check microtasks.
2489 * @param value: The JavaScript value to check.
2490 * @param isString: Whether the given value is String.
2499 * @brief This API checks if the value passed in is a symbol.
2502 * @param env: The VM instance on which to check microtasks.
2503 * @param value: The JavaScript value to check.
2504 * @param isSymbol: Whether the given value is Symbol.
2513 * @brief This API checks if the value passed in is a function.
2516 * @param env: The VM instance on which to check microtasks.
2517 * @param value: The JavaScript value to check.
2518 * @param isFunction: Whether the given value is Function.
2527 * @brief This API checks if the value passed in is an object.
2529 * @param env: The VM instance on which to check microtasks.
2530 * @param value: The JavaScript value to check.
2531 * @param isObject: Whether the given value is Object.
2540 * @brief This API checks if the value passed in is a bigInt.
2543 * @param env: The VM instance on which to check microtasks.
2544 * @param value: The JavaScript value to check.
2545 * @param isBigInt: Whether the given value is BigInt.
2554 * @brief This API implements the abstract operation `ToBigInt()`.
2556 * @param env: The environment that the API is invoked under.
2557 * @param value: The JavaScript value to coerce.
2558 * @param result: JSVM_Value representing the coerced JavaScript BigInt.
2559 * @return Returns JSVM_OK if the API succeeded. Returns JSVM_BIGINT_EXPECTED if the
2568 * @brief This API checks if the value passed in is a JavaScript RegExp object.
2570 * @param env: The environment that the API is invoked under.
2571 * @param value: The JavaScript value to check.
2572 * @param result: Whether the given value is RegExp.
2573 * @return Returns JSVM_OK if the API succeeded.
2583 * @param env: The environment that the API is invoked under.
2584 …* @param funcName: A string containing the function's name. Pass NULL to create an anonymous funct…
2585 * @param length: The length of the funcName in bytes, or JSVM_AUTO_LENGTH if it
2587 * @param argc: The count of elements in the argv array.
2588 …* @param argv: Array of JSVM_Values representing JavaScript strings passed in as arguments to the
2589 * @param script: A JavaScript string containing the script to use as the function's body.
2590 * @param result: JSVM_Value representing the JavaScript function object for the newly
2592 …* @return Returns JSVM_OK if the API succeeded. Returns JSVM_GENERIC_FAILURE if the input script f…
2607 * @param env: The environment that the API is invoked under.
2609 * @return Returns JSVM_OK if the API succeeded.
2616 * @brief This API checks if the value passed in is a Set.
2618 * @param env: The environment that the API is invoked under.
2619 * @param value: The JavaScript value to check.
2620 * @param isSet: Whether the given value is Set.
2621 * @return Returns JSVM_OK if the API succeeded.
2629 * @brief This API returns the Object prototype.
2631 * @param env: The environment that the API is invoked under.
2633 * @param result: JSVM_Value representing prototype of the given object.
2634 * @return Returns JSVM_OK if the API succeeded.
2642 * @brief This API set the prototype on the Object passed in.
2644 * @param env: The environment that the API is invoked under.
2645 * @param object: The object on which to set the prototype.
2646 * @param prototype: The prototype value.
2647 * @return Returns JSVM_OK if the API succeeded.
2656 * beyond the current scope.
2658 * @param env: The environment that the API is invoked under.
2659 * @param script: A JavaScript string containing the script to be retained.
2661 * {@link JSVM_OK } if the API succeeded. \n
2662 * {@link JSVM_INVALID_ARG } if the script is empty or already retained. \n
2668 * @brief This function release the script retained by OH_JSVM_RetainScript
2670 * @param env: The environment that the API is invoked under.
2671 * @param script: A JavaScript string containing the script to be retained.
2673 * {@link JSVM_OK } if the API succeeded. \n
2674 * {@link JSVM_INVALID_ARG } if the script is empty or not retained. \n
2682 * @param env: The environment that the API is invoked under.
2683 * @param pid: A process id to identify the inspector connection.
2684 * @param name: An alias for the inspector that under a specific pid.
2687 * Returns {@link JSVM_OK } if the function executed successfully.\n
2696 * @brief This API checks if the value passed in is a constructor.
2698 * @param env: The environment that the API is invoked under.
2699 * @param value: The JavaScript value to check.
2700 * @param isConstructor: Whether the given value is Constructor.
2701 * @return Returns JSVM_OK if the API succeeded. Returns JSVM_INVALID_ARG if the API failed.
2709 * @brief This API returns the JavaScript value of the regular expression
2710 * corresponding to the input.
2711 * The interface may throw an exception.
2713 * @param env: The environment that the API is invoked under.
2714 * @param value: The JavaScript string to convert to a regular expression.
2717 * @return Returns JSVM_OK if the API succeeded.
2718 * Returns JSVM_PENDING_EXCPTION or JSVM_INVALID_ARG or JSVM_GENERIC_FAILURE if the API failed.
2729 * @param env: The environment that the API is invoked under.
2731 * @return Returns JSVM_OK if the API succeeded. Returns JSVM_INVALID_ARG if the API failed.
2737 * @brief This API checks if the value passed in is a Map.
2739 * @param env: The environment that the API is invoked under.
2740 * @param value: The JavaScript value to check.
2741 * @param isMap: Whether the given value is Map.
2742 * @return Returns JSVM_OK if the API succeeded. Returns JSVM_INVALID_ARG if the API failed.
2753 * @param env: The environment that the API is invoked under.
2758 * @param cacheRejected: Output parameter representing whether the provided cacheData is rejected.
2761 * Returns {@link JSVM_OK } if the function executed successfully.\n
2777 * @brief Compile the function with the specified index in the WebAssembly module
2778 * into the specified optimization level.
2780 * @param env: The environment that the API is invoked under.
2781 * @param wasmModule: The WebAssembly module to which the function to compiled belongs.
2782 * @param functionIndex: The index of the function to be compiled, should never be out of range.
2783 * @param optLevel: Optimization level the function will be compiled with.
2785 * Returns {@link JSVM_OK } if the function executed successfully.\n
2798 * @brief Check whether the given JSVM_Value is a WebAssembly module.
2800 * @param env: The environment that the API is invoked under.
2801 * @param value: The JavaScript value to check.
2802 * @param result: Whether the given value is a WebAssembly module.
2804 * Returns {@link JSVM_OK } if the function executed successfully.\n
2805 * Returns {@link JSVM_INVALID_ARG } if any of the input arguments is NULL.\n
2816 * @param env: The environment that the API is invoked under.
2817 * @param wasmModule: The compiled WebAssembly module.
2821 * Returns {@link JSVM_OK } if the function executed successfully.\n
2822 * Returns {@link JSVM_INVALID_ARG } if any of the input arguments is NULL.\n
2835 * @param env: The environment that the API is invoked under.
2836 * @param cacheData: The cache data to be released, double free is undefined behaviors.
2837 * @param cacheType: The type of cache data.
2839 * Returns {@link JSVM_OK } if the function executed successfully.\n
2840 …* Returns {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL or cacheType i…