ladybird/Userland/Libraries/LibJS/Contrib/Test262/262Object.h
Daniel Bertalan e64a8751d1 LibJS: Do not use the $ special character in file names
The dollar sign is a special character in POSIX shells and in the Ninja
build file format. If the file name contains a `$`, something goes wrong
in the escaping/unescaping of this symbol, and CMake/GCC/Clang generate
invalid dependency files where not all instances of `$` are escaped
properly. Because of this, Ninja fails to rebuild `$262Object.cpp` if
the headers included by it have changed.

Stale `$262Object.cpp.o` files have been the cause of mysterious crashes
multiple times which only go away after doing a clean build. Let's
prevent these from happening again by removing the `$` from the
filename.
2023-07-15 11:09:22 -04:00

37 lines
876 B
C++

/*
* Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibJS/Contrib/Test262/AgentObject.h>
#include <LibJS/Contrib/Test262/IsHTMLDDA.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/Object.h>
namespace JS::Test262 {
class $262Object final : public Object {
JS_OBJECT($262Object, Object);
public:
virtual ThrowCompletionOr<void> initialize(Realm&) override;
virtual ~$262Object() override = default;
private:
explicit $262Object(Realm&);
virtual void visit_edges(Visitor&) override;
GCPtr<AgentObject> m_agent;
GCPtr<IsHTMLDDA> m_is_htmldda;
JS_DECLARE_NATIVE_FUNCTION(clear_kept_objects);
JS_DECLARE_NATIVE_FUNCTION(create_realm);
JS_DECLARE_NATIVE_FUNCTION(detach_array_buffer);
JS_DECLARE_NATIVE_FUNCTION(eval_script);
};
}