@@ -12,12 +12,12 @@ export interface Binding {
1212 rubyOptions ( args : string [ ] ) : void ;
1313 rubyScript ( name : string ) : void ;
1414 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 ] ;
1717 rbIntern ( name : string ) : RbAbi . RbId ;
18- rbErrinfo ( ) : RbAbi . RbAbiValue ;
18+ rbErrinfo ( ) : RbAbiValue ;
1919 rbClearErrinfo ( ) : void ;
20- rstringPtr ( value : RbAbi . RbAbiValue ) : string ;
20+ rstringPtr ( value : RbAbiValue ) : string ;
2121 rbVmBugreport ( ) : void ;
2222 rbGcEnable ( ) : boolean ;
2323 rbGcDisable ( ) : boolean ;
@@ -27,6 +27,9 @@ export interface Binding {
2727 addToImports ( imports : WebAssembly . Imports ) : void ;
2828}
2929
30+ // Low-level opaque representation of a Ruby value.
31+ export interface RbAbiValue { }
32+
3033export class LegacyBinding extends RbAbi . RbAbiGuest implements Binding {
3134 async setInstance ( instance : WebAssembly . Instance ) : Promise < void > {
3235 await this . instantiate ( instance ) ;
@@ -53,40 +56,40 @@ export class ComponentBinding implements Binding {
5356 this . underlying . rubyOptions ( args ) ;
5457 }
5558 rubyScript ( name : string ) : void {
56- throw new Error ( "Method not implemented." ) ;
59+ this . underlying . rubyScript ( name ) ;
5760 }
5861 rubyInitLoadpath ( ) : void {
59- throw new Error ( "Method not implemented." ) ;
62+ this . underlying . rubyInitLoadpath ( ) ;
6063 }
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 ) ;
6366 }
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 ) ;
6669 }
6770 rbIntern ( name : string ) : number {
68- throw new Error ( "Method not implemented." ) ;
71+ return this . rbIntern ( name ) ;
6972 }
7073 rbErrinfo ( ) : RbAbi . RbAbiValue {
71- throw new Error ( "Method not implemented." ) ;
74+ return this . rbErrinfo ( ) ;
7275 }
7376 rbClearErrinfo ( ) : void {
74- throw new Error ( "Method not implemented." ) ;
77+ return this . rbClearErrinfo ( ) ;
7578 }
7679 rstringPtr ( value : RbAbi . RbAbiValue ) : string {
77- throw new Error ( "Method not implemented." ) ;
80+ return this . rstringPtr ( value ) ;
7881 }
7982 rbVmBugreport ( ) : void {
80- throw new Error ( "Method not implemented." ) ;
83+ this . rbVmBugreport ( ) ;
8184 }
8285 rbGcEnable ( ) : boolean {
83- throw new Error ( "Method not implemented." ) ;
86+ return this . rbGcEnable ( ) ;
8487 }
8588 rbGcDisable ( ) : boolean {
86- throw new Error ( "Method not implemented." ) ;
89+ return this . rbGcDisable ( ) ;
8790 }
8891 rbSetShouldProhibitRewind ( newValue : boolean ) : boolean {
89- throw new Error ( "Method not implemented." ) ;
92+ return this . rbSetShouldProhibitRewind ( newValue ) ;
9093 }
9194
9295 async setInstance ( instance : WebAssembly . Instance ) : Promise < void > {
0 commit comments