aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/ZigGlobalObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/bindings/ZigGlobalObject.cpp')
-rw-r--r--src/bun.js/bindings/ZigGlobalObject.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp
index 746412d78..b853f585e 100644
--- a/src/bun.js/bindings/ZigGlobalObject.cpp
+++ b/src/bun.js/bindings/ZigGlobalObject.cpp
@@ -4454,6 +4454,16 @@ void GlobalObject::installAPIGlobals(JSClassRef* globals, int count, JSC::VM& vm
{
+ JSC::Identifier identifier = JSC::Identifier::fromString(vm, "isMainThread"_s);
+ object->putDirect(vm, identifier,
+ jsBoolean(scriptExecutionContext()->isMainThread()),
+ JSC::PropertyAttribute::DontDelete
+ | JSC::PropertyAttribute::ReadOnly
+ | 0);
+ }
+
+ {
+
JSC::Identifier identifier = JSC::Identifier::fromString(vm, pathToFileURLString);
object->putDirectNativeFunction(vm, this, identifier, 1, functionPathToFileURL, ImplementationVisibility::Public, NoIntrinsic,
JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);