@@ -12,12 +12,12 @@ export interface Binding {
12
12
rubyOptions ( args : string [ ] ) : void ;
13
13
rubyScript ( name : string ) : void ;
14
14
rubyInitLoadpath ( ) : void ;
15
- rbEvalStringProtect ( str : string ) : [ RbAbi . RbAbiValue , number ] ;
16
- rbFuncallvProtect ( recv : RbAbi . RbAbiValue , mid : RbAbi . RbId , args : RbAbi . RbAbiValue [ ] ) : [ RbAbi . RbAbiValue , number ] ;
15
+ rbEvalStringProtect ( str : string ) : [ RbAbiValue , number ] ;
16
+ rbFuncallvProtect ( recv : RbAbiValue , mid : RbAbi . RbId , args : RbAbiValue [ ] ) : [ RbAbiValue , number ] ;
17
17
rbIntern ( name : string ) : RbAbi . RbId ;
18
- rbErrinfo ( ) : RbAbi . RbAbiValue ;
18
+ rbErrinfo ( ) : RbAbiValue ;
19
19
rbClearErrinfo ( ) : void ;
20
- rstringPtr ( value : RbAbi . RbAbiValue ) : string ;
20
+ rstringPtr ( value : RbAbiValue ) : string ;
21
21
rbVmBugreport ( ) : void ;
22
22
rbGcEnable ( ) : boolean ;
23
23
rbGcDisable ( ) : boolean ;
@@ -27,6 +27,9 @@ export interface Binding {
27
27
addToImports ( imports : WebAssembly . Imports ) : void ;
28
28
}
29
29
30
+ // Low-level opaque representation of a Ruby value.
31
+ export interface RbAbiValue { }
32
+
30
33
export class LegacyBinding extends RbAbi . RbAbiGuest implements Binding {
31
34
async setInstance ( instance : WebAssembly . Instance ) : Promise < void > {
32
35
await this . instantiate ( instance ) ;
@@ -53,40 +56,40 @@ export class ComponentBinding implements Binding {
53
56
this . underlying . rubyOptions ( args ) ;
54
57
}
55
58
rubyScript ( name : string ) : void {
56
- throw new Error ( "Method not implemented." ) ;
59
+ this . underlying . rubyScript ( name ) ;
57
60
}
58
61
rubyInitLoadpath ( ) : void {
59
- throw new Error ( "Method not implemented." ) ;
62
+ this . underlying . rubyInitLoadpath ( ) ;
60
63
}
61
- rbEvalStringProtect ( str : string ) : [ RbAbi . RbAbiValue , number ] {
62
- throw new Error ( "Method not implemented." ) ;
64
+ rbEvalStringProtect ( str : string ) : [ RbAbiValue , number ] {
65
+ return this . underlying . rbEvalStringProtect ( str ) ;
63
66
}
64
- rbFuncallvProtect ( recv : RbAbi . RbAbiValue , mid : number , args : RbAbi . RbAbiValue [ ] ) : [ RbAbi . RbAbiValue , number ] {
65
- throw new Error ( "Method not implemented." ) ;
67
+ rbFuncallvProtect ( recv : RbAbiValue , mid : number , args : RbAbiValue [ ] ) : [ RbAbiValue , number ] {
68
+ return this . rbFuncallvProtect ( recv , mid , args ) ;
66
69
}
67
70
rbIntern ( name : string ) : number {
68
- throw new Error ( "Method not implemented." ) ;
71
+ return this . rbIntern ( name ) ;
69
72
}
70
73
rbErrinfo ( ) : RbAbi . RbAbiValue {
71
- throw new Error ( "Method not implemented." ) ;
74
+ return this . rbErrinfo ( ) ;
72
75
}
73
76
rbClearErrinfo ( ) : void {
74
- throw new Error ( "Method not implemented." ) ;
77
+ return this . rbClearErrinfo ( ) ;
75
78
}
76
79
rstringPtr ( value : RbAbi . RbAbiValue ) : string {
77
- throw new Error ( "Method not implemented." ) ;
80
+ return this . rstringPtr ( value ) ;
78
81
}
79
82
rbVmBugreport ( ) : void {
80
- throw new Error ( "Method not implemented." ) ;
83
+ this . rbVmBugreport ( ) ;
81
84
}
82
85
rbGcEnable ( ) : boolean {
83
- throw new Error ( "Method not implemented." ) ;
86
+ return this . rbGcEnable ( ) ;
84
87
}
85
88
rbGcDisable ( ) : boolean {
86
- throw new Error ( "Method not implemented." ) ;
89
+ return this . rbGcDisable ( ) ;
87
90
}
88
91
rbSetShouldProhibitRewind ( newValue : boolean ) : boolean {
89
- throw new Error ( "Method not implemented." ) ;
92
+ return this . rbSetShouldProhibitRewind ( newValue ) ;
90
93
}
91
94
92
95
async setInstance ( instance : WebAssembly . Instance ) : Promise < void > {
0 commit comments