aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/bindings/bindings.zig53
1 files changed, 52 insertions, 1 deletions
diff --git a/src/bun.js/bindings/bindings.zig b/src/bun.js/bindings/bindings.zig
index b4bf44895..76bb1011a 100644
--- a/src/bun.js/bindings/bindings.zig
+++ b/src/bun.js/bindings/bindings.zig
@@ -207,7 +207,7 @@ pub const ZigString = extern struct {
return .{
.ptr = input.ptr,
.len = @truncate(u32, input.len),
- .allocator = NullableAllocator.init(bun.default_allocator),
+ .allocator = .{},
};
}
@@ -2600,6 +2600,57 @@ pub const JSValue = enum(JSValueReprInt) {
Blob = 0b11111100,
_,
+ pub fn canGet(this: JSType) bool {
+ return switch (this) {
+ .Array,
+ .ArrayBuffer,
+ .BigInt64Array,
+ .BigUint64Array,
+ .BooleanObject,
+ .DOMWrapper,
+ .DataView,
+ .DerivedArray,
+ .DerivedStringObject,
+ .ErrorInstance,
+ .Event,
+ .FinalObject,
+ .Float32Array,
+ .Float64Array,
+ .GlobalObject,
+ .Int16Array,
+ .Int32Array,
+ .Int8Array,
+ .InternalFunction,
+ .JSArrayIterator,
+ .JSAsyncGenerator,
+ .JSDate,
+ .JSFunction,
+ .JSGenerator,
+ .JSMap,
+ .JSMapIterator,
+ .JSPromise,
+ .JSSet,
+ .JSSetIterator,
+ .JSStringIterator,
+ .JSWeakMap,
+ .JSWeakSet,
+ .ModuleNamespaceObject,
+ .NumberObject,
+ .Object,
+ .ProxyObject,
+ .RegExpObject,
+ .ShadowRealm,
+ .StringObject,
+ .Uint16Array,
+ .Uint32Array,
+ .Uint8Array,
+ .Uint8ClampedArray,
+ .WebAssemblyModule,
+ => true,
+ else => false,
+ };
+ }
+
pub fn isObject(this: JSType) bool {
return switch (this) {
.Object, .FinalObject => true,