Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions src/ast/import_record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 0 additions & 5 deletions src/ast/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2909,7 +2909,6 @@ pub mod flags {
#[derive(EnumSetType, Debug)]
pub enum JSXElement {
IsKeyAfterSpread,
HasAnyDynamic,
}
pub type JSXElementBitset = EnumSet<JSXElement>;

Expand Down Expand Up @@ -3180,10 +3179,6 @@ impl StoreAstAllocHeap {
store_ast_alloc_heap::enter();
Self(())
}
#[inline]
pub fn reset(&self) {
store_ast_alloc_heap::reset();
}
}
Comment thread
robobun marked this conversation as resolved.
impl Drop for StoreAstAllocHeap {
#[inline]
Expand Down
4 changes: 0 additions & 4 deletions src/ast/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ pub type ExprNodeList = Vec<Expr, bun_alloc::AstAlloc>;
// 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<Stmt>;
Comment thread
robobun marked this conversation as resolved.
pub type BindingNodeList = StoreSlice<Binding>;

#[repr(u8)]
#[derive(Copy, Clone, PartialEq, Eq, Debug, strum::IntoStaticStr)]
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/js/node/readline.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const {
FunctionPrototypeBind,
FunctionPrototypeCall,
ObjectDefineProperties,
ObjectSetPrototypeOf,
Promise,
PromiseReject,
StringPrototypeSlice,
Expand Down
1 change: 0 additions & 1 deletion src/js/node/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const {
ArrayPrototypePop,
ArrayPrototypePush,
ArrayPrototypeShift,
ArrayPrototypeSlice,
ArrayPrototypeSort,
Boolean,
Error: MainContextError,
Expand Down
3 changes: 1 addition & 2 deletions src/js/node/zlib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/js_parser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 0 additions & 12 deletions src/jsc/JSPromise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 0 additions & 1 deletion src/jsc/JSRuntimeType.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ pub struct JSRuntimeType(pub u16);

impl JSRuntimeType {
pub const NOTHING: Self = Self(0x0);
pub const UNDEFINED: Self = Self(0x2);
}
5 changes: 0 additions & 5 deletions src/jsc/bindings/NodeVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/jsc/bindings/NodeVM.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/jsc/bindings/NodeVMModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ class NodeVMModuleRequest final {

JSArray* toJS(JSGlobalObject* globalObject) const;

const WTF::String& specifier() const { return m_specifier; }
const WTF::HashMap<WTF::String, WTF::String>& importAttributes() const { return m_importAttributes; }

private:
WTF::String m_specifier;
WTF::HashMap<WTF::String, WTF::String> m_importAttributes;
Expand Down
16 changes: 0 additions & 16 deletions src/jsc/bindings/ScriptExecutionContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,6 @@ class ScriptExecutionContext : public CanMakeWeakPtr<ScriptExecutionContext>, pu
void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, JSC::Exception* exception, RefPtr<void*>&&, CachedScript* = nullptr, bool = false)
{
}
// void reportUnhandledPromiseRejection(JSC::JSGlobalObject&, JSC::JSPromise&, RefPtr<Inspector::ScriptCallStack>&&)
// {
// }

#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<uint8_t>& key, Vector<uint8_t>& wrappedKey) = 0;
// virtual bool unwrapCryptoKey(const Vector<uint8_t>& wrappedKey, Vector<uint8_t>& key) = 0;
bool wrapCryptoKey(const Vector<uint8_t>& key, Vector<uint8_t>& wrappedKey) { return false; }
bool unwrapCryptoKey(const Vector<uint8_t>& wrappedKey, Vector<uint8_t>& key) { return false; }
#endif

WEBCORE_EXPORT static bool postTaskTo(ScriptExecutionContextIdentifier identifier, Function<void(ScriptExecutionContext&)>&& task);
WEBCORE_EXPORT static bool postTaskTo(ScriptExecutionContextIdentifier identifier, NOESCAPE const WTF::Function<void()>& betweenLookupAndEnqueue, Function<void(ScriptExecutionContext&)>&& task);
WEBCORE_EXPORT static bool ensureOnContextThread(ScriptExecutionContextIdentifier, Function<void(ScriptExecutionContext&)>&& task);
Expand Down
2 changes: 0 additions & 2 deletions src/jsc/bindings/sqlite/JSSQLStatement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(VersionSqlite3);
class SQLiteSingleton {
public:
Vector<VersionSqlite3*> databases;
Vector<std::atomic<uint64_t>> schema_versions;
};

static SQLiteSingleton* _instance = nullptr;
Expand All @@ -261,7 +260,6 @@ static Vector<VersionSqlite3*>& databases()
_instance = new SQLiteSingleton();
_instance->databases = Vector<VersionSqlite3*>();
_instance->databases.reserveInitialCapacity(4);
_instance->schema_versions = Vector<std::atomic<uint64_t>>();
}

return _instance->databases;
Expand Down
3 changes: 0 additions & 3 deletions src/jsc/bindings/sqlite/NodeSqlite.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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
Expand Down
18 changes: 0 additions & 18 deletions src/jsc/bindings/sqlite/lazy_sqlite3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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, ...);
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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");
Expand Down Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion src/jsc/bindings/webcore/DOMClientIsoSubspaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class DOMClientIsoSubspaces {
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForNapiClass;
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForNapiPrototype;
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForJSSQLStatement;
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForJSSQLStatementConstructor;
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForNodeSqliteDatabaseSync;
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForNodeSqliteStatementSync;
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForNodeSqliteStatementSyncIterator;
Expand Down
1 change: 0 additions & 1 deletion src/jsc/bindings/webcore/DOMIsoSubspaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class DOMIsoSubspaces {
std::unique_ptr<IsoSubspace> m_subspaceForNapiClass;
std::unique_ptr<IsoSubspace> m_subspaceForNapiPrototype;
std::unique_ptr<IsoSubspace> m_subspaceForJSSQLStatement;
std::unique_ptr<IsoSubspace> m_subspaceForJSSQLStatementConstructor;
std::unique_ptr<IsoSubspace> m_subspaceForNodeSqliteDatabaseSync;
std::unique_ptr<IsoSubspace> m_subspaceForNodeSqliteStatementSync;
std::unique_ptr<IsoSubspace> m_subspaceForNodeSqliteStatementSyncIterator;
Expand Down
2 changes: 1 addition & 1 deletion src/jsc/bindings/webcrypto/CommonCryptoDERUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/jsc/bindings/webcrypto/CommonCryptoDERUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t>&, size_t);

} // namespace WebCore
Expand Down
7 changes: 0 additions & 7 deletions src/jsc/bindings/webcrypto/CryptoKeyAES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t>& key, bool extractable, CryptoKeyUsageBitmap usage)
: CryptoKey(algorithm, CryptoKeyType::Secret, extractable, usage)
, m_key(key)
{
ASSERT(isValidAESAlgorithm(algorithm));
}

