mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 15:41:48 +00:00
Fix HTMLImageElement
HTMLImageElement is the correct class name. However, it has a "legacy factory": Image (i.e. new Image()).
This commit is contained in:
@@ -2222,8 +2222,14 @@ const TypeMeta = struct {
|
||||
subtype: ?SubType,
|
||||
};
|
||||
|
||||
// When we map a Zig instance into a JsObject, we'll normally store the a
|
||||
// TaggedAnyOpaque (TAO) inside of the JsObject's internal field. This requires
|
||||
// ensuring that the instance template has an InternalFieldCount of 1. However,
|
||||
// for empty objects, we don't need to store the TAO, because we can't just cast
|
||||
// one empty object to another, so for those, as an optimization, we do not set
|
||||
// the InternalFieldCount.
|
||||
fn isEmpty(comptime T: type) bool {
|
||||
return @typeInfo(T) != .@"opaque" and @sizeOf(T) == 0;
|
||||
return @typeInfo(T) != .@"opaque" and @sizeOf(T) == 0 and @hasDecl(T, "js_legacy_factory") == false;
|
||||
}
|
||||
|
||||
// Responsible for calling Zig functions from JS invokations. This could
|
||||
|
||||
Reference in New Issue
Block a user