mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
Add Error.isError (#682)
It's strictly speaking not at phase 3 yet (almost!) but it's very easy to implement and quite useful.
This commit is contained in:
parent
2a78706484
commit
fa4d2454aa
2 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||
|
@ -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 ),
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue