1
Fork 0
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:
Linus Groh 2022-12-06 22:25:43 +00:00
parent 525f22d018
commit 1dd8655514
4 changed files with 12 additions and 15 deletions

View file

@ -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);
}
}