mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:37:35 +00:00
LibJS: Replace standalone js_symbol() with Symbol::create()
This commit is contained in:
parent
525f22d018
commit
1dd8655514
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