From 70b9bf743c21484b35918bb07ff2423f77207d2e Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Thu, 27 Jul 2023 22:28:28 -0700 Subject: Add `Bun.isMainThread` --- src/bun.js/bindings/ZigGlobalObject.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/bun.js/bindings/ZigGlobalObject.cpp') 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 @@ -4452,6 +4452,16 @@ void GlobalObject::installAPIGlobals(JSClassRef* globals, int count, JSC::VM& vm | 0); } + { + + 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); -- cgit v1.2.3 o/fetch-fix-with-lock'>ciro/fetch-fix-with-lock Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/src/js/out/NativeModuleImpl.h (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2023-08-31insert `enumerable: true` when neededGravatar Dylan Conway 2-11/+120
2023-08-31`bun install` correctly join dependency URLs (#4421)Gravatar Julian 6-64/+243
2023-08-31get name if not provided in `FormData.append` (#4434)Gravatar Dylan Conway 4-5/+45
2023-08-31export non-enumerable valuesGravatar Dylan Conway 2-4/+79
2023-08-31Fix vscode debug terminalGravatar Ashcon Partovi 1-21/+0