Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Error.isError #682

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -37928,6 +37928,12 @@ static const JSCFunctionListEntry js_error_proto_funcs[] = {
JS_PROP_STRING_DEF("message", "", JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE ),
};

static JSValue js_error_isError(JSContext *ctx, JSValue this_val,
int argc, JSValue *argv)
{
return js_bool(JS_IsError(ctx, argv[0]));
}

static JSValue js_error_get_stackTraceLimit(JSContext *ctx, JSValue this_val)
{
JSValue val;
Expand Down Expand Up @@ -37971,6 +37977,7 @@ static JSValue js_error_set_prepareStackTrace(JSContext *ctx, JSValue this_val,
}

static const JSCFunctionListEntry js_error_funcs[] = {
JS_CFUNC_DEF("isError", 1, js_error_isError ),
JS_CGETSET_DEF("stackTraceLimit", js_error_get_stackTraceLimit, js_error_set_stackTraceLimit ),
JS_CGETSET_DEF("prepareStackTrace", js_error_get_prepareStackTrace, js_error_set_prepareStackTrace ),
};
Expand Down
2 changes: 1 addition & 1 deletion test262.conf
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ destructuring-assignment
destructuring-binding
dynamic-import
error-cause
Error.isError=skip
Error.isError
explicit-resource-management=skip
exponentiation
export-star-as-namespace-from-module
Expand Down
Loading