forked from oven-sh/bun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerated_classes.zig
3412 lines (2900 loc) · 177 KB
/
generated_classes.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/// Generated code! To regenerate, run:
///
/// make codegen
///
/// This file is generated by:
/// 1. `bun src/bun.js/scripts/generate-classes.ts`
/// 2. Scan for **/*.classes.ts files in src/bun.js/src
/// 3. Generate a JS wrapper for each class in:
/// - Zig: generated_classes.zig
/// - C++: ZigGeneratedClasses.h, ZigGeneratedClasses.cpp
/// 4. For the Zig code to successfully compile:
/// - Add it to generated_classes_list.zig
/// - pub usingnamespace JSC.Codegen.JSMyClassName;
/// 5. make clean-bindings && make bindings -j10
///
const JSC = @import("bun").JSC;
const Classes = @import("./generated_classes_list.zig").Classes;
const Environment = @import("../../env.zig");
const std = @import("std");
pub const StaticGetterType = fn (*JSC.JSGlobalObject, JSC.JSValue, JSC.JSValue) callconv(.C) JSC.JSValue;
pub const StaticSetterType = fn (*JSC.JSGlobalObject, JSC.JSValue, JSC.JSValue, JSC.JSValue) callconv(.C) bool;
pub const StaticCallbackType = fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
pub const JSBlob = struct {
const Blob = Classes.Blob;
const GetterType = fn (*Blob, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const GetterTypeWithThisValue = fn (*Blob, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const SetterType = fn (*Blob, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const SetterTypeWithThisValue = fn (*Blob, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const CallbackType = fn (*Blob, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
pub fn fromJS(value: JSC.JSValue) ?*Blob {
JSC.markBinding(@src());
return Blob__fromJS(value);
}
/// Get the Blob constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return Blob__getConstructor(globalObject);
}
/// Create a new instance of Blob
pub fn toJS(this: *Blob, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
if (comptime Environment.allow_assert) {
const value__ = Blob__create(globalObject, this);
std.debug.assert(value__.as(Blob).? == this); // If this fails, likely a C ABI issue.
return value__;
} else {
return Blob__create(globalObject, this);
}
}
/// Modify the internal ptr to point to a new instance of Blob.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*Blob) bool {
JSC.markBinding(@src());
return Blob__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *Blob, value: JSC.JSValue) void {
JSC.markBinding(@src());
std.debug.assert(Blob__dangerouslySetPtr(value, null));
}
extern fn Blob__fromJS(JSC.JSValue) ?*Blob;
extern fn Blob__getConstructor(*JSC.JSGlobalObject) JSC.JSValue;
extern fn Blob__create(globalObject: *JSC.JSGlobalObject, ptr: ?*Blob) JSC.JSValue;
extern fn Blob__dangerouslySetPtr(JSC.JSValue, ?*Blob) bool;
comptime {
if (@TypeOf(Blob.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Blob)) {
@compileLog("Blob.constructor is not a constructor");
}
if (@TypeOf(Blob.finalize) != (fn (*Blob) callconv(.C) void)) {
@compileLog("Blob.finalize is not a finalizer");
}
if (@TypeOf(Blob.getArrayBuffer) != CallbackType)
@compileLog("Expected Blob.getArrayBuffer to be a callback but received " ++ @typeName(@TypeOf(Blob.getArrayBuffer)));
if (@TypeOf(Blob.getJSON) != CallbackType)
@compileLog("Expected Blob.getJSON to be a callback but received " ++ @typeName(@TypeOf(Blob.getJSON)));
if (@TypeOf(Blob.getSize) != GetterType)
@compileLog("Expected Blob.getSize to be a getter");
if (@TypeOf(Blob.getSlice) != CallbackType)
@compileLog("Expected Blob.getSlice to be a callback but received " ++ @typeName(@TypeOf(Blob.getSlice)));
if (@TypeOf(Blob.getStream) != CallbackType)
@compileLog("Expected Blob.getStream to be a callback but received " ++ @typeName(@TypeOf(Blob.getStream)));
if (@TypeOf(Blob.getText) != CallbackType)
@compileLog("Expected Blob.getText to be a callback but received " ++ @typeName(@TypeOf(Blob.getText)));
if (@TypeOf(Blob.getType) != GetterType)
@compileLog("Expected Blob.getType to be a getter");
if (@TypeOf(Blob.setType) != SetterType)
@compileLog("Expected Blob.setType to be a setter");
if (@TypeOf(Blob.getWriter) != CallbackType)
@compileLog("Expected Blob.getWriter to be a callback but received " ++ @typeName(@TypeOf(Blob.getWriter)));
if (!JSC.is_bindgen) {
@export(Blob.constructor, .{ .name = "BlobClass__construct" });
@export(Blob.finalize, .{ .name = "BlobClass__finalize" });
@export(Blob.getArrayBuffer, .{ .name = "BlobPrototype__getArrayBuffer" });
@export(Blob.getJSON, .{ .name = "BlobPrototype__getJSON" });
@export(Blob.getSize, .{ .name = "BlobPrototype__getSize" });
@export(Blob.getSlice, .{ .name = "BlobPrototype__getSlice" });
@export(Blob.getStream, .{ .name = "BlobPrototype__getStream" });
@export(Blob.getText, .{ .name = "BlobPrototype__getText" });
@export(Blob.getType, .{ .name = "BlobPrototype__getType" });
@export(Blob.getWriter, .{ .name = "BlobPrototype__getWriter" });
@export(Blob.setType, .{ .name = "BlobPrototype__setType" });
}
}
};
pub const JSCryptoHasher = struct {
const CryptoHasher = Classes.CryptoHasher;
const GetterType = fn (*CryptoHasher, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const GetterTypeWithThisValue = fn (*CryptoHasher, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const SetterType = fn (*CryptoHasher, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const SetterTypeWithThisValue = fn (*CryptoHasher, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const CallbackType = fn (*CryptoHasher, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
pub fn fromJS(value: JSC.JSValue) ?*CryptoHasher {
JSC.markBinding(@src());
return CryptoHasher__fromJS(value);
}
extern fn CryptoHasherPrototype__algorithmSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
extern fn CryptoHasherPrototype__algorithmGetCachedValue(JSC.JSValue) JSC.JSValue;
/// `CryptoHasher.algorithm` setter
/// This value will be visited by the garbage collector.
pub fn algorithmSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
JSC.markBinding(@src());
CryptoHasherPrototype__algorithmSetCachedValue(thisValue, globalObject, value);
}
/// `CryptoHasher.algorithm` getter
/// This value will be visited by the garbage collector.
pub fn algorithmGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
JSC.markBinding(@src());
const result = CryptoHasherPrototype__algorithmGetCachedValue(thisValue);
if (result == .zero)
return null;
return result;
}
/// Get the CryptoHasher constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return CryptoHasher__getConstructor(globalObject);
}
/// Create a new instance of CryptoHasher
pub fn toJS(this: *CryptoHasher, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
if (comptime Environment.allow_assert) {
const value__ = CryptoHasher__create(globalObject, this);
std.debug.assert(value__.as(CryptoHasher).? == this); // If this fails, likely a C ABI issue.
return value__;
} else {
return CryptoHasher__create(globalObject, this);
}
}
/// Modify the internal ptr to point to a new instance of CryptoHasher.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*CryptoHasher) bool {
JSC.markBinding(@src());
return CryptoHasher__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *CryptoHasher, value: JSC.JSValue) void {
JSC.markBinding(@src());
std.debug.assert(CryptoHasher__dangerouslySetPtr(value, null));
}
extern fn CryptoHasher__fromJS(JSC.JSValue) ?*CryptoHasher;
extern fn CryptoHasher__getConstructor(*JSC.JSGlobalObject) JSC.JSValue;
extern fn CryptoHasher__create(globalObject: *JSC.JSGlobalObject, ptr: ?*CryptoHasher) JSC.JSValue;
extern fn CryptoHasher__dangerouslySetPtr(JSC.JSValue, ?*CryptoHasher) bool;
comptime {
if (@TypeOf(CryptoHasher.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*CryptoHasher)) {
@compileLog("CryptoHasher.constructor is not a constructor");
}
if (@TypeOf(CryptoHasher.finalize) != (fn (*CryptoHasher) callconv(.C) void)) {
@compileLog("CryptoHasher.finalize is not a finalizer");
}
if (@TypeOf(CryptoHasher.getAlgorithm) != GetterType)
@compileLog("Expected CryptoHasher.getAlgorithm to be a getter");
if (@TypeOf(CryptoHasher.getByteLength) != GetterType)
@compileLog("Expected CryptoHasher.getByteLength to be a getter");
if (@TypeOf(CryptoHasher.digest) != CallbackType)
@compileLog("Expected CryptoHasher.digest to be a callback but received " ++ @typeName(@TypeOf(CryptoHasher.digest)));
if (@TypeOf(CryptoHasher.update) != CallbackType)
@compileLog("Expected CryptoHasher.update to be a callback but received " ++ @typeName(@TypeOf(CryptoHasher.update)));
if (@TypeOf(CryptoHasher.getAlgorithms) != StaticGetterType)
@compileLog("Expected CryptoHasher.getAlgorithms to be a static getter");
if (@TypeOf(CryptoHasher.hash) != StaticCallbackType)
@compileLog("Expected CryptoHasher.hash to be a static callback");
if (!JSC.is_bindgen) {
@export(CryptoHasher.constructor, .{ .name = "CryptoHasherClass__construct" });
@export(CryptoHasher.digest, .{ .name = "CryptoHasherPrototype__digest" });
@export(CryptoHasher.finalize, .{ .name = "CryptoHasherClass__finalize" });
@export(CryptoHasher.getAlgorithm, .{ .name = "CryptoHasherPrototype__getAlgorithm" });
@export(CryptoHasher.getAlgorithms, .{ .name = "CryptoHasherClass__getAlgorithms" });
@export(CryptoHasher.getByteLength, .{ .name = "CryptoHasherPrototype__getByteLength" });
@export(CryptoHasher.hash, .{ .name = "CryptoHasherClass__hash" });
@export(CryptoHasher.update, .{ .name = "CryptoHasherPrototype__update" });
}
}
};
pub const JSDirent = struct {
const Dirent = Classes.Dirent;
const GetterType = fn (*Dirent, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const GetterTypeWithThisValue = fn (*Dirent, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const SetterType = fn (*Dirent, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const SetterTypeWithThisValue = fn (*Dirent, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const CallbackType = fn (*Dirent, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
pub fn fromJS(value: JSC.JSValue) ?*Dirent {
JSC.markBinding(@src());
return Dirent__fromJS(value);
}
extern fn DirentPrototype__nameSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
extern fn DirentPrototype__nameGetCachedValue(JSC.JSValue) JSC.JSValue;
/// `Dirent.name` setter
/// This value will be visited by the garbage collector.
pub fn nameSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
JSC.markBinding(@src());
DirentPrototype__nameSetCachedValue(thisValue, globalObject, value);
}
/// `Dirent.name` getter
/// This value will be visited by the garbage collector.
pub fn nameGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
JSC.markBinding(@src());
const result = DirentPrototype__nameGetCachedValue(thisValue);
if (result == .zero)
return null;
return result;
}
/// Get the Dirent constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return Dirent__getConstructor(globalObject);
}
/// Create a new instance of Dirent
pub fn toJS(this: *Dirent, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
if (comptime Environment.allow_assert) {
const value__ = Dirent__create(globalObject, this);
std.debug.assert(value__.as(Dirent).? == this); // If this fails, likely a C ABI issue.
return value__;
} else {
return Dirent__create(globalObject, this);
}
}
/// Modify the internal ptr to point to a new instance of Dirent.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*Dirent) bool {
JSC.markBinding(@src());
return Dirent__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *Dirent, value: JSC.JSValue) void {
JSC.markBinding(@src());
std.debug.assert(Dirent__dangerouslySetPtr(value, null));
}
extern fn Dirent__fromJS(JSC.JSValue) ?*Dirent;
extern fn Dirent__getConstructor(*JSC.JSGlobalObject) JSC.JSValue;
extern fn Dirent__create(globalObject: *JSC.JSGlobalObject, ptr: ?*Dirent) JSC.JSValue;
extern fn Dirent__dangerouslySetPtr(JSC.JSValue, ?*Dirent) bool;
comptime {
if (@TypeOf(Dirent.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Dirent)) {
@compileLog("Dirent.constructor is not a constructor");
}
if (@TypeOf(Dirent.finalize) != (fn (*Dirent) callconv(.C) void)) {
@compileLog("Dirent.finalize is not a finalizer");
}
if (@TypeOf(Dirent.isBlockDevice) != CallbackType)
@compileLog("Expected Dirent.isBlockDevice to be a callback but received " ++ @typeName(@TypeOf(Dirent.isBlockDevice)));
if (@TypeOf(Dirent.isCharacterDevice) != CallbackType)
@compileLog("Expected Dirent.isCharacterDevice to be a callback but received " ++ @typeName(@TypeOf(Dirent.isCharacterDevice)));
if (@TypeOf(Dirent.isDirectory) != CallbackType)
@compileLog("Expected Dirent.isDirectory to be a callback but received " ++ @typeName(@TypeOf(Dirent.isDirectory)));
if (@TypeOf(Dirent.isFIFO) != CallbackType)
@compileLog("Expected Dirent.isFIFO to be a callback but received " ++ @typeName(@TypeOf(Dirent.isFIFO)));
if (@TypeOf(Dirent.isFile) != CallbackType)
@compileLog("Expected Dirent.isFile to be a callback but received " ++ @typeName(@TypeOf(Dirent.isFile)));
if (@TypeOf(Dirent.isSocket) != CallbackType)
@compileLog("Expected Dirent.isSocket to be a callback but received " ++ @typeName(@TypeOf(Dirent.isSocket)));
if (@TypeOf(Dirent.isSymbolicLink) != CallbackType)
@compileLog("Expected Dirent.isSymbolicLink to be a callback but received " ++ @typeName(@TypeOf(Dirent.isSymbolicLink)));
if (@TypeOf(Dirent.getName) != GetterType)
@compileLog("Expected Dirent.getName to be a getter");
if (!JSC.is_bindgen) {
@export(Dirent.constructor, .{ .name = "DirentClass__construct" });
@export(Dirent.finalize, .{ .name = "DirentClass__finalize" });
@export(Dirent.getName, .{ .name = "DirentPrototype__getName" });
@export(Dirent.isBlockDevice, .{ .name = "DirentPrototype__isBlockDevice" });
@export(Dirent.isCharacterDevice, .{ .name = "DirentPrototype__isCharacterDevice" });
@export(Dirent.isDirectory, .{ .name = "DirentPrototype__isDirectory" });
@export(Dirent.isFIFO, .{ .name = "DirentPrototype__isFIFO" });
@export(Dirent.isFile, .{ .name = "DirentPrototype__isFile" });
@export(Dirent.isSocket, .{ .name = "DirentPrototype__isSocket" });
@export(Dirent.isSymbolicLink, .{ .name = "DirentPrototype__isSymbolicLink" });
}
}
};
pub const JSExpect = struct {
const Expect = Classes.Expect;
const GetterType = fn (*Expect, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const GetterTypeWithThisValue = fn (*Expect, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const SetterType = fn (*Expect, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const SetterTypeWithThisValue = fn (*Expect, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const CallbackType = fn (*Expect, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
pub fn fromJS(value: JSC.JSValue) ?*Expect {
JSC.markBinding(@src());
return Expect__fromJS(value);
}
extern fn ExpectPrototype__capturedValueSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
extern fn ExpectPrototype__capturedValueGetCachedValue(JSC.JSValue) JSC.JSValue;
/// `Expect.capturedValue` setter
/// This value will be visited by the garbage collector.
pub fn capturedValueSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
JSC.markBinding(@src());
ExpectPrototype__capturedValueSetCachedValue(thisValue, globalObject, value);
}
/// `Expect.capturedValue` getter
/// This value will be visited by the garbage collector.
pub fn capturedValueGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
JSC.markBinding(@src());
const result = ExpectPrototype__capturedValueGetCachedValue(thisValue);
if (result == .zero)
return null;
return result;
}
extern fn ExpectPrototype__resultValueSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
extern fn ExpectPrototype__resultValueGetCachedValue(JSC.JSValue) JSC.JSValue;
/// `Expect.resultValue` setter
/// This value will be visited by the garbage collector.
pub fn resultValueSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
JSC.markBinding(@src());
ExpectPrototype__resultValueSetCachedValue(thisValue, globalObject, value);
}
/// `Expect.resultValue` getter
/// This value will be visited by the garbage collector.
pub fn resultValueGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
JSC.markBinding(@src());
const result = ExpectPrototype__resultValueGetCachedValue(thisValue);
if (result == .zero)
return null;
return result;
}
/// Get the Expect constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return Expect__getConstructor(globalObject);
}
/// Create a new instance of Expect
pub fn toJS(this: *Expect, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
if (comptime Environment.allow_assert) {
const value__ = Expect__create(globalObject, this);
std.debug.assert(value__.as(Expect).? == this); // If this fails, likely a C ABI issue.
return value__;
} else {
return Expect__create(globalObject, this);
}
}
/// Modify the internal ptr to point to a new instance of Expect.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*Expect) bool {
JSC.markBinding(@src());
return Expect__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *Expect, value: JSC.JSValue) void {
JSC.markBinding(@src());
std.debug.assert(Expect__dangerouslySetPtr(value, null));
}
extern fn Expect__fromJS(JSC.JSValue) ?*Expect;
extern fn Expect__getConstructor(*JSC.JSGlobalObject) JSC.JSValue;
extern fn Expect__create(globalObject: *JSC.JSGlobalObject, ptr: ?*Expect) JSC.JSValue;
extern fn Expect__dangerouslySetPtr(JSC.JSValue, ?*Expect) bool;
comptime {
if (@TypeOf(Expect.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Expect)) {
@compileLog("Expect.constructor is not a constructor");
}
if (@TypeOf(Expect.finalize) != (fn (*Expect) callconv(.C) void)) {
@compileLog("Expect.finalize is not a finalizer");
}
if (@TypeOf(Expect.getNot) != GetterTypeWithThisValue)
@compileLog("Expected Expect.getNot to be a getter with thisValue");
if (@TypeOf(Expect.getRejects) != GetterTypeWithThisValue)
@compileLog("Expected Expect.getRejects to be a getter with thisValue");
if (@TypeOf(Expect.getResolves) != GetterTypeWithThisValue)
@compileLog("Expected Expect.getResolves to be a getter with thisValue");
if (@TypeOf(Expect.toBe) != CallbackType)
@compileLog("Expected Expect.toBe to be a callback but received " ++ @typeName(@TypeOf(Expect.toBe)));
if (@TypeOf(Expect.toBeCloseTo) != CallbackType)
@compileLog("Expected Expect.toBeCloseTo to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeCloseTo)));
if (@TypeOf(Expect.toBeDefined) != CallbackType)
@compileLog("Expected Expect.toBeDefined to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeDefined)));
if (@TypeOf(Expect.toBeFalsy) != CallbackType)
@compileLog("Expected Expect.toBeFalsy to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeFalsy)));
if (@TypeOf(Expect.toBeGreaterThan) != CallbackType)
@compileLog("Expected Expect.toBeGreaterThan to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeGreaterThan)));
if (@TypeOf(Expect.toBeGreaterThanOrEqual) != CallbackType)
@compileLog("Expected Expect.toBeGreaterThanOrEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeGreaterThanOrEqual)));
if (@TypeOf(Expect.toBeInstanceOf) != CallbackType)
@compileLog("Expected Expect.toBeInstanceOf to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeInstanceOf)));
if (@TypeOf(Expect.toBeLessThan) != CallbackType)
@compileLog("Expected Expect.toBeLessThan to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeLessThan)));
if (@TypeOf(Expect.toBeLessThanOrEqual) != CallbackType)
@compileLog("Expected Expect.toBeLessThanOrEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeLessThanOrEqual)));
if (@TypeOf(Expect.toBeNaN) != CallbackType)
@compileLog("Expected Expect.toBeNaN to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeNaN)));
if (@TypeOf(Expect.toBeNull) != CallbackType)
@compileLog("Expected Expect.toBeNull to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeNull)));
if (@TypeOf(Expect.toBeTruthy) != CallbackType)
@compileLog("Expected Expect.toBeTruthy to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeTruthy)));
if (@TypeOf(Expect.toBeUndefined) != CallbackType)
@compileLog("Expected Expect.toBeUndefined to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeUndefined)));
if (@TypeOf(Expect.toContain) != CallbackType)
@compileLog("Expected Expect.toContain to be a callback but received " ++ @typeName(@TypeOf(Expect.toContain)));
if (@TypeOf(Expect.toContainEqual) != CallbackType)
@compileLog("Expected Expect.toContainEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toContainEqual)));
if (@TypeOf(Expect.toEqual) != CallbackType)
@compileLog("Expected Expect.toEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toEqual)));
if (@TypeOf(Expect.toHaveBeenCalledTimes) != CallbackType)
@compileLog("Expected Expect.toHaveBeenCalledTimes to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenCalledTimes)));
if (@TypeOf(Expect.toHaveBeenCalledWith) != CallbackType)
@compileLog("Expected Expect.toHaveBeenCalledWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenCalledWith)));
if (@TypeOf(Expect.toHaveBeenLastCalledWith) != CallbackType)
@compileLog("Expected Expect.toHaveBeenLastCalledWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenLastCalledWith)));
if (@TypeOf(Expect.toHaveBeenNthCalledWith) != CallbackType)
@compileLog("Expected Expect.toHaveBeenNthCalledWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenNthCalledWith)));
if (@TypeOf(Expect.toHaveLastReturnedWith) != CallbackType)
@compileLog("Expected Expect.toHaveLastReturnedWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveLastReturnedWith)));
if (@TypeOf(Expect.toHaveLength) != CallbackType)
@compileLog("Expected Expect.toHaveLength to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveLength)));
if (@TypeOf(Expect.toHaveNthReturnedWith) != CallbackType)
@compileLog("Expected Expect.toHaveNthReturnedWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveNthReturnedWith)));
if (@TypeOf(Expect.toHaveProperty) != CallbackType)
@compileLog("Expected Expect.toHaveProperty to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveProperty)));
if (@TypeOf(Expect.toHaveReturnedTimes) != CallbackType)
@compileLog("Expected Expect.toHaveReturnedTimes to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveReturnedTimes)));
if (@TypeOf(Expect.toHaveReturnedWith) != CallbackType)
@compileLog("Expected Expect.toHaveReturnedWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveReturnedWith)));
if (@TypeOf(Expect.toMatch) != CallbackType)
@compileLog("Expected Expect.toMatch to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatch)));
if (@TypeOf(Expect.toMatchInlineSnapshot) != CallbackType)
@compileLog("Expected Expect.toMatchInlineSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatchInlineSnapshot)));
if (@TypeOf(Expect.toMatchObject) != CallbackType)
@compileLog("Expected Expect.toMatchObject to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatchObject)));
if (@TypeOf(Expect.toMatchSnapshot) != CallbackType)
@compileLog("Expected Expect.toMatchSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatchSnapshot)));
if (@TypeOf(Expect.toStrictEqual) != CallbackType)
@compileLog("Expected Expect.toStrictEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toStrictEqual)));
if (@TypeOf(Expect.toThrow) != CallbackType)
@compileLog("Expected Expect.toThrow to be a callback but received " ++ @typeName(@TypeOf(Expect.toThrow)));
if (@TypeOf(Expect.toThrowErrorMatchingInlineSnapshot) != CallbackType)
@compileLog("Expected Expect.toThrowErrorMatchingInlineSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toThrowErrorMatchingInlineSnapshot)));
if (@TypeOf(Expect.toThrowErrorMatchingSnapshot) != CallbackType)
@compileLog("Expected Expect.toThrowErrorMatchingSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toThrowErrorMatchingSnapshot)));
if (@TypeOf(Expect.addSnapshotSerializer) != StaticCallbackType)
@compileLog("Expected Expect.addSnapshotSerializer to be a static callback");
if (@TypeOf(Expect.any) != StaticCallbackType)
@compileLog("Expected Expect.any to be a static callback");
if (@TypeOf(Expect.anything) != StaticCallbackType)
@compileLog("Expected Expect.anything to be a static callback");
if (@TypeOf(Expect.arrayContaining) != StaticCallbackType)
@compileLog("Expected Expect.arrayContaining to be a static callback");
if (@TypeOf(Expect.assertions) != StaticCallbackType)
@compileLog("Expected Expect.assertions to be a static callback");
if (@TypeOf(Expect.extend) != StaticCallbackType)
@compileLog("Expected Expect.extend to be a static callback");
if (@TypeOf(Expect.hasAssertions) != StaticCallbackType)
@compileLog("Expected Expect.hasAssertions to be a static callback");
if (@TypeOf(Expect.getStaticNot) != StaticGetterType)
@compileLog("Expected Expect.getStaticNot to be a static getter");
if (@TypeOf(Expect.objectContaining) != StaticCallbackType)
@compileLog("Expected Expect.objectContaining to be a static callback");
if (@TypeOf(Expect.getStaticRejects) != StaticGetterType)
@compileLog("Expected Expect.getStaticRejects to be a static getter");
if (@TypeOf(Expect.getStaticResolves) != StaticGetterType)
@compileLog("Expected Expect.getStaticResolves to be a static getter");
if (@TypeOf(Expect.stringContaining) != StaticCallbackType)
@compileLog("Expected Expect.stringContaining to be a static callback");
if (@TypeOf(Expect.stringMatching) != StaticCallbackType)
@compileLog("Expected Expect.stringMatching to be a static callback");
if (@TypeOf(Expect.call) != StaticCallbackType)
@compileLog("Expected Expect.call to be a static callback");
if (!JSC.is_bindgen) {
@export(Expect.addSnapshotSerializer, .{ .name = "ExpectClass__addSnapshotSerializer" });
@export(Expect.any, .{ .name = "ExpectClass__any" });
@export(Expect.anything, .{ .name = "ExpectClass__anything" });
@export(Expect.arrayContaining, .{ .name = "ExpectClass__arrayContaining" });
@export(Expect.assertions, .{ .name = "ExpectClass__assertions" });
@export(Expect.call, .{ .name = "ExpectClass__call" });
@export(Expect.constructor, .{ .name = "ExpectClass__construct" });
@export(Expect.extend, .{ .name = "ExpectClass__extend" });
@export(Expect.finalize, .{ .name = "ExpectClass__finalize" });
@export(Expect.getNot, .{ .name = "ExpectPrototype__getNot" });
@export(Expect.getRejects, .{ .name = "ExpectPrototype__getRejects" });
@export(Expect.getResolves, .{ .name = "ExpectPrototype__getResolves" });
@export(Expect.getStaticNot, .{ .name = "ExpectClass__getStaticNot" });
@export(Expect.getStaticRejects, .{ .name = "ExpectClass__getStaticRejects" });
@export(Expect.getStaticResolves, .{ .name = "ExpectClass__getStaticResolves" });
@export(Expect.hasAssertions, .{ .name = "ExpectClass__hasAssertions" });
@export(Expect.objectContaining, .{ .name = "ExpectClass__objectContaining" });
@export(Expect.stringContaining, .{ .name = "ExpectClass__stringContaining" });
@export(Expect.stringMatching, .{ .name = "ExpectClass__stringMatching" });
@export(Expect.toBe, .{ .name = "ExpectPrototype__toBe" });
@export(Expect.toBeCloseTo, .{ .name = "ExpectPrototype__toBeCloseTo" });
@export(Expect.toBeDefined, .{ .name = "ExpectPrototype__toBeDefined" });
@export(Expect.toBeFalsy, .{ .name = "ExpectPrototype__toBeFalsy" });
@export(Expect.toBeGreaterThan, .{ .name = "ExpectPrototype__toBeGreaterThan" });
@export(Expect.toBeGreaterThanOrEqual, .{ .name = "ExpectPrototype__toBeGreaterThanOrEqual" });
@export(Expect.toBeInstanceOf, .{ .name = "ExpectPrototype__toBeInstanceOf" });
@export(Expect.toBeLessThan, .{ .name = "ExpectPrototype__toBeLessThan" });
@export(Expect.toBeLessThanOrEqual, .{ .name = "ExpectPrototype__toBeLessThanOrEqual" });
@export(Expect.toBeNaN, .{ .name = "ExpectPrototype__toBeNaN" });
@export(Expect.toBeNull, .{ .name = "ExpectPrototype__toBeNull" });
@export(Expect.toBeTruthy, .{ .name = "ExpectPrototype__toBeTruthy" });
@export(Expect.toBeUndefined, .{ .name = "ExpectPrototype__toBeUndefined" });
@export(Expect.toContain, .{ .name = "ExpectPrototype__toContain" });
@export(Expect.toContainEqual, .{ .name = "ExpectPrototype__toContainEqual" });
@export(Expect.toEqual, .{ .name = "ExpectPrototype__toEqual" });
@export(Expect.toHaveBeenCalledTimes, .{ .name = "ExpectPrototype__toHaveBeenCalledTimes" });
@export(Expect.toHaveBeenCalledWith, .{ .name = "ExpectPrototype__toHaveBeenCalledWith" });
@export(Expect.toHaveBeenLastCalledWith, .{ .name = "ExpectPrototype__toHaveBeenLastCalledWith" });
@export(Expect.toHaveBeenNthCalledWith, .{ .name = "ExpectPrototype__toHaveBeenNthCalledWith" });
@export(Expect.toHaveLastReturnedWith, .{ .name = "ExpectPrototype__toHaveLastReturnedWith" });
@export(Expect.toHaveLength, .{ .name = "ExpectPrototype__toHaveLength" });
@export(Expect.toHaveNthReturnedWith, .{ .name = "ExpectPrototype__toHaveNthReturnedWith" });
@export(Expect.toHaveProperty, .{ .name = "ExpectPrototype__toHaveProperty" });
@export(Expect.toHaveReturnedTimes, .{ .name = "ExpectPrototype__toHaveReturnedTimes" });
@export(Expect.toHaveReturnedWith, .{ .name = "ExpectPrototype__toHaveReturnedWith" });
@export(Expect.toMatch, .{ .name = "ExpectPrototype__toMatch" });
@export(Expect.toMatchInlineSnapshot, .{ .name = "ExpectPrototype__toMatchInlineSnapshot" });
@export(Expect.toMatchObject, .{ .name = "ExpectPrototype__toMatchObject" });
@export(Expect.toMatchSnapshot, .{ .name = "ExpectPrototype__toMatchSnapshot" });
@export(Expect.toStrictEqual, .{ .name = "ExpectPrototype__toStrictEqual" });
@export(Expect.toThrow, .{ .name = "ExpectPrototype__toThrow" });
@export(Expect.toThrowErrorMatchingInlineSnapshot, .{ .name = "ExpectPrototype__toThrowErrorMatchingInlineSnapshot" });
@export(Expect.toThrowErrorMatchingSnapshot, .{ .name = "ExpectPrototype__toThrowErrorMatchingSnapshot" });
}
}
};
pub const JSFileSystemRouter = struct {
const FileSystemRouter = Classes.FileSystemRouter;
const GetterType = fn (*FileSystemRouter, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const GetterTypeWithThisValue = fn (*FileSystemRouter, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const SetterType = fn (*FileSystemRouter, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const SetterTypeWithThisValue = fn (*FileSystemRouter, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const CallbackType = fn (*FileSystemRouter, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
pub fn fromJS(value: JSC.JSValue) ?*FileSystemRouter {
JSC.markBinding(@src());
return FileSystemRouter__fromJS(value);
}
extern fn FileSystemRouterPrototype__originSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
extern fn FileSystemRouterPrototype__originGetCachedValue(JSC.JSValue) JSC.JSValue;
/// `FileSystemRouter.origin` setter
/// This value will be visited by the garbage collector.
pub fn originSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
JSC.markBinding(@src());
FileSystemRouterPrototype__originSetCachedValue(thisValue, globalObject, value);
}
/// `FileSystemRouter.origin` getter
/// This value will be visited by the garbage collector.
pub fn originGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
JSC.markBinding(@src());
const result = FileSystemRouterPrototype__originGetCachedValue(thisValue);
if (result == .zero)
return null;
return result;
}
extern fn FileSystemRouterPrototype__routesSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
extern fn FileSystemRouterPrototype__routesGetCachedValue(JSC.JSValue) JSC.JSValue;
/// `FileSystemRouter.routes` setter
/// This value will be visited by the garbage collector.
pub fn routesSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
JSC.markBinding(@src());
FileSystemRouterPrototype__routesSetCachedValue(thisValue, globalObject, value);
}
/// `FileSystemRouter.routes` getter
/// This value will be visited by the garbage collector.
pub fn routesGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
JSC.markBinding(@src());
const result = FileSystemRouterPrototype__routesGetCachedValue(thisValue);
if (result == .zero)
return null;
return result;
}
extern fn FileSystemRouterPrototype__styleSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
extern fn FileSystemRouterPrototype__styleGetCachedValue(JSC.JSValue) JSC.JSValue;
/// `FileSystemRouter.style` setter
/// This value will be visited by the garbage collector.
pub fn styleSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
JSC.markBinding(@src());
FileSystemRouterPrototype__styleSetCachedValue(thisValue, globalObject, value);
}
/// `FileSystemRouter.style` getter
/// This value will be visited by the garbage collector.
pub fn styleGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
JSC.markBinding(@src());
const result = FileSystemRouterPrototype__styleGetCachedValue(thisValue);
if (result == .zero)
return null;
return result;
}
/// Get the FileSystemRouter constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return FileSystemRouter__getConstructor(globalObject);
}
/// Create a new instance of FileSystemRouter
pub fn toJS(this: *FileSystemRouter, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
if (comptime Environment.allow_assert) {
const value__ = FileSystemRouter__create(globalObject, this);
std.debug.assert(value__.as(FileSystemRouter).? == this); // If this fails, likely a C ABI issue.
return value__;
} else {
return FileSystemRouter__create(globalObject, this);
}
}
/// Modify the internal ptr to point to a new instance of FileSystemRouter.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*FileSystemRouter) bool {
JSC.markBinding(@src());
return FileSystemRouter__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *FileSystemRouter, value: JSC.JSValue) void {
JSC.markBinding(@src());
std.debug.assert(FileSystemRouter__dangerouslySetPtr(value, null));
}
extern fn FileSystemRouter__fromJS(JSC.JSValue) ?*FileSystemRouter;
extern fn FileSystemRouter__getConstructor(*JSC.JSGlobalObject) JSC.JSValue;
extern fn FileSystemRouter__create(globalObject: *JSC.JSGlobalObject, ptr: ?*FileSystemRouter) JSC.JSValue;
extern fn FileSystemRouter__dangerouslySetPtr(JSC.JSValue, ?*FileSystemRouter) bool;
comptime {
if (@TypeOf(FileSystemRouter.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*FileSystemRouter)) {
@compileLog("FileSystemRouter.constructor is not a constructor");
}
if (@TypeOf(FileSystemRouter.finalize) != (fn (*FileSystemRouter) callconv(.C) void)) {
@compileLog("FileSystemRouter.finalize is not a finalizer");
}
if (@TypeOf(FileSystemRouter.match) != CallbackType)
@compileLog("Expected FileSystemRouter.match to be a callback but received " ++ @typeName(@TypeOf(FileSystemRouter.match)));
if (@TypeOf(FileSystemRouter.getOrigin) != GetterType)
@compileLog("Expected FileSystemRouter.getOrigin to be a getter");
if (@TypeOf(FileSystemRouter.reload) != CallbackType)
@compileLog("Expected FileSystemRouter.reload to be a callback but received " ++ @typeName(@TypeOf(FileSystemRouter.reload)));
if (@TypeOf(FileSystemRouter.getRoutes) != GetterType)
@compileLog("Expected FileSystemRouter.getRoutes to be a getter");
if (@TypeOf(FileSystemRouter.getStyle) != GetterType)
@compileLog("Expected FileSystemRouter.getStyle to be a getter");
if (!JSC.is_bindgen) {
@export(FileSystemRouter.constructor, .{ .name = "FileSystemRouterClass__construct" });
@export(FileSystemRouter.finalize, .{ .name = "FileSystemRouterClass__finalize" });
@export(FileSystemRouter.getOrigin, .{ .name = "FileSystemRouterPrototype__getOrigin" });
@export(FileSystemRouter.getRoutes, .{ .name = "FileSystemRouterPrototype__getRoutes" });
@export(FileSystemRouter.getStyle, .{ .name = "FileSystemRouterPrototype__getStyle" });
@export(FileSystemRouter.match, .{ .name = "FileSystemRouterPrototype__match" });
@export(FileSystemRouter.reload, .{ .name = "FileSystemRouterPrototype__reload" });
}
}
};
pub const JSListener = struct {
const Listener = Classes.Listener;
const GetterType = fn (*Listener, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const GetterTypeWithThisValue = fn (*Listener, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const SetterType = fn (*Listener, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const SetterTypeWithThisValue = fn (*Listener, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const CallbackType = fn (*Listener, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
pub fn fromJS(value: JSC.JSValue) ?*Listener {
JSC.markBinding(@src());
return Listener__fromJS(value);
}
extern fn ListenerPrototype__hostnameSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
extern fn ListenerPrototype__hostnameGetCachedValue(JSC.JSValue) JSC.JSValue;
/// `Listener.hostname` setter
/// This value will be visited by the garbage collector.
pub fn hostnameSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
JSC.markBinding(@src());
ListenerPrototype__hostnameSetCachedValue(thisValue, globalObject, value);
}
/// `Listener.hostname` getter
/// This value will be visited by the garbage collector.
pub fn hostnameGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
JSC.markBinding(@src());
const result = ListenerPrototype__hostnameGetCachedValue(thisValue);
if (result == .zero)
return null;
return result;
}
extern fn ListenerPrototype__unixSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
extern fn ListenerPrototype__unixGetCachedValue(JSC.JSValue) JSC.JSValue;
/// `Listener.unix` setter
/// This value will be visited by the garbage collector.
pub fn unixSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
JSC.markBinding(@src());
ListenerPrototype__unixSetCachedValue(thisValue, globalObject, value);
}
/// `Listener.unix` getter
/// This value will be visited by the garbage collector.
pub fn unixGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
JSC.markBinding(@src());
const result = ListenerPrototype__unixGetCachedValue(thisValue);
if (result == .zero)
return null;
return result;
}
/// Create a new instance of Listener
pub fn toJS(this: *Listener, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
if (comptime Environment.allow_assert) {
const value__ = Listener__create(globalObject, this);
std.debug.assert(value__.as(Listener).? == this); // If this fails, likely a C ABI issue.
return value__;
} else {
return Listener__create(globalObject, this);
}
}
/// Modify the internal ptr to point to a new instance of Listener.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*Listener) bool {
JSC.markBinding(@src());
return Listener__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *Listener, value: JSC.JSValue) void {
JSC.markBinding(@src());
std.debug.assert(Listener__dangerouslySetPtr(value, null));
}
extern fn Listener__fromJS(JSC.JSValue) ?*Listener;
extern fn Listener__getConstructor(*JSC.JSGlobalObject) JSC.JSValue;
extern fn Listener__create(globalObject: *JSC.JSGlobalObject, ptr: ?*Listener) JSC.JSValue;
extern fn Listener__dangerouslySetPtr(JSC.JSValue, ?*Listener) bool;
comptime {
if (@TypeOf(Listener.finalize) != (fn (*Listener) callconv(.C) void)) {
@compileLog("Listener.finalize is not a finalizer");
}
if (@TypeOf(Listener.getData) != GetterType)
@compileLog("Expected Listener.getData to be a getter");
if (@TypeOf(Listener.setData) != SetterType)
@compileLog("Expected Listener.setData to be a setter");
if (@TypeOf(Listener.getHostname) != GetterType)
@compileLog("Expected Listener.getHostname to be a getter");
if (@TypeOf(Listener.getPort) != GetterType)
@compileLog("Expected Listener.getPort to be a getter");
if (@TypeOf(Listener.ref) != CallbackType)
@compileLog("Expected Listener.ref to be a callback but received " ++ @typeName(@TypeOf(Listener.ref)));
if (@TypeOf(Listener.reload) != CallbackType)
@compileLog("Expected Listener.reload to be a callback but received " ++ @typeName(@TypeOf(Listener.reload)));
if (@TypeOf(Listener.stop) != CallbackType)
@compileLog("Expected Listener.stop to be a callback but received " ++ @typeName(@TypeOf(Listener.stop)));
if (@TypeOf(Listener.getUnix) != GetterType)
@compileLog("Expected Listener.getUnix to be a getter");
if (@TypeOf(Listener.unref) != CallbackType)
@compileLog("Expected Listener.unref to be a callback but received " ++ @typeName(@TypeOf(Listener.unref)));
if (!JSC.is_bindgen) {
@export(Listener.finalize, .{ .name = "ListenerClass__finalize" });
@export(Listener.getData, .{ .name = "ListenerPrototype__getData" });
@export(Listener.getHostname, .{ .name = "ListenerPrototype__getHostname" });
@export(Listener.getPort, .{ .name = "ListenerPrototype__getPort" });
@export(Listener.getUnix, .{ .name = "ListenerPrototype__getUnix" });
@export(Listener.ref, .{ .name = "ListenerPrototype__ref" });
@export(Listener.reload, .{ .name = "ListenerPrototype__reload" });
@export(Listener.setData, .{ .name = "ListenerPrototype__setData" });
@export(Listener.stop, .{ .name = "ListenerPrototype__stop" });
@export(Listener.unref, .{ .name = "ListenerPrototype__unref" });
}
}
};
pub const JSMD4 = struct {
const MD4 = Classes.MD4;
const GetterType = fn (*MD4, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const GetterTypeWithThisValue = fn (*MD4, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const SetterType = fn (*MD4, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const SetterTypeWithThisValue = fn (*MD4, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const CallbackType = fn (*MD4, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
pub fn fromJS(value: JSC.JSValue) ?*MD4 {
JSC.markBinding(@src());
return MD4__fromJS(value);
}
/// Get the MD4 constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return MD4__getConstructor(globalObject);
}
/// Create a new instance of MD4
pub fn toJS(this: *MD4, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
if (comptime Environment.allow_assert) {
const value__ = MD4__create(globalObject, this);
std.debug.assert(value__.as(MD4).? == this); // If this fails, likely a C ABI issue.
return value__;
} else {
return MD4__create(globalObject, this);
}
}
/// Modify the internal ptr to point to a new instance of MD4.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*MD4) bool {
JSC.markBinding(@src());
return MD4__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *MD4, value: JSC.JSValue) void {
JSC.markBinding(@src());
std.debug.assert(MD4__dangerouslySetPtr(value, null));
}
extern fn MD4__fromJS(JSC.JSValue) ?*MD4;
extern fn MD4__getConstructor(*JSC.JSGlobalObject) JSC.JSValue;
extern fn MD4__create(globalObject: *JSC.JSGlobalObject, ptr: ?*MD4) JSC.JSValue;
extern fn MD4__dangerouslySetPtr(JSC.JSValue, ?*MD4) bool;
comptime {
if (@TypeOf(MD4.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*MD4)) {
@compileLog("MD4.constructor is not a constructor");
}
if (@TypeOf(MD4.finalize) != (fn (*MD4) callconv(.C) void)) {
@compileLog("MD4.finalize is not a finalizer");
}
if (@TypeOf(MD4.getByteLength) != GetterType)
@compileLog("Expected MD4.getByteLength to be a getter");
if (@TypeOf(MD4.digest) != CallbackType)
@compileLog("Expected MD4.digest to be a callback but received " ++ @typeName(@TypeOf(MD4.digest)));
if (@TypeOf(MD4.update) != CallbackType)
@compileLog("Expected MD4.update to be a callback but received " ++ @typeName(@TypeOf(MD4.update)));
if (@TypeOf(MD4.getByteLengthStatic) != StaticGetterType)
@compileLog("Expected MD4.getByteLengthStatic to be a static getter");
if (@TypeOf(MD4.hash) != StaticCallbackType)
@compileLog("Expected MD4.hash to be a static callback");
if (!JSC.is_bindgen) {
@export(MD4.constructor, .{ .name = "MD4Class__construct" });
@export(MD4.digest, .{ .name = "MD4Prototype__digest" });
@export(MD4.finalize, .{ .name = "MD4Class__finalize" });
@export(MD4.getByteLength, .{ .name = "MD4Prototype__getByteLength" });
@export(MD4.getByteLengthStatic, .{ .name = "MD4Class__getByteLengthStatic" });
@export(MD4.hash, .{ .name = "MD4Class__hash" });
@export(MD4.update, .{ .name = "MD4Prototype__update" });
}
}
};
pub const JSMD5 = struct {
const MD5 = Classes.MD5;
const GetterType = fn (*MD5, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const GetterTypeWithThisValue = fn (*MD5, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
const SetterType = fn (*MD5, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const SetterTypeWithThisValue = fn (*MD5, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
const CallbackType = fn (*MD5, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
pub fn fromJS(value: JSC.JSValue) ?*MD5 {
JSC.markBinding(@src());
return MD5__fromJS(value);
}
/// Get the MD5 constructor value.
/// This loads lazily from the global object.