1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 17:58:12 +00:00

LibJS: Begin implementing Atomics

This adds the Atomics object to the global object and sets up only its
@@toStringTag property.
This commit is contained in:
Timothy Flynn 2021-07-10 22:53:54 -04:00 committed by Linus Groh
parent df75c35d5b
commit a61723ec59
6 changed files with 57 additions and 0 deletions

View file

@ -0,0 +1,27 @@
/*
* Copyright (c) 2021, Tim Flynn <trflynn89@pm.me>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibJS/Runtime/AtomicsObject.h>
#include <LibJS/Runtime/GlobalObject.h>
namespace JS {
AtomicsObject::AtomicsObject(GlobalObject& global_object)
: Object(*global_object.object_prototype())
{
}
void AtomicsObject::initialize(GlobalObject& global_object)
{
Object::initialize(global_object);
auto& vm = this->vm();
// 25.4.15 Atomics [ @@toStringTag ], https://tc39.es/ecma262/#sec-atomics-@@tostringtag
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), "Atomics"), Attribute::Configurable);
}
}