diff --git a/Cargo.lock b/Cargo.lock index 6fa7ae52ec9a..c35a5fc977e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1453,13 +1453,11 @@ dependencies = [ "bstr", "bun_alloc", "bun_core", - "bun_opaque", "const_format", "enum-map", "enumset", "libc", "scopeguard", - "strum", "thiserror", ] diff --git a/src/ast/import_record.rs b/src/ast/import_record.rs index a214e735fe39..290da2cf7f71 100644 --- a/src/ast/import_record.rs +++ b/src/ast/import_record.rs @@ -111,8 +111,6 @@ pub enum Tag { /// For Bun Kit, if a module in the server graph should actually /// crossover to the SSR graph. See bake.Framework.ServerComponents.separate_ssr_graph BakeResolveToSsrGraph, - - Tailwind, } impl Tag { diff --git a/src/ast/lib.rs b/src/ast/lib.rs index 352c854e1107..eee099255cb1 100644 --- a/src/ast/lib.rs +++ b/src/ast/lib.rs @@ -2909,7 +2909,6 @@ pub mod flags { #[derive(EnumSetType, Debug)] pub enum JSXElement { IsKeyAfterSpread, - HasAnyDynamic, } pub type JSXElementBitset = EnumSet; @@ -3171,7 +3170,7 @@ pub fn data_store_dupe_str(bytes: &[u8]) -> &'static [u8] { } /// RAII scope for [`store_ast_alloc_heap`]: `enter()` on construction, -/// `reset()` via [`Self::reset`], `exit()` on drop. +/// `exit()` on drop. #[must_use = "side-arena heap lives until this guard drops"] pub struct StoreAstAllocHeap(()); impl StoreAstAllocHeap { @@ -3180,10 +3179,6 @@ impl StoreAstAllocHeap { store_ast_alloc_heap::enter(); Self(()) } - #[inline] - pub fn reset(&self) { - store_ast_alloc_heap::reset(); - } } impl Drop for StoreAstAllocHeap { #[inline] diff --git a/src/ast/nodes.rs b/src/ast/nodes.rs index fcef6e1a8afa..dcced09020ea 100644 --- a/src/ast/nodes.rs +++ b/src/ast/nodes.rs @@ -526,11 +526,10 @@ pub const NAMESPACE_EXPORT_PART_INDEX: u32 = 0; /// Slice that stores capacity and length in the same space as a regular slice. pub type ExprNodeList = Vec; -// Arena-owned `[Stmt]` / `[Binding]` views — see `StoreSlice` doc above. +// Arena-owned `[Stmt]` view — see `StoreSlice` doc above. // A `PhantomData<&'arena ()>` can be added to `StoreSlice` later as a // one-struct change once `'arena` is threaded through `Expr`/`Stmt`/`Data`. pub type StmtNodeList = StoreSlice; -pub type BindingNodeList = StoreSlice; #[repr(u8)] #[derive(Copy, Clone, PartialEq, Eq, Debug, strum::IntoStaticStr)] @@ -1091,10 +1090,7 @@ pub type PartList<'a> = bun_alloc::ArenaVec<'a, Part>; #[derive(Copy, Clone, PartialEq, Eq, Debug)] pub enum PartTag { None, - JsxImport, Runtime, - CjsImports, - ReactFastRefresh, ReactCompiler, DirnameFilename, BunTest, diff --git a/src/js/node/readline.js b/src/js/node/readline.js index e57a2ad9e74d..73b11e6c33e3 100644 --- a/src/js/node/readline.js +++ b/src/js/node/readline.js @@ -29,7 +29,6 @@ const { FunctionPrototypeBind, FunctionPrototypeCall, ObjectDefineProperties, - ObjectSetPrototypeOf, Promise, PromiseReject, StringPrototypeSlice, diff --git a/src/js/node/repl.js b/src/js/node/repl.js index 1b13a9ae068b..727882cba818 100644 --- a/src/js/node/repl.js +++ b/src/js/node/repl.js @@ -54,7 +54,6 @@ const { ArrayPrototypePop, ArrayPrototypePush, ArrayPrototypeShift, - ArrayPrototypeSlice, ArrayPrototypeSort, Boolean, Error: MainContextError, diff --git a/src/js/node/zlib.ts b/src/js/node/zlib.ts index 2964afee7331..e4eaa66c6ec9 100644 --- a/src/js/node/zlib.ts +++ b/src/js/node/zlib.ts @@ -17,8 +17,7 @@ const ArrayPrototypeForEach = Array.prototype.forEach; const NumberIsNaN = Number.isNaN; const MathMax = Math.max; -const ArrayBufferIsView = ArrayBuffer.isView; -const isArrayBufferView = ArrayBufferIsView; +const isArrayBufferView = ArrayBuffer.isView; const isAnyArrayBuffer = b => b instanceof ArrayBuffer || b instanceof SharedArrayBuffer; const kMaxLength = $requireMap.$get("buffer")?.exports.kMaxLength ?? BufferModule.kMaxLength; diff --git a/src/js_parser/parser.rs b/src/js_parser/parser.rs index 502629f0b916..46ce914d860b 100644 --- a/src/js_parser/parser.rs +++ b/src/js_parser/parser.rs @@ -529,8 +529,8 @@ pub use crate::p::P; pub use bun_ast as js_ast; use js_ast::G; pub use js_ast::{ - B, Binding, BindingNodeIndex, BindingNodeList, E, Expr, ExprNodeIndex, ExprNodeList, LocRef, S, - Scope, Stmt, StmtNodeIndex, StmtNodeList, Symbol, + B, Binding, BindingNodeIndex, E, Expr, ExprNodeIndex, ExprNodeList, LocRef, S, Scope, Stmt, + StmtNodeIndex, StmtNodeList, Symbol, }; pub use js_ast::Op; diff --git a/src/jsc/JSPromise.rs b/src/jsc/JSPromise.rs index e25fa46db69e..f36311af6892 100644 --- a/src/jsc/JSPromise.rs +++ b/src/jsc/JSPromise.rs @@ -103,18 +103,6 @@ impl Strong { self.swap().reject(global, Ok(err)) } - /// Like `reject`, except it drains microtasks at the end of the current event loop iteration. - pub fn reject_task( - &mut self, - global: &JSGlobalObject, - val: JSValue, - ) -> Result<(), JsTerminated> { - // The safe wrapper funnels through the single audited deref in - // `enter_event_loop_scope`. - let _guard = VirtualMachine::get().enter_event_loop_scope(); - self.reject(global, Ok(val)) - } - pub fn resolve(&mut self, global: &JSGlobalObject, val: JSValue) -> Result<(), JsTerminated> { self.swap().resolve(global, val) } diff --git a/src/jsc/JSRuntimeType.rs b/src/jsc/JSRuntimeType.rs index 48c4bcd986aa..2845fb621fc6 100644 --- a/src/jsc/JSRuntimeType.rs +++ b/src/jsc/JSRuntimeType.rs @@ -8,5 +8,4 @@ pub struct JSRuntimeType(pub u16); impl JSRuntimeType { pub const NOTHING: Self = Self(0x0); - pub const UNDEFINED: Self = Self(0x2); } diff --git a/src/jsc/bindings/NodeVM.cpp b/src/jsc/bindings/NodeVM.cpp index 378247615d30..40925e56095d 100644 --- a/src/jsc/bindings/NodeVM.cpp +++ b/src/jsc/bindings/NodeVM.cpp @@ -1111,11 +1111,6 @@ void NodeVMGlobalObject::setContextifiedObject(JSC::JSObject* contextifiedObject m_sandbox.set(vm(), this, contextifiedObject); } -void NodeVMGlobalObject::sigintReceived() -{ - vm().notifyNeedTermination(); -} - void NodeVMGlobalObject::drainOwnMicrotasks() { if (!m_contextOptions.ownMicrotaskQueue) diff --git a/src/jsc/bindings/NodeVM.h b/src/jsc/bindings/NodeVM.h index 9b9076eece83..6224e80e8932 100644 --- a/src/jsc/bindings/NodeVM.h +++ b/src/jsc/bindings/NodeVM.h @@ -135,7 +135,6 @@ class NodeVMGlobalObject final : public Bun::GlobalScope { static void destroy(JSCell* cell); void setContextifiedObject(JSC::JSObject* contextifiedObject); JSObject* contextifiedObject() const { return m_sandbox.get(); } - void sigintReceived(); bool isNotContextified() const { return m_contextOptions.notContextified; } bool hasOwnMicrotaskQueue() const { return m_contextOptions.ownMicrotaskQueue; } // Performs a microtask checkpoint on this context's own queue diff --git a/src/jsc/bindings/NodeVMModule.h b/src/jsc/bindings/NodeVMModule.h index 44f0b509d70d..8c723e9e0369 100644 --- a/src/jsc/bindings/NodeVMModule.h +++ b/src/jsc/bindings/NodeVMModule.h @@ -17,9 +17,6 @@ class NodeVMModuleRequest final { JSArray* toJS(JSGlobalObject* globalObject) const; - const WTF::String& specifier() const { return m_specifier; } - const WTF::HashMap& importAttributes() const { return m_importAttributes; } - private: WTF::String m_specifier; WTF::HashMap m_importAttributes; diff --git a/src/jsc/bindings/ScriptExecutionContext.h b/src/jsc/bindings/ScriptExecutionContext.h index 5b88f4162e28..4e14e13807bb 100644 --- a/src/jsc/bindings/ScriptExecutionContext.h +++ b/src/jsc/bindings/ScriptExecutionContext.h @@ -76,22 +76,6 @@ class ScriptExecutionContext : public CanMakeWeakPtr, pu void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, JSC::Exception* exception, RefPtr&&, CachedScript* = nullptr, bool = false) { } - // void reportUnhandledPromiseRejection(JSC::JSGlobalObject&, JSC::JSPromise&, RefPtr&&) - // { - // } - -#if ENABLE(WEB_CRYPTO) - // These two methods are used when CryptoKeys are serialized into IndexedDB. As a side effect, it is also - // used for things that utilize the same structure clone algorithm, for example, message passing between - // worker and document. - - // For now these will return false. In the future, we will want to implement these similar to how WorkerGlobalScope.cpp does. - // virtual bool wrapCryptoKey(const Vector& key, Vector& wrappedKey) = 0; - // virtual bool unwrapCryptoKey(const Vector& wrappedKey, Vector& key) = 0; - bool wrapCryptoKey(const Vector& key, Vector& wrappedKey) { return false; } - bool unwrapCryptoKey(const Vector& wrappedKey, Vector& key) { return false; } -#endif - WEBCORE_EXPORT static bool postTaskTo(ScriptExecutionContextIdentifier identifier, Function&& task); WEBCORE_EXPORT static bool postTaskTo(ScriptExecutionContextIdentifier identifier, NOESCAPE const WTF::Function& betweenLookupAndEnqueue, Function&& task); WEBCORE_EXPORT static bool ensureOnContextThread(ScriptExecutionContextIdentifier, Function&& task); diff --git a/src/jsc/bindings/sqlite/JSSQLStatement.cpp b/src/jsc/bindings/sqlite/JSSQLStatement.cpp index 0b15426dde81..09cc3b05683e 100644 --- a/src/jsc/bindings/sqlite/JSSQLStatement.cpp +++ b/src/jsc/bindings/sqlite/JSSQLStatement.cpp @@ -249,7 +249,6 @@ DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(VersionSqlite3); class SQLiteSingleton { public: Vector databases; - Vector> schema_versions; }; static SQLiteSingleton* _instance = nullptr; @@ -261,7 +260,6 @@ static Vector& databases() _instance = new SQLiteSingleton(); _instance->databases = Vector(); _instance->databases.reserveInitialCapacity(4); - _instance->schema_versions = Vector>(); } return _instance->databases; diff --git a/src/jsc/bindings/sqlite/NodeSqlite.h b/src/jsc/bindings/sqlite/NodeSqlite.h index 0898d8c4fa63..e24cbfcb47aa 100644 --- a/src/jsc/bindings/sqlite/NodeSqlite.h +++ b/src/jsc/bindings/sqlite/NodeSqlite.h @@ -363,8 +363,6 @@ class JSStatementSync final : public JSC::JSDestructibleObject { bool useBigInts() const { return m_useBigInts; } bool returnArrays() const { return m_returnArrays; } - bool allowBareNamedParams() const { return m_allowBareNamedParams; } - bool allowUnknownNamedParams() const { return m_allowUnknownNamedParams; } void setUseBigInts(bool v) { m_useBigInts = v; } void setReturnArrays(bool v) { m_returnArrays = v; } void setAllowBareNamedParams(bool v) { m_allowBareNamedParams = v; } @@ -417,7 +415,6 @@ class JSStatementSync final : public JSC::JSDestructibleObject { // invalidated when the statement is reset with a different shape. JSC::Structure* ensureRowStructure(JSC::JSGlobalObject*); void invalidateRowStructure(); - JSC::Structure* rowStructure() const { return m_rowStructure.get(); } // Per-result-column index into the structure's inline slots. // Duplicate column names share the first occurrence's slot so the // later column overwrites it — last-wins, matching Node's V8 diff --git a/src/jsc/bindings/sqlite/lazy_sqlite3.h b/src/jsc/bindings/sqlite/lazy_sqlite3.h index b8edde34d572..c6b4a87d79a9 100644 --- a/src/jsc/bindings/sqlite/lazy_sqlite3.h +++ b/src/jsc/bindings/sqlite/lazy_sqlite3.h @@ -38,7 +38,6 @@ typedef int (*lazy_sqlite3_file_control_type)(sqlite3*, const char* zDbName, int typedef int (*lazy_sqlite3_extended_result_codes_type)(sqlite3*, int onoff); typedef const void* (*lazy_sqlite3_column_blob_type)(sqlite3_stmt*, int iCol); typedef double (*lazy_sqlite3_column_double_type)(sqlite3_stmt*, int iCol); -typedef int (*lazy_sqlite3_column_int_type)(sqlite3_stmt*, int iCol); typedef sqlite3_int64 (*lazy_sqlite3_column_int64_type)(sqlite3_stmt*, int iCol); typedef const unsigned char* (*lazy_sqlite3_column_text_type)(sqlite3_stmt*, int iCol); typedef int (*lazy_sqlite3_column_bytes_type)(sqlite3_stmt*, int iCol); @@ -53,7 +52,6 @@ typedef const char* (*lazy_sqlite3_errmsg_type)(sqlite3*); typedef int (*lazy_sqlite3_errcode_type)(sqlite3*); typedef int (*lazy_sqlite3_extended_errcode_type)(sqlite3*); typedef int (*lazy_sqlite3_error_offset_type)(sqlite3*); -typedef int64_t (*lazy_sqlite3_memory_used_type)(); typedef const char* (*lazy_sqlite3_errstr_type)(int); typedef char* (*lazy_sqlite3_expanded_sql_type)(sqlite3_stmt* pStmt); typedef const char* (*lazy_sqlite3_sql_type)(sqlite3_stmt* pStmt); @@ -65,7 +63,6 @@ typedef int (*lazy_sqlite3_config_type)(int, ...); typedef int (*lazy_sqlite3_open_v2_type)(const char* filename, sqlite3** ppDb, int flags, const char* zVfs); typedef int (*lazy_sqlite3_prepare_v2_type)(sqlite3* db, const char* zSql, int nByte, sqlite3_stmt** ppStmt, const char** pzTail); typedef int (*lazy_sqlite3_prepare_v3_type)(sqlite3* db, const char* zSql, int nByte, unsigned int prepFlags, sqlite3_stmt** ppStmt, const char** pzTail); -typedef int (*lazy_sqlite3_prepare16_v3_type)(sqlite3* db, const void* zSql, int nByte, unsigned int prepFlags, sqlite3_stmt** ppStmt, const void** pzTail); typedef int (*lazy_sqlite3_reset_type)(sqlite3_stmt* pStmt); typedef int (*lazy_sqlite3_step_type)(sqlite3_stmt*); typedef int (*lazy_sqlite3_db_config_type)(sqlite3*, int op, ...); @@ -150,7 +147,6 @@ inline lazy_sqlite3_column_bytes_type lazy_sqlite3_column_bytes; inline lazy_sqlite3_column_count_type lazy_sqlite3_column_count; inline lazy_sqlite3_column_decltype_type lazy_sqlite3_column_decltype; inline lazy_sqlite3_column_double_type lazy_sqlite3_column_double; -inline lazy_sqlite3_column_int_type lazy_sqlite3_column_int; inline lazy_sqlite3_column_int64_type lazy_sqlite3_column_int64; inline lazy_sqlite3_column_name_type lazy_sqlite3_column_name; inline lazy_sqlite3_column_text_type lazy_sqlite3_column_text; @@ -169,7 +165,6 @@ inline lazy_sqlite3_get_autocommit_type lazy_sqlite3_get_autocommit; inline lazy_sqlite3_open_v2_type lazy_sqlite3_open_v2; inline lazy_sqlite3_prepare_v2_type lazy_sqlite3_prepare_v2; inline lazy_sqlite3_prepare_v3_type lazy_sqlite3_prepare_v3; -inline lazy_sqlite3_prepare16_v3_type lazy_sqlite3_prepare16_v3; inline lazy_sqlite3_reset_type lazy_sqlite3_reset; inline lazy_sqlite3_step_type lazy_sqlite3_step; inline lazy_sqlite3_db_config_type lazy_sqlite3_db_config; @@ -188,7 +183,6 @@ inline lazy_sqlite3_config_type lazy_sqlite3_config; inline lazy_sqlite3_extended_result_codes_type lazy_sqlite3_extended_result_codes; inline lazy_sqlite3_extended_errcode_type lazy_sqlite3_extended_errcode; inline lazy_sqlite3_error_offset_type lazy_sqlite3_error_offset; -inline lazy_sqlite3_memory_used_type lazy_sqlite3_memory_used; inline lazy_sqlite3_bind_parameter_name_type lazy_sqlite3_bind_parameter_name; inline lazy_sqlite3_total_changes_type lazy_sqlite3_total_changes; inline lazy_sqlite3_last_insert_rowid_type lazy_sqlite3_last_insert_rowid; @@ -249,7 +243,6 @@ inline lazy_sqlite3changeset_apply_type lazy_sqlite3changeset_apply; #define sqlite3_column_count lazy_sqlite3_column_count #define sqlite3_column_decltype lazy_sqlite3_column_decltype #define sqlite3_column_double lazy_sqlite3_column_double -#define sqlite3_column_int lazy_sqlite3_column_int #define sqlite3_column_name lazy_sqlite3_column_name #define sqlite3_column_text lazy_sqlite3_column_text #define sqlite3_column_type lazy_sqlite3_column_type @@ -267,7 +260,6 @@ inline lazy_sqlite3changeset_apply_type lazy_sqlite3changeset_apply; #define sqlite3_open_v2 lazy_sqlite3_open_v2 #define sqlite3_prepare_v2 lazy_sqlite3_prepare_v2 #define sqlite3_prepare_v3 lazy_sqlite3_prepare_v3 -#define sqlite3_prepare16_v3 lazy_sqlite3_prepare16_v3 #define sqlite3_reset lazy_sqlite3_reset #define sqlite3_step lazy_sqlite3_step #define sqlite3_db_config lazy_sqlite3_db_config @@ -287,7 +279,6 @@ inline lazy_sqlite3changeset_apply_type lazy_sqlite3changeset_apply; #define sqlite3_extended_result_codes lazy_sqlite3_extended_result_codes #define sqlite3_extended_errcode lazy_sqlite3_extended_errcode #define sqlite3_error_offset lazy_sqlite3_error_offset -#define sqlite3_memory_used lazy_sqlite3_memory_used #define sqlite3_bind_parameter_name lazy_sqlite3_bind_parameter_name #define sqlite3_total_changes lazy_sqlite3_total_changes #define sqlite3_last_insert_rowid lazy_sqlite3_last_insert_rowid @@ -389,7 +380,6 @@ inline int lazyLoadSQLite() lazy_sqlite3_column_count = (lazy_sqlite3_column_count_type)dlsym(sqlite3_handle, "sqlite3_column_count"); lazy_sqlite3_column_decltype = (lazy_sqlite3_column_decltype_type)dlsym(sqlite3_handle, "sqlite3_column_decltype"); lazy_sqlite3_column_double = (lazy_sqlite3_column_double_type)dlsym(sqlite3_handle, "sqlite3_column_double"); - lazy_sqlite3_column_int = (lazy_sqlite3_column_int_type)dlsym(sqlite3_handle, "sqlite3_column_int"); lazy_sqlite3_column_int64 = (lazy_sqlite3_column_int64_type)dlsym(sqlite3_handle, "sqlite3_column_int64"); lazy_sqlite3_column_name = (lazy_sqlite3_column_name_type)dlsym(sqlite3_handle, "sqlite3_column_name"); lazy_sqlite3_column_text = (lazy_sqlite3_column_text_type)dlsym(sqlite3_handle, "sqlite3_column_text"); @@ -407,7 +397,6 @@ inline int lazyLoadSQLite() lazy_sqlite3_get_autocommit = (lazy_sqlite3_get_autocommit_type)dlsym(sqlite3_handle, "sqlite3_get_autocommit"); lazy_sqlite3_prepare_v2 = (lazy_sqlite3_prepare_v2_type)dlsym(sqlite3_handle, "sqlite3_prepare_v2"); lazy_sqlite3_prepare_v3 = (lazy_sqlite3_prepare_v3_type)dlsym(sqlite3_handle, "sqlite3_prepare_v3"); - lazy_sqlite3_prepare16_v3 = (lazy_sqlite3_prepare16_v3_type)dlsym(sqlite3_handle, "sqlite3_prepare16_v3"); lazy_sqlite3_reset = (lazy_sqlite3_reset_type)dlsym(sqlite3_handle, "sqlite3_reset"); lazy_sqlite3_step = (lazy_sqlite3_step_type)dlsym(sqlite3_handle, "sqlite3_step"); lazy_sqlite3_db_config = (lazy_sqlite3_db_config_type)dlsym(sqlite3_handle, "sqlite3_db_config"); @@ -426,7 +415,6 @@ inline int lazyLoadSQLite() lazy_sqlite3_extended_result_codes = (lazy_sqlite3_extended_result_codes_type)dlsym(sqlite3_handle, "sqlite3_extended_result_codes"); lazy_sqlite3_extended_errcode = (lazy_sqlite3_extended_errcode_type)dlsym(sqlite3_handle, "sqlite3_extended_errcode"); lazy_sqlite3_error_offset = (lazy_sqlite3_error_offset_type)dlsym(sqlite3_handle, "sqlite3_error_offset"); - lazy_sqlite3_memory_used = (lazy_sqlite3_memory_used_type)dlsym(sqlite3_handle, "sqlite3_memory_used"); lazy_sqlite3_bind_parameter_name = (lazy_sqlite3_bind_parameter_name_type)dlsym(sqlite3_handle, "sqlite3_bind_parameter_name"); lazy_sqlite3_total_changes = (lazy_sqlite3_total_changes_type)dlsym(sqlite3_handle, "sqlite3_total_changes"); lazy_sqlite3_last_insert_rowid = (lazy_sqlite3_last_insert_rowid_type)dlsym(sqlite3_handle, "sqlite3_last_insert_rowid"); @@ -482,12 +470,6 @@ inline int lazyLoadSQLite() }; } - if (!lazy_sqlite3_memory_used) { - lazy_sqlite3_memory_used = []() -> int64_t { - return 0; - }; - } - // SQLITE_ENABLE_COLUMN_METADATA is optional; fall back to nullptr- // returning stubs so callers see the same "no info" shape sqlite // returns for expressions. diff --git a/src/jsc/bindings/webcore/DOMClientIsoSubspaces.h b/src/jsc/bindings/webcore/DOMClientIsoSubspaces.h index cd8d16421a30..47f0ed50ec1b 100644 --- a/src/jsc/bindings/webcore/DOMClientIsoSubspaces.h +++ b/src/jsc/bindings/webcore/DOMClientIsoSubspaces.h @@ -23,7 +23,6 @@ class DOMClientIsoSubspaces { std::unique_ptr m_clientSubspaceForNapiClass; std::unique_ptr m_clientSubspaceForNapiPrototype; std::unique_ptr m_clientSubspaceForJSSQLStatement; - std::unique_ptr m_clientSubspaceForJSSQLStatementConstructor; std::unique_ptr m_clientSubspaceForNodeSqliteDatabaseSync; std::unique_ptr m_clientSubspaceForNodeSqliteStatementSync; std::unique_ptr m_clientSubspaceForNodeSqliteStatementSyncIterator; diff --git a/src/jsc/bindings/webcore/DOMIsoSubspaces.h b/src/jsc/bindings/webcore/DOMIsoSubspaces.h index cb936b726e63..87e8fcf3481d 100644 --- a/src/jsc/bindings/webcore/DOMIsoSubspaces.h +++ b/src/jsc/bindings/webcore/DOMIsoSubspaces.h @@ -23,7 +23,6 @@ class DOMIsoSubspaces { std::unique_ptr m_subspaceForNapiClass; std::unique_ptr m_subspaceForNapiPrototype; std::unique_ptr m_subspaceForJSSQLStatement; - std::unique_ptr m_subspaceForJSSQLStatementConstructor; std::unique_ptr m_subspaceForNodeSqliteDatabaseSync; std::unique_ptr m_subspaceForNodeSqliteStatementSync; std::unique_ptr m_subspaceForNodeSqliteStatementSyncIterator; diff --git a/src/jsc/bindings/webcrypto/CommonCryptoDERUtilities.cpp b/src/jsc/bindings/webcrypto/CommonCryptoDERUtilities.cpp index 12ac13759efe..8cd58670276a 100644 --- a/src/jsc/bindings/webcrypto/CommonCryptoDERUtilities.cpp +++ b/src/jsc/bindings/webcrypto/CommonCryptoDERUtilities.cpp @@ -37,7 +37,7 @@ size_t bytesUsedToEncodedLength(uint8_t octet) return octet - MaxLengthInOneByte + 1; } -size_t extraBytesNeededForEncodedLength(size_t length) +static size_t extraBytesNeededForEncodedLength(size_t length) { if (!length) return 0; diff --git a/src/jsc/bindings/webcrypto/CommonCryptoDERUtilities.h b/src/jsc/bindings/webcrypto/CommonCryptoDERUtilities.h index 924f89b0f690..b1961fc3fa4c 100644 --- a/src/jsc/bindings/webcrypto/CommonCryptoDERUtilities.h +++ b/src/jsc/bindings/webcrypto/CommonCryptoDERUtilities.h @@ -44,7 +44,6 @@ inline constexpr unsigned char InitialOctet = 0x00; inline constexpr size_t MaxLengthInOneByte = 128; size_t bytesUsedToEncodedLength(uint8_t); -size_t extraBytesNeededForEncodedLength(size_t); void addEncodedASN1Length(Vector&, size_t); } // namespace WebCore diff --git a/src/jsc/bindings/webcrypto/CryptoKeyAES.cpp b/src/jsc/bindings/webcrypto/CryptoKeyAES.cpp index 073775fe6f78..a89ee285beff 100644 --- a/src/jsc/bindings/webcrypto/CryptoKeyAES.cpp +++ b/src/jsc/bindings/webcrypto/CryptoKeyAES.cpp @@ -43,13 +43,6 @@ static inline bool lengthIsValid(size_t length) return (length == CryptoKeyAES::s_length128) || (length == CryptoKeyAES::s_length192) || (length == CryptoKeyAES::s_length256); } -CryptoKeyAES::CryptoKeyAES(CryptoAlgorithmIdentifier algorithm, const Vector& key, bool extractable, CryptoKeyUsageBitmap usage) - : CryptoKey(algorithm, CryptoKeyType::Secret, extractable, usage) - , m_key(key) -{ - ASSERT(isValidAESAlgorithm(algorithm)); -} - CryptoKeyAES::CryptoKeyAES(CryptoAlgorithmIdentifier algorithm, Vector&& key, bool extractable, CryptoKeyUsageBitmap usage) : CryptoKey(algorithm, CryptoKeyType::Secret, extractable, usage) , m_key(WTF::move(key)) diff --git a/src/jsc/bindings/webcrypto/CryptoKeyAES.h b/src/jsc/bindings/webcrypto/CryptoKeyAES.h index 06f5ef1c9df8..1185d8d5abf2 100644 --- a/src/jsc/bindings/webcrypto/CryptoKeyAES.h +++ b/src/jsc/bindings/webcrypto/CryptoKeyAES.h @@ -45,10 +45,6 @@ class CryptoKeyAES final : public CryptoKey { static constexpr int s_length192 = 192; static constexpr int s_length256 = 256; - static Ref create(CryptoAlgorithmIdentifier algorithm, const Vector& key, bool extractable, CryptoKeyUsageBitmap usage) - { - return adoptRef(*new CryptoKeyAES(algorithm, key, extractable, usage)); - } virtual ~CryptoKeyAES(); static bool isValidAESAlgorithm(CryptoAlgorithmIdentifier); @@ -66,7 +62,6 @@ class CryptoKeyAES final : public CryptoKey { static ExceptionOr> getKeyLength(const CryptoAlgorithmParameters&); private: - CryptoKeyAES(CryptoAlgorithmIdentifier, const Vector& key, bool extractable, CryptoKeyUsageBitmap); CryptoKeyAES(CryptoAlgorithmIdentifier, Vector&& key, bool extractable, CryptoKeyUsageBitmap); KeyAlgorithm algorithm() const final; diff --git a/src/jsc/bindings/webcrypto/CryptoKeyHMAC.cpp b/src/jsc/bindings/webcrypto/CryptoKeyHMAC.cpp index d01443e47065..c45864e3ebfe 100644 --- a/src/jsc/bindings/webcrypto/CryptoKeyHMAC.cpp +++ b/src/jsc/bindings/webcrypto/CryptoKeyHMAC.cpp @@ -60,13 +60,6 @@ static size_t getKeyLengthFromHash(CryptoAlgorithmIdentifier hash) } } -CryptoKeyHMAC::CryptoKeyHMAC(const Vector& key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap usage) - : CryptoKey(CryptoAlgorithmIdentifier::HMAC, CryptoKeyType::Secret, extractable, usage) - , m_hash(hash) - , m_key(key) -{ -} - CryptoKeyHMAC::CryptoKeyHMAC(Vector&& key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap usage) : CryptoKey(CryptoAlgorithmIdentifier::HMAC, CryptoKeyType::Secret, extractable, usage) , m_hash(hash) diff --git a/src/jsc/bindings/webcrypto/CryptoKeyHMAC.h b/src/jsc/bindings/webcrypto/CryptoKeyHMAC.h index cffa37e201ea..c9e60477be3e 100644 --- a/src/jsc/bindings/webcrypto/CryptoKeyHMAC.h +++ b/src/jsc/bindings/webcrypto/CryptoKeyHMAC.h @@ -39,11 +39,6 @@ struct JsonWebKey; class CryptoKeyHMAC final : public CryptoKey { public: - static Ref create(const Vector& key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap usage) - { - return adoptRef(*new CryptoKeyHMAC(key, hash, extractable, usage)); - } - virtual ~CryptoKeyHMAC(); static RefPtr generate(size_t lengthBits, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap); @@ -59,7 +54,6 @@ class CryptoKeyHMAC final : public CryptoKey { static ExceptionOr> getKeyLength(const CryptoAlgorithmParameters&); private: - CryptoKeyHMAC(const Vector& key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap); CryptoKeyHMAC(Vector&& key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap); KeyAlgorithm algorithm() const final; diff --git a/src/jsc/bindings/webcrypto/JSCryptoKey.h b/src/jsc/bindings/webcrypto/JSCryptoKey.h index 59f6d0837a5a..8b3ea5679906 100644 --- a/src/jsc/bindings/webcrypto/JSCryptoKey.h +++ b/src/jsc/bindings/webcrypto/JSCryptoKey.h @@ -44,8 +44,6 @@ class JSCryptoKey : public JSDOMWrapper { static CryptoKey* toWrapped(JSC::VM&, JSC::JSValue); static void destroy(JSC::JSCell*); - static JSCryptoKey* fromJS(JSGlobalObject* globalObject, JSValue value); - DECLARE_INFO; static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) diff --git a/src/jsc/bindings/webcrypto/JSSubtleCrypto.cpp b/src/jsc/bindings/webcrypto/JSSubtleCrypto.cpp index 87d05cd76d94..6e55b25ec17f 100644 --- a/src/jsc/bindings/webcrypto/JSSubtleCrypto.cpp +++ b/src/jsc/bindings/webcrypto/JSSubtleCrypto.cpp @@ -877,13 +877,6 @@ JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* g return wrap(lexicalGlobalObject, globalObject, impl); } -SubtleCrypto* JSSubtleCrypto::toWrapped(JSC::VM&, JSC::JSValue value) -{ - if (auto* wrapper = dynamicDowncast(value)) - return &wrapper->wrapped(); - return nullptr; -} - } #endif // ENABLE(WEB_CRYPTO) diff --git a/src/jsc/bindings/webcrypto/JSSubtleCrypto.h b/src/jsc/bindings/webcrypto/JSSubtleCrypto.h index 4b75ee425925..77c583a35b3b 100644 --- a/src/jsc/bindings/webcrypto/JSSubtleCrypto.h +++ b/src/jsc/bindings/webcrypto/JSSubtleCrypto.h @@ -40,7 +40,6 @@ class JSSubtleCrypto : public JSDOMWrapper { static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&); static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&); - static SubtleCrypto* toWrapped(JSC::VM&, JSC::JSValue); static void destroy(JSC::JSCell*); DECLARE_INFO; diff --git a/src/jsc/bindings/webcrypto/OpenSSLCryptoUniquePtr.h b/src/jsc/bindings/webcrypto/OpenSSLCryptoUniquePtr.h index 0ce30dee6b26..31d3b73fc62a 100644 --- a/src/jsc/bindings/webcrypto/OpenSSLCryptoUniquePtr.h +++ b/src/jsc/bindings/webcrypto/OpenSSLCryptoUniquePtr.h @@ -29,10 +29,6 @@ #include #include #include -#if OPENSSL_VERSION_NUMBER >= 0x30000000L -#include -#include -#endif #include namespace WebCore { @@ -61,13 +57,6 @@ DEFINE_OPENSSL_CRYPTO_PTR(EvpDigestCtxPtr, EVP_MD_CTX, EVP_MD_CTX_free) DEFINE_OPENSSL_CRYPTO_PTR(EvpPKeyPtr, EVP_PKEY, EVP_PKEY_free) DEFINE_OPENSSL_CRYPTO_PTR(EvpPKeyCtxPtr, EVP_PKEY_CTX, EVP_PKEY_CTX_free) -#if OPENSSL_VERSION_NUMBER >= 0x30000000L -DEFINE_OPENSSL_CRYPTO_PTR(OsslParamBldPtr, OSSL_PARAM_BLD, OSSL_PARAM_BLD_free) -DEFINE_OPENSSL_CRYPTO_PTR(OsslParamPtr, OSSL_PARAM, OSSL_PARAM_free) -DEFINE_OPENSSL_CRYPTO_PTR(EVPKDFCtxPtr, EVP_KDF_CTX, EVP_KDF_CTX_free) -DEFINE_OPENSSL_CRYPTO_PTR(EVPKDFPtr, EVP_KDF, EVP_KDF_free) -#endif // OPENSSL_VERSION_NUMBER >= 0x30000000L - // These are deprecated in OpenSSL 3. FIXME: Migrate to EvpKey. See Bug #245146. DEFINE_OPENSSL_CRYPTO_PTR(RSAPtr, RSA, RSA_free) DEFINE_OPENSSL_CRYPTO_PTR(ECKeyPtr, EC_KEY, EC_KEY_free) @@ -78,8 +67,6 @@ DEFINE_OPENSSL_CRYPTO_PTR(PKCS8PrivKeyInfoPtr, PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_K DEFINE_OPENSSL_CRYPTO_PTR(BIGNUMPtr, BIGNUM, BN_clear_free) DEFINE_OPENSSL_CRYPTO_PTR(BNCtxPtr, BN_CTX, BN_CTX_free) DEFINE_OPENSSL_CRYPTO_PTR(ECDSASigPtr, ECDSA_SIG, ECDSA_SIG_free) -DEFINE_OPENSSL_CRYPTO_PTR(X509Ptr, X509, X509_free) -DEFINE_OPENSSL_CRYPTO_PTR(BIOPtr, BIO, BIO_free) DEFINE_OPENSSL_CRYPTO_PTR_FULL(ASN1SequencePtr, ASN1_SEQUENCE_ANY, sk_ASN1_TYPE_pop_free(ptr, ASN1_TYPE_free)) diff --git a/src/platform/Cargo.toml b/src/platform/Cargo.toml index f0d9e589d9b3..0a0734354646 100644 --- a/src/platform/Cargo.toml +++ b/src/platform/Cargo.toml @@ -10,8 +10,6 @@ path = "lib.rs" workspace = true [dependencies] -bun_opaque.workspace = true -strum.workspace = true bstr.workspace = true scopeguard.workspace = true const_format.workspace = true diff --git a/src/platform/darwin.rs b/src/platform/darwin.rs deleted file mode 100644 index 1962294517b7..000000000000 --- a/src/platform/darwin.rs +++ /dev/null @@ -1,210 +0,0 @@ -//! Platform specific APIs for Darwin/macOS -//! -//! If an API can be implemented on multiple platforms, -//! it does not belong in this namespace. - -use core::ffi::c_char; -use core::sync::atomic::{AtomicU64, Ordering}; - -/// Non-cancellable versions of various libc functions are undocumented -/// TODO: explain the $NOCANCEL problem -pub mod nocancel { - use core::ffi::{c_char, c_int, c_uint, c_void}; - use libc::{iovec, off_t, pollfd, sigset_t, sockaddr, socklen_t, timespec}; - - unsafe extern "C" { - #[link_name = "recvfrom$NOCANCEL"] - pub fn recvfrom_nocancel( - sockfd: c_int, - buf: *mut c_void, - len: usize, - flags: u32, - src_addr: *mut sockaddr, - addrlen: *mut socklen_t, - ) -> isize; - - #[link_name = "sendto$NOCANCEL"] - pub fn sendto_nocancel( - sockfd: c_int, - buf: *const c_void, - len: usize, - flags: u32, - dest_addr: *const sockaddr, - addrlen: socklen_t, - ) -> isize; - - #[link_name = "fcntl$NOCANCEL"] - pub fn fcntl_nocancel(fd: c_int, cmd: c_int, ...) -> c_int; - - // #[link_name = "sendmsg$NOCANCEL"] - // pub fn sendmsg_nocancel(sockfd: c_int, msg: *const msghdr, flags: c_int) -> isize; - // #[link_name = "recvmsg$NOCANCEL"] - // pub fn recvmsg_nocancel(sockfd: c_int, msg: *mut msghdr, flags: c_int) -> isize; - - #[link_name = "connect$NOCANCEL"] - pub fn connect_nocancel( - sockfd: c_int, - sock_addr: *const sockaddr, - addrlen: socklen_t, - ) -> c_int; - - #[link_name = "accept$NOCANCEL"] - pub fn accept_nocancel( - sockfd: c_int, - addr: *mut sockaddr, - addrlen: *mut socklen_t, - ) -> c_int; - - #[link_name = "accept4$NOCANCEL"] - pub fn accept4_nocancel( - sockfd: c_int, - addr: *mut sockaddr, - addrlen: *mut socklen_t, - flags: c_uint, - ) -> c_int; - - #[link_name = "open$NOCANCEL"] - pub fn open_nocancel(path: *const c_char, oflag: c_uint, ...) -> c_int; - - // https://opensource.apple.com/source/xnu/xnu-7195.81.3/libsyscall/wrappers/open-base.c - #[link_name = "openat$NOCANCEL"] - pub fn openat_nocancel(fd: c_int, path: *const c_char, oflag: c_uint, ...) -> c_int; - - #[link_name = "read$NOCANCEL"] - pub fn read_nocancel(fd: c_int, buf: *mut u8, nbyte: usize) -> isize; - - #[link_name = "pread$NOCANCEL"] - pub fn pread_nocancel(fd: c_int, buf: *mut u8, nbyte: usize, offset: off_t) -> isize; - - #[link_name = "preadv$NOCANCEL"] - pub fn preadv_nocancel(fd: c_int, uf: *mut iovec, count: i32, offset: off_t) -> isize; - - #[link_name = "readv$NOCANCEL"] - pub fn readv_nocancel(fd: c_int, uf: *mut iovec, count: i32) -> isize; - - #[link_name = "write$NOCANCEL"] - pub fn write_nocancel(fd: c_int, buf: *const u8, nbyte: usize) -> isize; - - #[link_name = "writev$NOCANCEL"] - pub fn writev_nocancel(fd: c_int, buf: *const iovec, count: i32) -> isize; - - #[link_name = "pwritev$NOCANCEL"] - pub fn pwritev_nocancel(fd: c_int, buf: *const iovec, count: i32, offset: off_t) -> isize; - - #[link_name = "poll$NOCANCEL"] - pub fn poll_nocancel(fds: *mut pollfd, nfds: c_int, timeout: c_int) -> isize; - - #[link_name = "ppoll$NOCANCEL"] - pub fn ppoll_nocancel( - fds: *mut pollfd, - nfds: c_int, - timeout: *const timespec, - sigmask: *const sigset_t, - ) -> isize; - } -} - -bun_opaque::opaque_ffi! { - /// Opaque `os_log_t` handle. - pub struct OSLog; -} - -#[repr(u8)] -#[derive(Copy, Clone, Eq, PartialEq)] -pub enum Category { - PointsOfInterest = 0, - Dynamicity = 1, - SizeAndThroughput = 2, - TimeProfile = 3, - SystemReporting = 4, - UserCustom = 5, -} - -unsafe extern "C" { - fn os_log_create(subsystem: *const c_char, category: *const c_char) -> *mut OSLog; - - #[link_name = "Bun__signpost_emit"] - fn bun_signpost_emit( - log: *const OSLog, - id: u64, - signpost_type: SignpostType, - name: i32, - category: u8, - ); -} - -// anything except 0 and ~0 is a valid signpost id -static SIGNPOST_ID_COUNTER: AtomicU64 = AtomicU64::new(1); - -#[repr(u8)] -#[derive(Copy, Clone, Eq, PartialEq)] -enum SignpostType { - IntervalBegin = 1, - IntervalEnd = 2, -} - -impl OSLog { - pub fn init() -> Option<&'static OSLog> { - // SAFETY: os_log_create returns either a valid os_log_t handle (process-lifetime) - // or null; the literals are NUL-terminated. - unsafe { - let ptr = os_log_create(c"com.bun.bun".as_ptr(), c"PointsOfInterest".as_ptr()); - if ptr.is_null() { None } else { Some(&*ptr) } - } - } - - pub fn signpost(&self, name: i32) -> Signpost<'_> { - Signpost { - id: SIGNPOST_ID_COUNTER.fetch_add(1, Ordering::Relaxed), - name, - log: self, - } - } -} - -#[derive(Copy, Clone)] -pub struct Signpost<'a> { - pub id: u64, - pub name: i32, - pub log: &'a OSLog, -} - -impl<'a> Signpost<'a> { - pub fn interval(self, category: Category) -> Interval<'a> { - // SAFETY: self.log is a valid os_log_t handle for 'a. - unsafe { - bun_signpost_emit( - self.log, - self.id, - SignpostType::IntervalBegin, - self.name, - category as u8, - ); - } - Interval { - signpost: self, - category, - } - } -} - -#[derive(Copy, Clone)] -pub struct Interval<'a> { - pub signpost: Signpost<'a>, - pub category: Category, -} - -impl<'a> Interval<'a> { - pub fn end(&self) { - // SAFETY: self.signpost.log is a valid os_log_t handle for 'a. - unsafe { - bun_signpost_emit( - self.signpost.log, - self.signpost.id, - SignpostType::IntervalEnd, - self.signpost.name, - self.category as u8, - ); - } - } -} diff --git a/src/platform/lib.rs b/src/platform/lib.rs index c8ebe44fab61..5cb7beb70c10 100644 --- a/src/platform/lib.rs +++ b/src/platform/lib.rs @@ -1,10 +1,8 @@ #![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] #![warn(unused_must_use)] -//! Per-OS APIs that don't fit in `bun_sys` (signposts, the `sys_epoll_pwait2` export). +//! Per-OS APIs that don't fit in `bun_sys` (the `sys_epoll_pwait2` export). // Android is listed alongside Linux so the `#[no_mangle]` C exports // (`sys_epoll_pwait2`, …) reach the linker on the `*-linux-android` targets. -#[cfg(target_os = "macos")] -pub mod darwin; #[cfg(any(target_os = "linux", target_os = "android"))] pub(crate) mod linux; diff --git a/src/sys/lib.rs b/src/sys/lib.rs index 1a1390188863..7f49bfebbfd7 100644 --- a/src/sys/lib.rs +++ b/src/sys/lib.rs @@ -5718,8 +5718,6 @@ pub mod darwin { pub fn as_ptr(&self) -> *const OSLog { core::ptr::from_ref(self) } - /// Full signpost API lives in `bun_platform::darwin`; this stub lets - /// `bun_perf` compile its Darwin arm without pulling that crate up-tier. pub fn signpost(&self, name: i32) -> os_log::Signpost<'_> { os_log::Signpost { log: self, name } } diff --git a/test/internal/source-lints/dead-symbols-platform-webcrypto-sqlite-vm.test.ts b/test/internal/source-lints/dead-symbols-platform-webcrypto-sqlite-vm.test.ts new file mode 100644 index 000000000000..7243da96fd77 --- /dev/null +++ b/test/internal/source-lints/dead-symbols-platform-webcrypto-sqlite-vm.test.ts @@ -0,0 +1,64 @@ +// Guards against reintroduction of symbols removed as dead code from +// src/platform/darwin.rs, webcrypto C++ (CryptoKeyAES/HMAC::create, +// JSSubtleCrypto::toWrapped, OpenSSL 3.0 unique_ptr aliases), sqlite +// (lazy_sqlite3 unused dlsym entries, schema_versions), NodeVM +// (sigintReceived), and bun_ast (PartTag/JSXElement/import_record +// unused variants, BindingNodeList, StoreAstAllocHeap::reset, +// JSPromise::reject_task). Each entry was verified to have zero callers +// across src/ and build/debug/codegen/ before deletion. +// +// This is a source-tree lint: it reads files from src/ and does not +// touch the built binary. + +import { expect, test } from "bun:test"; +import { readFileSync } from "node:fs"; +import path from "node:path"; + +const repoRoot = path.resolve(import.meta.dir, "..", "..", ".."); + +function src(p: string): string { + return readFileSync(path.join(repoRoot, p), "utf8"); +} + +test("bun_platform no longer declares a darwin module (duplicated bun_sys::darwin)", () => { + expect(src("src/platform/lib.rs")).not.toMatch(/pub mod darwin;/); +}); + +test("dead C++ symbols in webcrypto/sqlite/NodeVM do not reappear", () => { + const checks: Array<[string, RegExp]> = [ + ["src/jsc/bindings/webcrypto/CryptoKeyHMAC.h", /static Ref create\(/], + ["src/jsc/bindings/webcrypto/CryptoKeyHMAC.cpp", /CryptoKeyHMAC::CryptoKeyHMAC\(const Vector&/], + ["src/jsc/bindings/webcrypto/CryptoKeyAES.h", /static Ref create\(/], + [ + "src/jsc/bindings/webcrypto/CryptoKeyAES.cpp", + /CryptoKeyAES::CryptoKeyAES\(CryptoAlgorithmIdentifier algorithm, const Vector&/, + ], + ["src/jsc/bindings/webcrypto/JSCryptoKey.h", /static JSCryptoKey\* fromJS\(/], + ["src/jsc/bindings/webcrypto/JSSubtleCrypto.cpp", /JSSubtleCrypto::toWrapped\(/], + ["src/jsc/bindings/webcrypto/OpenSSLCryptoUniquePtr.h", /\bOsslParamBldPtr\b|\bX509Ptr\b|\bBIOPtr\b/], + ["src/jsc/bindings/ScriptExecutionContext.h", /\bwrapCryptoKey\b|\bunwrapCryptoKey\b/], + ["src/jsc/bindings/sqlite/JSSQLStatement.cpp", /\bschema_versions\b/], + [ + "src/jsc/bindings/sqlite/lazy_sqlite3.h", + /lazy_sqlite3_column_int\b|lazy_sqlite3_memory_used\b|lazy_sqlite3_prepare16_v3\b/, + ], + ["src/jsc/bindings/NodeVM.cpp", /NodeVMGlobalObject::sigintReceived\(/], + ["src/jsc/bindings/webcore/DOMIsoSubspaces.h", /m_subspaceForJSSQLStatementConstructor\b/], + ]; + const resurrected = checks.filter(([file, re]) => re.test(src(file))).map(([file, re]) => `${file}: ${re.source}`); + expect(resurrected).toEqual([]); +}); + +test("dead Rust symbols in ast/jsc do not reappear", () => { + const checks: Array<[string, RegExp]> = [ + ["src/ast/nodes.rs", /\bBindingNodeList\b/], + ["src/ast/nodes.rs", /\bJsxImport\b|\bCjsImports\b|PartTag[\s\S]{0,200}ReactFastRefresh,/], + ["src/ast/lib.rs", /\bHasAnyDynamic\b/], + ["src/ast/lib.rs", /impl StoreAstAllocHeap \{[\s\S]{0,200}pub fn reset\(/], + ["src/ast/import_record.rs", /^\s*Tailwind,\s*$/m], + ["src/jsc/JSPromise.rs", /pub fn reject_task\(/], + ["src/jsc/JSRuntimeType.rs", /pub const UNDEFINED:/], + ]; + const resurrected = checks.filter(([file, re]) => re.test(src(file))).map(([file, re]) => `${file}: ${re.source}`); + expect(resurrected).toEqual([]); +});