mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-27 12:46:06 +00:00
LibJS: Replace standalone js_symbol() with Symbol::create()
This commit is contained in:
parent
525f22d018
commit
1dd8655514
Notes:
sideshowbarker
2024-07-17 03:40:00 +09:00
Author: https://github.com/linusg
Commit: 1dd8655514
Pull-request: https://github.com/SerenityOS/serenity/pull/16348
Reviewed-by: https://github.com/davidot ✅
4 changed files with 12 additions and 15 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
|
||||
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -16,14 +17,9 @@ Symbol::Symbol(Optional<DeprecatedString> description, bool is_global)
|
|||
{
|
||||
}
|
||||
|
||||
Symbol* js_symbol(Heap& heap, Optional<DeprecatedString> description, bool is_global)
|
||||
NonnullGCPtr<Symbol> Symbol::create(VM& vm, Optional<DeprecatedString> description, bool is_global)
|
||||
{
|
||||
return heap.allocate_without_realm<Symbol>(move(description), is_global);
|
||||
}
|
||||
|
||||
Symbol* js_symbol(VM& vm, Optional<DeprecatedString> description, bool is_global)
|
||||
{
|
||||
return js_symbol(vm.heap(), move(description), is_global);
|
||||
return *vm.heap().allocate_without_realm<Symbol>(move(description), is_global);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue