mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Fix includes in source/scriptinterface
Make include-what-you-use happy with files in source/scriptinterface and fix what needs to be fixed. Ref: #8086 Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
parent
32fd10691d
commit
b066bb0b99
27 changed files with 328 additions and 86 deletions
|
|
@ -18,19 +18,39 @@
|
|||
#ifndef INCLUDED_FUNCTIONWRAPPER
|
||||
#define INCLUDED_FUNCTIONWRAPPER
|
||||
|
||||
#include "ScriptConversions.h"
|
||||
#include "ScriptExceptions.h"
|
||||
#include "ScriptRequest.h"
|
||||
#include "lib/types.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
#include "scriptinterface/ScriptExceptions.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <exception>
|
||||
#include <fmt/format.h>
|
||||
#include <js/CallAndConstruct.h>
|
||||
#include <js/CallArgs.h>
|
||||
#include <js/Class.h>
|
||||
#include <js/GCVector.h>
|
||||
#include <js/Object.h>
|
||||
#include <js/PropertyAndElement.h>
|
||||
#include <js/PropertyDescriptor.h>
|
||||
#include <js/PropertySpec.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <jsapi.h>
|
||||
#include <memory>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
class JSFunction;
|
||||
class JSObject;
|
||||
class ScriptInterface;
|
||||
namespace JS { class GCContext; }
|
||||
struct JSContext;
|
||||
|
||||
/**
|
||||
* This class introduces templates to conveniently wrap C++ functions in JSNative functions.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2023 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -19,18 +19,26 @@
|
|||
|
||||
#include "JSON.h"
|
||||
|
||||
#include "lib/file/vfs/vfs_path.h"
|
||||
#include "lib/status.h"
|
||||
#include "lib/types.h"
|
||||
#include "lib/utf8.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "ps/Errors.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/ScriptExceptions.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
#include "scriptinterface/ScriptTypes.h"
|
||||
|
||||
#include <js/Exception.h>
|
||||
#include <js/JSON.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/Value.h>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include "js/JSON.h"
|
||||
|
||||
bool Script::ParseJSON(const ScriptRequest& rq, const std::string& string_utf8, JS::MutableHandleValue out)
|
||||
{
|
||||
std::wstring attrsW = wstring_from_utf8(string_utf8);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2021 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -18,8 +18,7 @@
|
|||
#ifndef INCLUDED_SCRIPTINTERFACE_JSON
|
||||
#define INCLUDED_SCRIPTINTERFACE_JSON
|
||||
|
||||
#include "ScriptForward.h"
|
||||
|
||||
#include <js/TypeDecls.h>
|
||||
#include <string>
|
||||
|
||||
class Path;
|
||||
|
|
|
|||
|
|
@ -19,18 +19,41 @@
|
|||
|
||||
#include "ModuleLoader.h"
|
||||
|
||||
#include "js/Modules.h"
|
||||
#include "lib/file/file_system.h"
|
||||
#include "lib/file/vfs/vfs.h"
|
||||
#include "lib/os_path.h"
|
||||
#include "lib/status.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "ps/Errors.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
#include "scriptinterface/Promises.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
#include "scriptinterface/ScriptExceptions.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include "js/Modules.h"
|
||||
#include <algorithm>
|
||||
#include <filesystem>
|
||||
#include <fmt/format.h>
|
||||
#include <js/CallArgs.h>
|
||||
#include <js/Class.h>
|
||||
#include <js/CompileOptions.h>
|
||||
#include <js/Object.h>
|
||||
#include <js/Promise.h>
|
||||
#include <js/SourceText.h>
|
||||
#include <js/Value.h>
|
||||
#include <jsapi.h>
|
||||
#include <numeric>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
class JSObject;
|
||||
namespace mozilla { union Utf8Unit; }
|
||||
struct JSContext;
|
||||
|
||||
namespace Script
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,18 +19,27 @@
|
|||
#define INCLUDED_SCRIPTMODULELOADER
|
||||
|
||||
#include "lib/file/vfs/vfs_path.h"
|
||||
#include "lib/path.h"
|
||||
#include "scriptinterface/ScriptTypes.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <exception>
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <tuple>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
class JSObject;
|
||||
class ScriptContext;
|
||||
class ScriptInterface;
|
||||
class ScriptRequest;
|
||||
namespace JS { class Value; }
|
||||
struct JSContext;
|
||||
|
||||
namespace Script
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,11 +18,28 @@
|
|||
#ifndef INCLUDED_SCRIPTINTERFACE_OBJECT
|
||||
#define INCLUDED_SCRIPTINTERFACE_OBJECT
|
||||
|
||||
#include "ScriptConversions.h"
|
||||
#include "ScriptRequest.h"
|
||||
#include "ScriptTypes.h"
|
||||
|
||||
#include "lib/posix/posix_types.h"
|
||||
#include "lib/types.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
#include "scriptinterface/ScriptTypes.h"
|
||||
|
||||
#include <cwchar>
|
||||
#include <js/Array.h>
|
||||
#include <js/GCVector.h>
|
||||
#include <js/Id.h>
|
||||
#include <js/PropertyAndElement.h>
|
||||
#include <js/PropertyDescriptor.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <jsapi.h>
|
||||
#include <jsfriendapi.h>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
/**
|
||||
* Wraps SM APIs for manipulating JS objects.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2024 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -20,11 +20,21 @@
|
|||
#include "Promises.h"
|
||||
|
||||
#include "lib/debug.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include <js/CallAndConstruct.h>
|
||||
#include <js/GlobalObject.h>
|
||||
#include <js/Promise.h>
|
||||
#include <js/Value.h>
|
||||
#include <js/ValueArray.h>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
struct JSContext;
|
||||
|
||||
namespace Script
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2024 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -18,11 +18,14 @@
|
|||
#ifndef INCLUDED_SCRIPTINTERFACE_JOBQUEUE
|
||||
#define INCLUDED_SCRIPTINTERFACE_JOBQUEUE
|
||||
|
||||
#include "js/Promise.h"
|
||||
|
||||
#include <js/Promise.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/UniquePtr.h>
|
||||
#include <queue>
|
||||
|
||||
class ScriptInterface;
|
||||
struct JSContext;
|
||||
|
||||
namespace Script
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,17 +19,30 @@
|
|||
|
||||
#include "ScriptContext.h"
|
||||
|
||||
#include "js/Modules.h"
|
||||
#include "js/friend/PerformanceHint.h"
|
||||
#include "lib/alignment.h"
|
||||
#include "ps/GameSetup/Config.h"
|
||||
#include "lib/debug.h"
|
||||
#include "ps/Profile.h"
|
||||
#include "ps/Profiler2.h"
|
||||
#include "ps/ThreadUtil.h"
|
||||
#include "scriptinterface/ModuleLoader.h"
|
||||
#include "scriptinterface/Promises.h"
|
||||
#include "scriptinterface/ScriptExtraHeaders.h"
|
||||
#include "scriptinterface/ScriptEngine.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptExtraHeaders.h"
|
||||
|
||||
#include "js/friend/PerformanceHint.h"
|
||||
#include "js/Modules.h"
|
||||
#include <js/Context.h>
|
||||
#include <js/GCAPI.h>
|
||||
#include <js/Initialization.h>
|
||||
#include <js/Promise.h>
|
||||
#include <js/SliceBudget.h>
|
||||
#include <js/Stack.h>
|
||||
#include <jsapi.h>
|
||||
#include <jsfriendapi.h>
|
||||
|
||||
namespace JS { class Realm; }
|
||||
struct JSContext;
|
||||
struct JSRuntime;
|
||||
|
||||
void GCSliceCallbackHook(JSContext*, JS::GCProgress progress, const JS::GCDescription&)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2024 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -18,10 +18,15 @@
|
|||
#ifndef INCLUDED_SCRIPTCONTEXT
|
||||
#define INCLUDED_SCRIPTCONTEXT
|
||||
|
||||
#include "ScriptTypes.h"
|
||||
#include "ScriptExtraHeaders.h"
|
||||
#include "scriptinterface/ScriptExtraHeaders.h"
|
||||
#include "scriptinterface/ScriptTypes.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
|
||||
namespace JS { class Realm; }
|
||||
struct JSContext;
|
||||
|
||||
// Those are minimal defaults. The runtime for the main game is larger and GCs upon a larger growth.
|
||||
constexpr int DEFAULT_CONTEXT_SIZE = 16 * 1024 * 1024;
|
||||
|
|
|
|||
|
|
@ -18,15 +18,19 @@
|
|||
#include "precompiled.h"
|
||||
|
||||
#include "ScriptConversions.h"
|
||||
#include "ScriptExceptions.h"
|
||||
#include "ScriptExtraHeaders.h"
|
||||
|
||||
#include "graphics/Entity.h"
|
||||
#include "lib/file/vfs/vfs_path.h"
|
||||
#include "maths/Vector2D.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "lib/path.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "scriptinterface/ScriptExceptions.h"
|
||||
#include "scriptinterface/ScriptExtraHeaders.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <js/Conversions.h>
|
||||
#include <js/GCAPI.h>
|
||||
#include <js/String.h>
|
||||
#include <jsapi.h>
|
||||
#include <string>
|
||||
|
||||
// Catch the raised exception right away to ensure the stack trace gets printed.
|
||||
|
|
|
|||
|
|
@ -18,14 +18,24 @@
|
|||
#ifndef INCLUDED_SCRIPTCONVERSIONS
|
||||
#define INCLUDED_SCRIPTCONVERSIONS
|
||||
|
||||
#include "lib/code_generation.h"
|
||||
#include "lib/debug.h"
|
||||
#include "ScriptRequest.h"
|
||||
#include "ScriptExceptions.h"
|
||||
#include "ScriptExtraHeaders.h" // for typed arrays
|
||||
#include "lib/types.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "scriptinterface/ScriptExceptions.h"
|
||||
#include "scriptinterface/ScriptExtraHeaders.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include <js/Array.h>
|
||||
#include <js/PropertyAndElement.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <js/experimental/TypedData.h>
|
||||
#include <limits>
|
||||
#include <optional>
|
||||
#include <type_traits>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace Script
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2020 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -18,13 +18,15 @@
|
|||
#ifndef INCLUDED_SCRIPTENGINE
|
||||
#define INCLUDED_SCRIPTENGINE
|
||||
|
||||
#include "ScriptTypes.h"
|
||||
#include "lib/debug.h"
|
||||
#include "ps/Singleton.h"
|
||||
#include "scriptinterface/ScriptTypes.h"
|
||||
|
||||
#include "js/Initialization.h"
|
||||
|
||||
#include <js/Initialization.h>
|
||||
#include <list>
|
||||
|
||||
struct JSContext;
|
||||
|
||||
/**
|
||||
* A class using the RAII (Resource Acquisition Is Initialization) idiom to manage initialization
|
||||
* and shutdown of the SpiderMonkey script engine. It also keeps a count of active script contexts
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2021 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -20,11 +20,25 @@
|
|||
|
||||
#include "ScriptExceptions.h"
|
||||
|
||||
#include "lib/code_annotation.h"
|
||||
#include "lib/debug.h"
|
||||
#include "lib/secure_crt.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include <cstdarg>
|
||||
#include <js/CharacterEncoding.h>
|
||||
#include <js/ErrorReport.h>
|
||||
#include <js/Exception.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
bool ScriptException::IsPending(const ScriptRequest& rq)
|
||||
{
|
||||
return JS_IsExceptionPending(rq.cx);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2020 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -18,8 +18,6 @@
|
|||
#ifndef INCLUDED_SCRIPTEXCEPTIONS
|
||||
#define INCLUDED_SCRIPTEXCEPTIONS
|
||||
|
||||
struct JSContext;
|
||||
class JSErrorReport;
|
||||
class ScriptRequest;
|
||||
|
||||
namespace ScriptException
|
||||
|
|
|
|||
|
|
@ -20,11 +20,15 @@
|
|||
#include "ScriptInterface.h"
|
||||
|
||||
#include "lib/debug.h"
|
||||
#include "lib/file/vfs/vfs_path.h"
|
||||
#include "lib/file/vfs/vfs_util.h"
|
||||
#include "lib/utf8.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "ps/Profile.h"
|
||||
#include "ps/Profiler2.h"
|
||||
#include "ps/ThreadUtil.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/ModuleLoader.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
|
|
@ -33,8 +37,27 @@
|
|||
#include "scriptinterface/ScriptStats.h"
|
||||
#include "scriptinterface/StructuredClone.h"
|
||||
|
||||
#include <map>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <js/CallAndConstruct.h>
|
||||
#include <js/Class.h>
|
||||
#include <js/ComparisonOperators.h>
|
||||
#include <js/CompilationAndEvaluation.h>
|
||||
#include <js/CompileOptions.h>
|
||||
#include <js/GCVector.h>
|
||||
#include <js/GlobalObject.h>
|
||||
#include <js/PropertyAndElement.h>
|
||||
#include <js/PropertyDescriptor.h>
|
||||
#include <js/Realm.h>
|
||||
#include <js/RealmOptions.h>
|
||||
#include <js/SourceText.h>
|
||||
#include <jsapi.h>
|
||||
#include <mozilla/Maybe.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace JS { class Compartment; }
|
||||
namespace mozilla { union Utf8Unit; }
|
||||
|
||||
#define BOOST_MULTI_INDEX_DISABLE_SERIALIZATION
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
|
|
|
|||
|
|
@ -18,14 +18,39 @@
|
|||
#ifndef INCLUDED_SCRIPTINTERFACE
|
||||
#define INCLUDED_SCRIPTINTERFACE
|
||||
|
||||
#include "lib/code_annotation.h"
|
||||
#include "lib/posix/posix_types.h"
|
||||
#include "lib/types.h"
|
||||
#include "ps/Errors.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
#include "scriptinterface/ScriptExceptions.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
#include "scriptinterface/ScriptTypes.h"
|
||||
|
||||
#include <unordered_map>
|
||||
#include <functional>
|
||||
#include <js/CallArgs.h>
|
||||
#include <js/Object.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <js/ValueArray.h>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
|
||||
class JSObject;
|
||||
class Path;
|
||||
class ScriptContext;
|
||||
namespace JS { class HandleValueArray; }
|
||||
namespace Script { class ModuleLoader; }
|
||||
namespace boost { namespace random { class rand48; } }
|
||||
struct JSClass;
|
||||
struct JSContext;
|
||||
struct JSFunctionSpec;
|
||||
struct JSPropertySpec;
|
||||
struct ScriptInterface_impl;
|
||||
|
||||
ERROR_GROUP(Scripting);
|
||||
ERROR_TYPE(Scripting, SetupFailed);
|
||||
|
|
@ -48,12 +73,6 @@ ERROR_TYPE(Scripting_DefineType, CreationFailed);
|
|||
// but as large as necessary for all wrapped functions)
|
||||
#define SCRIPT_INTERFACE_MAX_ARGS 8
|
||||
|
||||
namespace boost { namespace random { class rand48; } }
|
||||
class Path;
|
||||
class ScriptContext;
|
||||
class ScriptInterface;
|
||||
struct ScriptInterface_impl;
|
||||
namespace Script { class ModuleLoader; }
|
||||
using VfsPath = Path;
|
||||
|
||||
// Using a global object for the context is a workaround until Simulation, AI, etc,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2021 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -20,11 +20,14 @@
|
|||
|
||||
#include "scriptinterface/ScriptForward.h"
|
||||
|
||||
#include "js/RootingAPI.h"
|
||||
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <memory>
|
||||
|
||||
class ScriptInterface;
|
||||
namespace JS { class Realm; }
|
||||
namespace JS { class Value; }
|
||||
struct JSContext;
|
||||
|
||||
/**
|
||||
* Spidermonkey maintains some 'local' state via the JSContext* object.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2020 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -21,6 +21,9 @@
|
|||
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <js/GCAPI.h>
|
||||
|
||||
CScriptStatsTable* g_ScriptStatsTable;
|
||||
|
||||
enum
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2023 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -18,8 +18,13 @@
|
|||
#ifndef INCLUDED_SCRIPTSTATS
|
||||
#define INCLUDED_SCRIPTSTATS
|
||||
|
||||
#include "lib/code_annotation.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "ps/ProfileViewer.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
class ScriptInterface;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2021 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -17,13 +17,18 @@
|
|||
|
||||
#include "precompiled.h"
|
||||
|
||||
#include "ps/Profile.h"
|
||||
#include "ScriptExceptions.h"
|
||||
#include "ScriptInterface.h"
|
||||
#include "ScriptRequest.h"
|
||||
#include "StructuredClone.h"
|
||||
|
||||
#include "js/StructuredClone.h"
|
||||
#include "lib/debug.h"
|
||||
#include "ps/Profile.h"
|
||||
#include "scriptinterface/ScriptExceptions.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include <js/CallArgs.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/StructuredClone.h>
|
||||
|
||||
class ScriptInterface;
|
||||
|
||||
Script::StructuredClone Script::WriteStructuredClone(const ScriptRequest& rq, JS::HandleValue v)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2021 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -18,11 +18,14 @@
|
|||
#ifndef INCLUDED_SCRIPTINTERFACE_STRUCTUREDCLONE
|
||||
#define INCLUDED_SCRIPTINTERFACE_STRUCTUREDCLONE
|
||||
|
||||
#include "ScriptForward.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include <js/TypeDecls.h>
|
||||
#include <memory>
|
||||
|
||||
class JSStructuredCloneData;
|
||||
class ScriptInterface;
|
||||
namespace JS { class Value; }
|
||||
|
||||
namespace Script
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,12 +17,24 @@
|
|||
|
||||
#include "lib/self_test.h"
|
||||
|
||||
#include "lib/file/vfs/vfs.h"
|
||||
#include "lib/path.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/ModuleLoader.h"
|
||||
#include "scriptinterface/ScriptContext.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include <functional>
|
||||
#include <js/CallArgs.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
|
||||
class TestFunctionWrapper : public CxxTest::TestSuite
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,16 +18,32 @@
|
|||
#include "lib/self_test.h"
|
||||
|
||||
#include "lib/file/vfs/vfs.h"
|
||||
#include "lib/os_path.h"
|
||||
#include "lib/path.h"
|
||||
#include "lib/status.h"
|
||||
#include "lib/sysdep/dir_watch.h"
|
||||
#include "lib/sysdep/os.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/ModuleLoader.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
#include "scriptinterface/Promises.h"
|
||||
#include "scriptinterface/ScriptContext.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include <exception>
|
||||
#include <functional>
|
||||
#include <js/Promise.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
#if OS_MACOSX
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
|
@ -38,7 +54,6 @@
|
|||
#if OS_WIN || OS_WIN64 || OS_MACOSX
|
||||
#include <filesystem>
|
||||
#endif
|
||||
#include <fstream>
|
||||
|
||||
Status wdir_watch_Init();
|
||||
Status wdir_watch_Shutdown();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2024 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -17,15 +17,20 @@
|
|||
|
||||
#include "lib/self_test.h"
|
||||
|
||||
#include "lib/file/vfs/vfs.h"
|
||||
#include "lib/path.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/JSON.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
#include "scriptinterface/Promises.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptContext.h"
|
||||
#include "scriptinterface/StructuredClone.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
class TestPromises : public CxxTest::TestSuite
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,17 +17,24 @@
|
|||
|
||||
#include "lib/self_test.h"
|
||||
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
|
||||
#include "lib/file/vfs/vfs.h"
|
||||
#include "lib/path.h"
|
||||
#include "lib/types.h"
|
||||
#include "maths/Fixed.h"
|
||||
#include "maths/FixedVector2D.h"
|
||||
#include "maths/FixedVector3D.h"
|
||||
#include "maths/MathUtil.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include "jsapi.h"
|
||||
#include <cmath>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
|
||||
class TestScriptConversions : public CxxTest::TestSuite
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2021 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -17,15 +17,22 @@
|
|||
|
||||
#include "lib/self_test.h"
|
||||
|
||||
#include "lib/path.h"
|
||||
#include "lib/types.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/JSON.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
#include "scriptinterface/StructuredClone.h"
|
||||
|
||||
#include "ps/CLogger.h"
|
||||
|
||||
#include <boost/random/linear_congruential.hpp>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <string>
|
||||
|
||||
class TestScriptInterface : public CxxTest::TestSuite
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue