mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-24 08:59:50 +00:00
LibJS: Update spec links and steps for the Error.isError proposal
This proposal reached stage 4 and was merged into ECMA-262. See:
caa0482
This commit is contained in:
parent
979761ad82
commit
cb56ea7e24
Notes:
github-actions[bot]
2025-10-03 07:05:07 +00:00
Author: https://github.com/trflynn89
Commit: cb56ea7e24
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6372
Reviewed-by: https://github.com/gmta ✅
3 changed files with 5 additions and 13 deletions
|
|
@ -123,13 +123,15 @@ ThrowCompletionOr<GC::Ref<Object>> ErrorConstructor::construct(FunctionObject& n
|
|||
JS_ENUMERATE_NATIVE_ERRORS
|
||||
#undef __JS_ENUMERATE
|
||||
|
||||
// 20.5.2.1 Error.isError ( arg ), https://tc39.es/proposal-is-error/#sec-error.iserror
|
||||
// 20.5.2.1 Error.isError ( arg ), https://tc39.es/ecma262/#sec-error.iserror
|
||||
JS_DEFINE_NATIVE_FUNCTION(ErrorConstructor::is_error)
|
||||
{
|
||||
auto arg = vm.argument(0);
|
||||
|
||||
// 1. Return IsError(arg).
|
||||
return Value(arg.is_error());
|
||||
// 1. If arg is not an Object, return false.
|
||||
// 2. If arg does not have an [[ErrorData]] internal slot, return false.
|
||||
// 3. Return true.
|
||||
return arg.is_object() && is<Error>(arg.as_object());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue