Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Dec 29, 2024
1 parent 9adba6b commit ee35109
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/bun.js/bindings/JSDOMFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class JSDOMFile : public JSC::InternalFunction {

static JSDOMFile* create(JSC::VM& vm, JSGlobalObject* globalObject)
{
auto* zigGlobal = reinterpret_cast<Zig::GlobalObject*>(globalObject);
auto* zigGlobal = defaultGlobalObject(globalObject);
auto structure = createStructure(vm, globalObject, zigGlobal->functionPrototype());
auto* object = new (NotNull, JSC::allocateCell<JSDOMFile>(vm)) JSDOMFile(vm, structure);
object->finishCreation(vm);
Expand All @@ -65,7 +65,7 @@ class JSDOMFile : public JSC::InternalFunction {

static JSC_HOST_CALL_ATTRIBUTES JSC::EncodedJSValue construct(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
{
Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
auto* globalObject = defaultGlobalObject(lexicalGlobalObject);
JSC::VM& vm = globalObject->vm();
JSObject* newTarget = asObject(callFrame->newTarget());
auto* constructor = globalObject->JSDOMFileConstructor();
Expand All @@ -75,15 +75,15 @@ class JSDOMFile : public JSC::InternalFunction {

auto* functionGlobalObject = reinterpret_cast<Zig::GlobalObject*>(
// ShadowRealm functions belong to a different global object.
getFunctionRealm(globalObject, newTarget));
getFunctionRealm(lexicalGlobalObject, newTarget));
RETURN_IF_EXCEPTION(scope, {});
structure = InternalFunction::createSubclassStructure(
globalObject,
lexicalGlobalObject,
newTarget,
functionGlobalObject->JSBlobStructure());
}

void* ptr = JSDOMFile__construct(globalObject, callFrame);
void* ptr = JSDOMFile__construct(lexicalGlobalObject, callFrame);

if (UNLIKELY(!ptr)) {
return JSValue::encode(JSC::jsUndefined());
Expand Down
5 changes: 2 additions & 3 deletions src/bun.js/bindings/JSS3File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ extern "C" {

JSC::EncodedJSValue BUN__createJSS3FileConstructor(JSGlobalObject* lexicalGlobalObject)
{
Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);

return JSValue::encode(globalObject->JSS3FileConstructor());
return JSValue::encode(defaultGlobalObject(lexicalGlobalObject)->JSS3FileConstructor());
}
}

Expand Down Expand Up @@ -74,7 +73,7 @@ class JSS3File : public JSC::InternalFunction {

static JSS3File* create(JSC::VM& vm, JSGlobalObject* globalObject)
{
auto* zigGlobal = reinterpret_cast<Zig::GlobalObject*>(globalObject);
auto* zigGlobal = defaultGlobalObject(globalObject);
auto structure = createStructure(vm, globalObject, zigGlobal->functionPrototype());
auto* object = new (NotNull, JSC::allocateCell<JSS3File>(vm)) JSS3File(vm, structure);
object->finishCreation(vm);
Expand Down

0 comments on commit ee35109

Please sign in to comment.