CryptoKeyAES::CryptoKeyAES(CryptoAlgorithmIdentifier algorithm, Vector<uint8_t>&& key, bool extractable, CryptoKeyUsageBitmap usage)
: CryptoKey(algorithm, CryptoKeyType::Secret, extractable, usage)
, m_key(WTF::move(key))
Expand Down
5 changes: 0 additions & 5 deletions src/jsc/bindings/webcrypto/CryptoKeyAES.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ class CryptoKeyAES final : public CryptoKey {
static constexpr int s_length192 = 192;
static constexpr int s_length256 = 256;

static Ref<CryptoKeyAES> create(CryptoAlgorithmIdentifier algorithm, const Vector<uint8_t>& key, bool extractable, CryptoKeyUsageBitmap usage)
{
return adoptRef(*new CryptoKeyAES(algorithm, key, extractable, usage));
}
virtual ~CryptoKeyAES();

static bool isValidAESAlgorithm(CryptoAlgorithmIdentifier);
Expand All @@ -66,7 +62,6 @@ class CryptoKeyAES final : public CryptoKey {
static ExceptionOr<std::optional<size_t>> getKeyLength(const CryptoAlgorithmParameters&);

private:
CryptoKeyAES(CryptoAlgorithmIdentifier, const Vector<uint8_t>& key, bool extractable, CryptoKeyUsageBitmap);
CryptoKeyAES(CryptoAlgorithmIdentifier, Vector<uint8_t>&& key, bool extractable, CryptoKeyUsageBitmap);

KeyAlgorithm algorithm() const final;
Expand Down
7 changes: 0 additions & 7 deletions src/jsc/bindings/webcrypto/CryptoKeyHMAC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ static size_t getKeyLengthFromHash(CryptoAlgorithmIdentifier hash)
}
}

CryptoKeyHMAC::CryptoKeyHMAC(const Vector<uint8_t>& key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap usage)
: CryptoKey(CryptoAlgorithmIdentifier::HMAC, CryptoKeyType::Secret, extractable, usage)
, m_hash(hash)
, m_key(key)
{
}

CryptoKeyHMAC::CryptoKeyHMAC(Vector<uint8_t>&& key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap usage)
: CryptoKey(CryptoAlgorithmIdentifier::HMAC, CryptoKeyType::Secret, extractable, usage)
, m_hash(hash)
Expand Down
Loading
Loading