Issue #2692 - Part 7: De-globalize {*}CompileOptions.

Make all users of the various *CompileOptions classes #include "js/CompileOptions.h"
so that nothing but that file has to know about these classes having a
JS_PUBLIC_API on them, that would have to be present in forward-declarations.
This commit is contained in:
Moonchild 2025-03-05 04:09:03 +01:00 committed by roytam1
commit 5fd304507d
27 changed files with 89 additions and 52 deletions

View file

@ -22,6 +22,7 @@
#include "gc/Barrier.h"
#include "gc/Rooting.h"
#include "jit/IonCode.h"
#include "js/CompileOptions.h"
#include "js/UbiNode.h"
#include "js/UniquePtr.h"
#include "vm/NativeObject.h"
@ -473,7 +474,7 @@ class ScriptSource
if (--refs == 0)
js_delete(this);
}
bool initFromOptions(ExclusiveContext* cx, const ReadOnlyCompileOptions& options,
bool initFromOptions(ExclusiveContext* cx, const JS::ReadOnlyCompileOptions& options,
mozilla::Maybe<uint32_t> parameterListEnd = mozilla::Nothing());
bool setSourceCopy(ExclusiveContext* cx,
JS::SourceBufferHolder& srcBuf,
@ -655,7 +656,7 @@ class ScriptSourceObject : public NativeObject
// Initialize those properties of this ScriptSourceObject whose values
// are provided by |options|, re-wrapping as necessary.
static bool initFromOptions(JSContext* cx, HandleScriptSource source,
const ReadOnlyCompileOptions& options);
const JS::ReadOnlyCompileOptions& options);
ScriptSource* source() const {
return static_cast<ScriptSource*>(getReservedSlot(SOURCE_SLOT).toPrivate());