mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:57:35 +00:00
LibJS: Add ThrowCompletionOr versions of the JS native function macros
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all native functions were converted to the new format.
This commit is contained in:
parent
3355b52cca
commit
20163c0584
180 changed files with 1478 additions and 1472 deletions
|
@ -55,14 +55,14 @@ Value SymbolConstructor::construct(FunctionObject&)
|
|||
}
|
||||
|
||||
// 20.4.2.2 Symbol.for ( key ), https://tc39.es/ecma262/#sec-symbol.for
|
||||
JS_DEFINE_NATIVE_FUNCTION(SymbolConstructor::for_)
|
||||
JS_DEFINE_OLD_NATIVE_FUNCTION(SymbolConstructor::for_)
|
||||
{
|
||||
auto description = TRY_OR_DISCARD(vm.argument(0).to_string(global_object));
|
||||
return global_object.vm().get_global_symbol(description);
|
||||
}
|
||||
|
||||
// 20.4.2.6 Symbol.keyFor ( sym ), https://tc39.es/ecma262/#sec-symbol.keyfor
|
||||
JS_DEFINE_NATIVE_FUNCTION(SymbolConstructor::key_for)
|
||||
JS_DEFINE_OLD_NATIVE_FUNCTION(SymbolConstructor::key_for)
|
||||
{
|
||||
auto argument = vm.argument(0);
|
||||
if (!argument.is_symbol()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue