Lines Matching refs:scope

8scope and use **OH_JSVM_CloseHandleScope** to destroy a scope. By creating a **JSVM_Value** in a s…
20 - Scope: used to ensure that the objects created within a certain scope remain active and are prope…
22 - Escapeable scope: used to return the values created within the **escapable_handle_scope** to a pa…
31 | OH_JSVM_OpenHandleScope | Opens a handle scope. **JSVM_Value** within the scope will not be g…
32 | OH_JSVM_CloseHandleScope | Closes a handle scope.|
33 …n escapable handle scope. Before this scope is closed, the object created within the scope has the…
34 | OH_JSVM_CloseEscapableHandleScope | Closes an escapable handle scope.|
35 … | Promotes a handle to a JS object so that it is valid for the lifetime of the outer scope.|
49 …**OH_JSVM_OpenHandleScope** to open a handle scope. Use **OH_JSVM_CloseHandleScope** to close a ha…
76 …local variable res ends at the end of each loop. To prevent memory leaks, scope is used to release…
79 JSVM_HandleScope scope = nullptr;
80 JSVM_Status status = OH_JSVM_OpenHandleScope(env, &scope);
81 if (status != JSVM_OK || scope == nullptr) {
88 status = OH_JSVM_CloseHandleScope(env, scope);
101 …// In the following code, obj is created within the handle scope, which is later closed by OH_JSVM…
102 // After the handle scope is closed, results can still be returned normally
104 // instead of using obj outside the handle scope.
105 // Call OH_JSVM_OpenHandleScope to create a handle scope.
106 JSVM_HandleScope scope = nullptr;
107 JSVM_Status status = OH_JSVM_OpenHandleScope(env, &scope);
112 // Create an object within the handle scope.
119 …// Close the handle scope. Then, the object handles created within the scope are automatically rel…
120 status = OH_JSVM_CloseHandleScope(env, scope);
131 // Call OH_JSVM_OpenHandleScope to create a handle scope.
132 JSVM_HandleScope scope = nullptr;
133 JSVM_Status status = OH_JSVM_OpenHandleScope(env, &scope);
138 // Create an object within the handle scope.
145 …// Close the handle scope. Then, the object handles created within the scope are automatically rel…
146 status = OH_JSVM_CloseHandleScope(env, scope);
151 …// After the handle scope is closed, add properties to the object. The previously set property 'na…
196scope, which allows the declared values in the scope to be returned to the parent scope. Use **OH_…
197 …pful for managing ArkTS objects more flexibly in C/C++, especially when passing cross-scope values.
218 // Create an escapeable handle scope.
219 JSVM_EscapableHandleScope scope = nullptr;
220 JSVM_Status status = OH_JSVM_OpenEscapableHandleScope(env, &scope);
225 // Create an object within the scope of the escapeable handle.
232 …EscapeHandle to promote the JS object handle to make it valid with the lifetime of the outer scope.
234 OH_JSVM_EscapeHandle(env, scope, obj, &escapedObj);
235 // Close the escapeable handle scope to clear resources.
236 status = OH_JSVM_CloseEscapableHandleScope(env, scope);
241 …// Use escapedObj outside the scope. Since escapedObj has escaped, the property can be set success…