Skip to content

Commit 03bbb74

Browse files
authored
fix(QuickJS): Fix release build error. (#24)
1 parent 426f564 commit 03bbb74

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/js_native_api_qjs.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,14 @@ NAPICommonStatus napi_get_null(NAPIEnv env, NAPIValue *result)
151151
return NAPICommonOK;
152152
}
153153

154+
#ifndef NDEBUG
154155
static char *const JS_GET_GLOBAL_OBJECT_EXCEPTION = "JS_GetGlobalObject() -> JS_EXCEPTION.";
155156
static char *const FUNCTION_CLASS_ID_ZERO = "functionClassId must not be 0.";
156157

157158
static char *const CONSTRUCTOR_CLASS_ID_ZERO = "constructorClassId must not be 0.";
158159
static char *const NAPI_CLOSE_HANDLE_SCOPE_ERROR = "napi_close_handle_scope() return error.";
160+
#endif
161+
159162
// NAPIGenericFailure + addValueToHandleScope
160163
NAPIErrorStatus napi_get_global(NAPIEnv env, NAPIValue *result)
161164
{
@@ -311,6 +314,7 @@ static JSValue callAsFunction(JSContext *ctx, JSValueConst thisVal, int argc, JS
311314
{
312315
NAPIErrorStatus status = napi_open_handle_scope(functionInfo->baseInfo.env, &handleScope);
313316
assert(status == NAPIErrorOK);
317+
(void)status;
314318
}
315319
// callback 调用后,返回值应当属于当前 handleScope 管理,否则业务方后果自负
316320
NAPIValue retVal = functionInfo->callback(functionInfo->baseInfo.env, &callbackInfo);
@@ -1576,6 +1580,7 @@ static JSValue callAsConstructor(JSContext *ctx, JSValueConst newTarget, int arg
15761580
{
15771581
NAPIErrorStatus status = napi_open_handle_scope(constructorInfo->functionInfo.baseInfo.env, &handleScope);
15781582
assert(status == NAPIErrorOK);
1583+
(void)status;
15791584
}
15801585
NAPIValue retVal =
15811586
constructorInfo->functionInfo.callback(constructorInfo->functionInfo.baseInfo.env, &callbackInfo);

0 commit comments

Comments
 (0)