Lines Matching refs:scope
8 框架层的scope通常用于管理JSVM_Value的生命周期。在JSVM-API中,可以使用OH_JSVM_OpenHandleScope和OH_JSVM_CloseHandleScope函数来创建…
31 | OH_JSVM_OpenHandleScope | 打开一个Handle scope,确保scope范围内的JSVM_Value不被GC回收 |
32 | OH_JSVM_CloseHandleScope | 关闭Handle scope|
33 | OH_JSVM_OpenEscapableHandleScope | 打开一个新的scope逃逸Handle scope,在关闭该scope之前创建的对象与父作用域有相同的生命周期 |
34 | OH_JSVM_CloseEscapableHandleScope | 关闭一个scope,在此scope范围外创建的对象不受父作用域保护 |
57 // 下面例子中,每次循环结束局部变量res的生命周期已结束,因此加scope及时释放其持有的js对象,防止内存泄漏
61 JSVM_HandleScope scope = nullptr;
62 JSVM_Status status = OH_JSVM_OpenHandleScope(env, &scope);
63 if (status != JSVM_OK || scope == nullptr) {
70 status = OH_JSVM_CloseHandleScope(env, scope);
99 通过接口 OH_JSVM_OpenEscapableHandleScope 创建出一个可逃逸的 handel scope,可将 1 个范围内声明的值返回到父作用域。创建的 scope 需使用 OH_…
109 JSVM_EscapableHandleScope scope = nullptr;
110 JSVM_Status status = OH_JSVM_OpenEscapableHandleScope(env, &scope);
124 OH_JSVM_EscapeHandle(env, scope, obj, &escapedObj);
126 status = OH_JSVM_CloseEscapableHandleScope(env, scope);