Skip to content

Commit 21d008c

Browse files
committed
class_index => class_id
1 parent 9138a3c commit 21d008c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+82
-81
lines changed

src/browser/js/Context.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ pub fn mapZigInstanceToJs(self: *Context, js_obj_: ?v8.Object, value: anytype) !
589589
// for example, when we're executing a constructor, v8 has
590590
// already created the "this" object.
591591
const js_obj = js_obj_ orelse blk: {
592-
const template = self.templates[resolved.class_index];
592+
const template = self.templates[resolved.class_id];
593593
break :blk template.getInstanceTemplate().initInstance(v8_context);
594594
};
595595
const JsApi = bridge.Struct(ptr.child).JsApi;
@@ -916,7 +916,7 @@ fn jsValueToTypedArray(_: *Context, comptime T: type, js_value: v8.Value) !?[]T
916916
// get the most specific class_id possible.
917917
const Resolved = struct {
918918
ptr: *anyopaque,
919-
class_index: u16,
919+
class_id: u16,
920920
prototype_chain: []const js.PrototypeChainEntry,
921921
};
922922
fn resolveValue(value: anytype) Resolved {
@@ -947,7 +947,7 @@ fn resolveValue(value: anytype) Resolved {
947947
fn resolveT(comptime T: type, value: *anyopaque) Resolved {
948948
return .{
949949
.ptr = value,
950-
.class_index = T.JsApi.Meta.class_index,
950+
.class_id = T.JsApi.Meta.class_id,
951951
.prototype_chain = &T.JsApi.Meta.prototype_chain,
952952
};
953953
}

src/browser/js/Env.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ pub fn init(allocator: Allocator, platform: *const Platform, _: Opts) !*Env {
111111
const templates = &env.templates;
112112
inline for (JsApis, 0..) |JsApi, i| {
113113
@setEvalBranchQuota(10_000);
114-
JsApi.Meta.class_index = i;
114+
JsApi.Meta.class_id = i;
115115
templates[i] = v8.Persistent(v8.FunctionTemplate).init(isolate, generateClass(JsApi, isolate)).castToFunctionTemplate();
116116
}
117117

src/browser/js/bridge.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const Caller = @import("Caller.zig");
2626

2727
pub fn Builder(comptime T: type) type {
2828
return struct {
29+
pub const ClassId = u16;
2930
pub const @"type" = T;
3031

3132
pub fn constructor(comptime func: anytype, comptime opts: Constructor.Opts) Constructor {

src/browser/webapi/AbortController.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub const JsApi = struct {
3030
pub const name = "AbortController";
3131

3232
pub const prototype_chain = bridge.prototypeChain();
33-
pub var class_index: u16 = 0;
33+
pub var class_id: bridge.ClassId = undefined;
3434
};
3535

3636
pub const constructor = bridge.constructor(AbortController.init, .{});

src/browser/webapi/AbortSignal.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub const JsApi = struct {
8585
pub const name = "AbortSignal";
8686

8787
pub const prototype_chain = bridge.prototypeChain();
88-
pub var class_index: u16 = 0;
88+
pub var class_id: bridge.ClassId = undefined;
8989
};
9090

9191
pub const Prototype = EventTarget;

src/browser/webapi/CData.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub const JsApi = struct {
6363
pub const Meta = struct {
6464
pub const name = "CData";
6565
pub const prototype_chain = bridge.prototypeChain();
66-
pub var class_index: u16 = 0;
66+
pub var class_id: bridge.ClassId = undefined;
6767
};
6868

6969
pub const data = bridge.accessor(CData.getData, CData.setData, .{});

src/browser/webapi/Console.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub const JsApi = struct {
4343
pub const name = "Console";
4444

4545
pub const prototype_chain = bridge.prototypeChain();
46-
pub var class_index: u16 = 0;
46+
pub var class_id: bridge.ClassId = undefined;
4747
pub const empty_with_no_proto = true;
4848
};
4949

src/browser/webapi/Crypto.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub const JsApi = struct {
5151
pub const Meta = struct {
5252
pub const name = "Crypto";
5353
pub const prototype_chain = bridge.prototypeChain();
54-
pub var class_index: u16 = 0;
54+
pub var class_id: bridge.ClassId = undefined;
5555
};
5656

5757
pub const getRandomValues = bridge.function(Crypto.getRandomValues, .{ .static = true });

src/browser/webapi/DOMException.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub const JsApi = struct {
6060
pub const Meta = struct {
6161
pub const name = "DOMException";
6262
pub const prototype_chain = bridge.prototypeChain();
63-
pub var class_index: u16 = 0;
63+
pub var class_id: bridge.ClassId = undefined;
6464
};
6565

6666
pub const constructor = bridge.constructor(DOMException.init, .{});

src/browser/webapi/DOMImplementation.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub const JsApi = struct {
3838
pub const Meta = struct {
3939
pub const name = "DOMImplementation";
4040
pub const prototype_chain = bridge.prototypeChain();
41-
pub var class_index: u16 = 0;
41+
pub var class_id: bridge.ClassId = undefined;
4242
pub const empty_with_no_proto = true;
4343
};
4444

0 commit comments

Comments
 (0)