diff --git a/src/bun.js/api/zlib.classes.ts b/src/bun.js/api/zlib.classes.ts index 23a46a55e2..70581e26bc 100644 --- a/src/bun.js/api/zlib.classes.ts +++ b/src/bun.js/api/zlib.classes.ts @@ -27,7 +27,8 @@ export default [ bytesWritten: { getter: "getBytesWritten", }, - bytesRead: { // deprecated + bytesRead: { + // deprecated value: "bytesWritten", }, closed: { @@ -66,7 +67,8 @@ export default [ bytesWritten: { getter: "getBytesWritten", }, - bytesRead: { // deprecated + bytesRead: { + // deprecated value: "bytesWritten", }, closed: { @@ -108,7 +110,8 @@ export default [ bytesWritten: { getter: "getBytesWritten", }, - bytesRead: { // deprecated + bytesRead: { + // deprecated value: "bytesWritten", }, level: { @@ -161,7 +164,8 @@ export default [ bytesWritten: { getter: "getBytesWritten", }, - bytesRead: { // deprecated + bytesRead: { + // deprecated value: "bytesWritten", }, level: { diff --git a/src/bun.js/bindings/napi.cpp b/src/bun.js/bindings/napi.cpp index 6c431277fc..b2d68be3ee 100644 --- a/src/bun.js/bindings/napi.cpp +++ b/src/bun.js/bindings/napi.cpp @@ -288,7 +288,7 @@ void NapiWeakValue::setCell(JSCell* cell, WeakHandleOwner& owner, void* context) { switch (m_tag) { case WeakTypeTag::Cell: { - m_value.cell = JSC::Weak(cell, &owner, context); + m_value.cell.clear(); break; } case WeakTypeTag::String: { @@ -299,6 +299,9 @@ void NapiWeakValue::setCell(JSCell* cell, WeakHandleOwner& owner, void* context) break; } } + + m_value.cell = JSC::Weak(cell, &owner, context); + m_tag = WeakTypeTag::Cell; } void NapiWeakValue::setString(JSString* string, WeakHandleOwner& owner, void* context) diff --git a/src/bun.js/bindings/webcore/EventListener.h b/src/bun.js/bindings/webcore/EventListener.h index b50a6898ad..c164c0f170 100644 --- a/src/bun.js/bindings/webcore/EventListener.h +++ b/src/bun.js/bindings/webcore/EventListener.h @@ -60,10 +60,15 @@ public: Type type() const { return m_type; } #if ASSERT_ENABLED - virtual void checkValidityForEventTarget(EventTarget&) {} + virtual void checkValidityForEventTarget(EventTarget&) + { + } #endif - virtual JSC::JSObject* jsFunction() const { return nullptr; } + virtual JSC::JSObject* jsFunction() const + { + return nullptr; + } virtual JSC::JSObject* wrapper() const { return nullptr; } protected: diff --git a/src/bun.js/bindings/webcore/JSDOMConstructorBase.h b/src/bun.js/bindings/webcore/JSDOMConstructorBase.h index b8d16c1fe5..44c60e69ce 100644 --- a/src/bun.js/bindings/webcore/JSDOMConstructorBase.h +++ b/src/bun.js/bindings/webcore/JSDOMConstructorBase.h @@ -53,8 +53,8 @@ public: protected: JSDOMConstructorBase(JSC::VM& vm, JSC::Structure* structure, JSC::NativeFunction functionForConstruct, JSC::NativeFunction functionForCall = nullptr) : Base(vm, structure, - functionForCall ? functionForCall : callThrowTypeErrorForJSDOMConstructor, - functionForConstruct ? functionForConstruct : callThrowTypeErrorForJSDOMConstructor) + functionForCall ? functionForCall : callThrowTypeErrorForJSDOMConstructor, + functionForConstruct ? functionForConstruct : callThrowTypeErrorForJSDOMConstructor) { } }; diff --git a/src/bun.js/bindings/webcore/JSTextDecoderStream.cpp b/src/bun.js/bindings/webcore/JSTextDecoderStream.cpp index b2ab335931..d9890faa4e 100644 --- a/src/bun.js/bindings/webcore/JSTextDecoderStream.cpp +++ b/src/bun.js/bindings/webcore/JSTextDecoderStream.cpp @@ -164,7 +164,8 @@ JSC_DEFINE_CUSTOM_GETTER(jsTextDecoderStreamConstructor, (JSGlobalObject * lexic JSC::GCClient::IsoSubspace* JSTextDecoderStream::subspaceForImpl(JSC::VM& vm) { - return WebCore::subspaceForImpl(vm, [](auto& spaces) { return spaces.m_clientSubspaceForTextDecoderStream.get(); }, [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForTextDecoderStream = std::forward(space); }, [](auto& spaces) { return spaces.m_subspaceForTextDecoderStream.get(); }, [](auto& spaces, auto&& space) { spaces.m_subspaceForTextDecoderStream = std::forward(space); }); + return WebCore::subspaceForImpl( + vm, [](auto& spaces) { return spaces.m_clientSubspaceForTextDecoderStream.get(); }, [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForTextDecoderStream = std::forward(space); }, [](auto& spaces) { return spaces.m_subspaceForTextDecoderStream.get(); }, [](auto& spaces, auto&& space) { spaces.m_subspaceForTextDecoderStream = std::forward(space); }); } } diff --git a/src/bun.js/bindings/webcore/JSTextEncoderStream.cpp b/src/bun.js/bindings/webcore/JSTextEncoderStream.cpp index 319f7d5c41..caed2ea076 100644 --- a/src/bun.js/bindings/webcore/JSTextEncoderStream.cpp +++ b/src/bun.js/bindings/webcore/JSTextEncoderStream.cpp @@ -162,7 +162,8 @@ JSC_DEFINE_CUSTOM_GETTER(jsTextEncoderStreamConstructor, (JSGlobalObject * lexic JSC::GCClient::IsoSubspace* JSTextEncoderStream::subspaceForImpl(JSC::VM& vm) { - return WebCore::subspaceForImpl(vm, [](auto& spaces) { return spaces.m_clientSubspaceForTextEncoderStream.get(); }, [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForTextEncoderStream = std::forward(space); }, [](auto& spaces) { return spaces.m_subspaceForTextEncoderStream.get(); }, [](auto& spaces, auto&& space) { spaces.m_subspaceForTextEncoderStream = std::forward(space); }); + return WebCore::subspaceForImpl( + vm, [](auto& spaces) { return spaces.m_clientSubspaceForTextEncoderStream.get(); }, [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForTextEncoderStream = std::forward(space); }, [](auto& spaces) { return spaces.m_subspaceForTextEncoderStream.get(); }, [](auto& spaces, auto&& space) { spaces.m_subspaceForTextEncoderStream = std::forward(space); }); } } diff --git a/src/bun.js/bindings/webcore/MessagePortIdentifier.h b/src/bun.js/bindings/webcore/MessagePortIdentifier.h index 2d85e466a7..d7c70b627c 100644 --- a/src/bun.js/bindings/webcore/MessagePortIdentifier.h +++ b/src/bun.js/bindings/webcore/MessagePortIdentifier.h @@ -75,6 +75,7 @@ template<> struct HashTraits : GenericHashTraits static bool isDeletedValue(const WebCore::MessagePortIdentifier& slot) { return slot.processIdentifier.isHashTableDeletedValue(); } }; -template<> struct DefaultHash : MessagePortIdentifierHash {}; +template<> struct DefaultHash : MessagePortIdentifierHash { +}; } // namespace WTF diff --git a/src/bun.js/bindings/webcore/SerializedScriptValue.cpp b/src/bun.js/bindings/webcore/SerializedScriptValue.cpp index c3b936459e..823f2a46ed 100644 --- a/src/bun.js/bindings/webcore/SerializedScriptValue.cpp +++ b/src/bun.js/bindings/webcore/SerializedScriptValue.cpp @@ -2574,7 +2574,7 @@ SerializationReturnCode CloneSerializer::serialize(JSValue in) indexStack.last()++; goto objectStartVisitMember; } - mapStartState: { + mapStartState : { ASSERT(inValue.isObject()); if (inputObjectStack.size() > maximumFilterRecursion) return SerializationReturnCode::StackOverflowError; @@ -2622,7 +2622,7 @@ SerializationReturnCode CloneSerializer::serialize(JSValue in) goto mapDataStartVisitEntry; } - setStartState: { + setStartState : { ASSERT(inValue.isObject()); if (inputObjectStack.size() > maximumFilterRecursion) return SerializationReturnCode::StackOverflowError; @@ -5084,7 +5084,7 @@ DeserializationResult CloneDeserializer::deserialize() propertyNameStack.removeLast(); goto objectStartVisitMember; } - mapObjectStartState: { + mapObjectStartState : { if (outputObjectStack.size() > maximumFilterRecursion) return std::make_pair(JSValue(), SerializationReturnCode::StackOverflowError); JSMap* map = JSMap::create(m_lexicalGlobalObject->vm(), m_globalObject->mapStructure()); @@ -5113,7 +5113,7 @@ DeserializationResult CloneDeserializer::deserialize() goto mapDataStartVisitEntry; } - setObjectStartState: { + setObjectStartState : { if (outputObjectStack.size() > maximumFilterRecursion) return std::make_pair(JSValue(), SerializationReturnCode::StackOverflowError); JSSet* set = JSSet::create(m_lexicalGlobalObject->vm(), m_globalObject->setStructure()); diff --git a/test/integration/next-pages/bunfig.toml b/test/integration/next-pages/bunfig.toml index 0a8f52769c..35a6b68216 100644 --- a/test/integration/next-pages/bunfig.toml +++ b/test/integration/next-pages/bunfig.toml @@ -1,2 +1,2 @@ -[install] +[install] cache = false \ No newline at end of file diff --git a/test/js/bun/resolve/toml/toml-fixture.toml b/test/js/bun/resolve/toml/toml-fixture.toml index 5b7df33af2..bed28762b3 100644 --- a/test/js/bun/resolve/toml/toml-fixture.toml +++ b/test/js/bun/resolve/toml/toml-fixture.toml @@ -1,42 +1,42 @@ - -framework = "next" -origin = "http://localhost:5000" -inline.array = [1234, 4, 5, 6] - - -[macros] -react-relay = { "graphql" = "node_modules/bun-macro-relay/bun-macro-relay.tsx" } - -[install.scopes] -"@mybigcompany2" = { "token" = "123456", "url" = "https://registry.mybigcompany.com" } -"@mybigcompany3" = { "token" = "123456", "url" = "https://registry.mybigcompany.com", "three" = 4 } - - -[install.scopes."@mybigcompany"] -token = "123456" -url = "https://registry.mybigcompany.com" - -[bundle.packages] -"@emotion/react" = true - -[install.cache] -dir = "C:\\Windows\\System32" -dir2 = "C:\\Windows\\System32\\🏳️‍🌈" - -[dev] -foo = 123 -"foo.bar" = "baz" -"abba.baba" = "baba" -dabba = -123 -doo = 123.456 -one.two.three = 4 - -[[array]] -entry_one = "one" -entry_two = "two" - -[[array]] -entry_one = "three" - -[[array.nested]] -entry_one = "four" + +framework = "next" +origin = "http://localhost:5000" +inline.array = [1234, 4, 5, 6] + + +[macros] +react-relay = { "graphql" = "node_modules/bun-macro-relay/bun-macro-relay.tsx" } + +[install.scopes] +"@mybigcompany2" = { "token" = "123456", "url" = "https://registry.mybigcompany.com" } +"@mybigcompany3" = { "token" = "123456", "url" = "https://registry.mybigcompany.com", "three" = 4 } + + +[install.scopes."@mybigcompany"] +token = "123456" +url = "https://registry.mybigcompany.com" + +[bundle.packages] +"@emotion/react" = true + +[install.cache] +dir = "C:\\Windows\\System32" +dir2 = "C:\\Windows\\System32\\🏳️‍🌈" + +[dev] +foo = 123 +"foo.bar" = "baz" +"abba.baba" = "baba" +dabba = -123 +doo = 123.456 +one.two.three = 4 + +[[array]] +entry_one = "one" +entry_two = "two" + +[[array]] +entry_one = "three" + +[[array.nested]] +entry_one = "four" diff --git a/test/js/node/zlib/bytesWritten.test.ts b/test/js/node/zlib/bytesWritten.test.ts index 4367523403..a3727e4264 100644 --- a/test/js/node/zlib/bytesWritten.test.ts +++ b/test/js/node/zlib/bytesWritten.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from "bun:test"; +import { expect, test } from "bun:test"; import * as zlib from "zlib"; const expectStr = "abcdefghijklmnopqrstuvwxyz".repeat(2); diff --git a/test/js/node/zlib/deflate-streaming.test.ts b/test/js/node/zlib/deflate-streaming.test.ts index 26693b24d0..670b2882e8 100644 --- a/test/js/node/zlib/deflate-streaming.test.ts +++ b/test/js/node/zlib/deflate-streaming.test.ts @@ -1,6 +1,6 @@ -import { test, expect } from "bun:test"; -import zlib from "node:zlib"; +import { expect, test } from "bun:test"; import { Readable } from "node:stream"; +import zlib from "node:zlib"; test("yields data in more than one chunk", () => { const hasher_in = new Bun.CryptoHasher("sha256"); diff --git a/test/v8/v8.test.ts b/test/v8/v8.test.ts index 2a0e9ee7cc..3f1240dbc6 100644 --- a/test/v8/v8.test.ts +++ b/test/v8/v8.test.ts @@ -1,5 +1,5 @@ import { spawn, spawnSync } from "bun"; -import { afterAll, beforeAll, describe, expect, it } from "bun:test"; +import { beforeAll, describe, expect, it } from "bun:test"; import { bunEnv, bunExe, tmpdirSync } from "harness"; import assert from "node:assert"; import fs from "node:fs/promises";