aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/BunObject.cpp
diff options
context:
space:
mode:
authorGravatar dave caruso <me@paperdave.net> 2023-10-16 21:22:43 -0700
committerGravatar GitHub <noreply@github.com> 2023-10-16 21:22:43 -0700
commit98d19fa6244384f7e17998b5420d724481ed3835 (patch)
tree3061ccab41196daf4194ecc385961b121f2ec06d /src/bun.js/bindings/BunObject.cpp
parenta3958190e8f106adca7fbf4ba2605056cb22aced (diff)
downloadbun-98d19fa6244384f7e17998b5420d724481ed3835.tar.gz
bun-98d19fa6244384f7e17998b5420d724481ed3835.tar.zst
bun-98d19fa6244384f7e17998b5420d724481ed3835.zip
fix(runtime): make some things more stable (partial jsc debug build) (#5881)
* make our debug assertions work * install bun-webkit-debug * more progress * ok * progress... * more debug build stuff * ok * a * asdfghjkl * fix(runtime): fix bad assertion failure in JSBufferList * ok * stuff * upgrade webkit * Update src/bun.js/bindings/JSDOMWrapperCache.h Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> * fix message for colin's changes * okay * fix cjs prototype * implement mainModule * i think this fixes it all --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Diffstat (limited to 'src/bun.js/bindings/BunObject.cpp')
-rw-r--r--src/bun.js/bindings/BunObject.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/bun.js/bindings/BunObject.cpp b/src/bun.js/bindings/BunObject.cpp
index 9d8ce6674..498b83b45 100644
--- a/src/bun.js/bindings/BunObject.cpp
+++ b/src/bun.js/bindings/BunObject.cpp
@@ -190,7 +190,7 @@ static JSValue constructPluginObject(VM& vm, JSObject* bunObject)
auto* globalObject = bunObject->globalObject();
JSFunction* pluginFunction = JSFunction::create(vm, globalObject, 1, String("plugin"_s), jsFunctionBunPlugin, ImplementationVisibility::Public, NoIntrinsic);
pluginFunction->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "clearAll"_s), 1, jsFunctionBunPluginClear, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
return pluginFunction;
}
@@ -222,33 +222,33 @@ static JSValue constructDNSObject(VM& vm, JSObject* bunObject)
JSGlobalObject* globalObject = bunObject->globalObject();
JSC::JSObject* dnsObject = JSC::constructEmptyObject(globalObject);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "lookup"_s), 2, Bun__DNSResolver__lookup, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolve"_s), 2, Bun__DNSResolver__resolve, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveSrv"_s), 2, Bun__DNSResolver__resolveSrv, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveTxt"_s), 2, Bun__DNSResolver__resolveTxt, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveSoa"_s), 2, Bun__DNSResolver__resolveSoa, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveNaptr"_s), 2, Bun__DNSResolver__resolveNaptr, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveMx"_s), 2, Bun__DNSResolver__resolveMx, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveCaa"_s), 2, Bun__DNSResolver__resolveCaa, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveNs"_s), 2, Bun__DNSResolver__resolveNs, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolvePtr"_s), 2, Bun__DNSResolver__resolvePtr, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "resolveCname"_s), 2, Bun__DNSResolver__resolveCname, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "getServers"_s), 2, Bun__DNSResolver__getServers, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "reverse"_s), 2, Bun__DNSResolver__reverse, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
dnsObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, "lookupService"_s), 2, Bun__DNSResolver__lookupService, ImplementationVisibility::Public, NoIntrinsic,
- JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ JSC::PropertyAttribute::DontDelete | 0);
return dnsObject;
}
@@ -258,7 +258,7 @@ static JSValue constructBunPeekObject(VM& vm, JSObject* bunObject)
JSC::Identifier identifier = JSC::Identifier::fromString(vm, "peek"_s);
JSFunction* peekFunction = JSFunction::create(vm, globalObject, 2, WTF::String("peek"_s), functionBunPeek, ImplementationVisibility::Public, NoIntrinsic);
JSFunction* peekStatus = JSFunction::create(vm, globalObject, 1, WTF::String("status"_s), functionBunPeekStatus, ImplementationVisibility::Public, NoIntrinsic);
- peekFunction->putDirect(vm, PropertyName(JSC::Identifier::fromString(vm, "status"_s)), peekStatus, JSC::PropertyAttribute::Function | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete | 0);
+ peekFunction->putDirect(vm, PropertyName(JSC::Identifier::fromString(vm, "status"_s)), peekStatus, JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete | 0);
return peekFunction;
}
@@ -663,6 +663,7 @@ public:
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSBunObject, Base);
return &vm.plainObjectSpace();
}
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
@@ -673,15 +674,14 @@ public:
void finishCreation(JSC::VM& vm)
{
Base::finishCreation(vm);
-
JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
}
static JSBunObject* create(JSC::VM& vm, JSGlobalObject* globalObject)
{
- auto* object = new (NotNull, JSC::allocateCell<JSBunObject>(vm)) JSBunObject(vm, createStructure(vm, globalObject, globalObject->objectPrototype()));
+ auto structure = createStructure(vm, globalObject, globalObject->objectPrototype());
+ auto* object = new (NotNull, JSC::allocateCell<JSBunObject>(vm)) JSBunObject(vm, structure);
object->finishCreation(vm);
-
return object;
}
};
@@ -702,11 +702,11 @@ public:
#undef bunObjectReadableStreamToJSONCodeGenerator
#undef bunObjectReadableStreamToTextCodeGenerator
-const JSC::ClassInfo JSBunObject::s_info = { "Bun"_s, &JSNonFinalObject::s_info, &bunObjectTable, nullptr, CREATE_METHOD_TABLE(JSBunObject) };
+const JSC::ClassInfo JSBunObject::s_info = { "Bun"_s, &Base::s_info, &bunObjectTable, nullptr, CREATE_METHOD_TABLE(JSBunObject) };
JSC::JSObject* createBunObject(VM& vm, JSObject* globalObject)
{
- return JSBunObject::create(vm, static_cast<Zig::GlobalObject*>(globalObject));
+ return JSBunObject::create(vm, jsCast<Zig::GlobalObject*>(globalObject));
}
}
1'>fix Bun.file.arrayBuffer() segmentation fault on empty file #2248 (#2249)Gravatar Ciro Spaciari 3-7/+23 2023-03-01Fix async in sqliteGravatar Colin McDonnell 1-2/+2 2023-02-28Forces a specific libdir for c-ares (#2241)Gravatar Justin Whear 1-1/+5 2023-02-28Make Bun.gc(true) more aggressiveGravatar Jarred Sumner 1-0/+3 2023-02-28Expose JSC::Options via `BUN_JSC_` prefixGravatar Jarred Sumner 6-8/+47 2023-02-28fixupGravatar Jarred Sumner 1-1/+1 2023-02-28Fix typecheckGravatar Colin McDonnell 2-1/+4 2023-02-28Fix incorrect Bun version in docs (#2236)Gravatar Derrick Farris 1-1/+1 2023-02-28just some comments fix (#2237)Gravatar Ciro Spaciari 1-4/+2 2023-02-28Add `-D`, `--dev` flags for bun install (#2240)Gravatar Justin Whear 1-9/+9 2023-02-28Document punningGravatar Colin McDonnell 1-1/+18