@@ -188,10 +188,10 @@ class WasmFoundationTests: XCTestCase {
188188
189189 // This test tests whether re-exported imports and module defined globals are re-ordered from the typer.
190190 let wasmGlobali32 : Variable = b. createWasmGlobal ( value: . wasmi32( 1337 ) , isMutable: true )
191- XCTAssertEqual ( b. type ( of: wasmGlobali32) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmi32, isMutable: true ) ) )
191+ XCTAssertEqual ( b. type ( of: wasmGlobali32) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withMethods : [ " valueOf " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmi32, isMutable: true ) ) )
192192
193193 let wasmGlobalf32 : Variable = b. createWasmGlobal ( value: . wasmf32( 42.0 ) , isMutable: false )
194- XCTAssertEqual ( b. type ( of: wasmGlobalf32) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmf32, isMutable: false ) ) )
194+ XCTAssertEqual ( b. type ( of: wasmGlobalf32) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withMethods : [ " valueOf " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmf32, isMutable: false ) ) )
195195
196196 let module = b. buildWasmModule { wasmModule in
197197 // Imports are always before internal globals, this breaks the logic if we add a global and then import a global.
@@ -429,7 +429,7 @@ class WasmFoundationTests: XCTestCase {
429429 let b = fuzzer. makeBuilder ( )
430430
431431 let wasmGlobali64 : Variable = b. createWasmGlobal ( value: . wasmi64( 1337 ) , isMutable: true )
432- XCTAssertEqual ( b. type ( of: wasmGlobali64) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmi64, isMutable: true ) ) )
432+ XCTAssertEqual ( b. type ( of: wasmGlobali64) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withMethods : [ " valueOf " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmi64, isMutable: true ) ) )
433433
434434 let module = b. buildWasmModule { wasmModule in
435435 let global = wasmModule. addGlobal ( wasmGlobal: . wasmi64( 1339 ) , isMutable: true )
@@ -499,7 +499,7 @@ class WasmFoundationTests: XCTestCase {
499499 let module = b. buildWasmModule { wasmModule in
500500 // Note that globals of exnref can only be defined in wasm, not in JS.
501501 let global = wasmModule. addGlobal ( wasmGlobal: . exnref, isMutable: true )
502- XCTAssertEqual ( b. type ( of: global) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmExnRef, isMutable: true ) ) )
502+ XCTAssertEqual ( b. type ( of: global) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withMethods : [ " valueOf " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmExnRef, isMutable: true ) ) )
503503
504504 wasmModule. addWasmFunction ( with: [ ] => [ . wasmi32] ) { function, label, args in
505505 let value = function. wasmLoadGlobal ( globalVariable: global)
@@ -586,7 +586,7 @@ class WasmFoundationTests: XCTestCase {
586586
587587 let module = b. buildWasmModule { wasmModule in
588588 let global = wasmModule. addGlobal ( wasmGlobal: . externref, isMutable: true )
589- XCTAssertEqual ( b. type ( of: global) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmExternRef, isMutable: true ) ) )
589+ XCTAssertEqual ( b. type ( of: global) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withMethods : [ " valueOf " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmExternRef, isMutable: true ) ) )
590590
591591 wasmModule. addWasmFunction ( with: [ ] => [ . wasmExternRef] ) { function, label, args in
592592 [ function. wasmLoadGlobal ( globalVariable: global) ]
@@ -626,7 +626,7 @@ class WasmFoundationTests: XCTestCase {
626626 let b = fuzzer. makeBuilder ( )
627627
628628 let global : Variable = b. createWasmGlobal ( value: . externref, isMutable: true )
629- XCTAssertEqual ( b. type ( of: global) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmExternRef, isMutable: true ) ) )
629+ XCTAssertEqual ( b. type ( of: global) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withMethods : [ " valueOf " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmExternRef, isMutable: true ) ) )
630630
631631 let outputFunc = b. createNamedVariable ( forBuiltin: " output " )
632632 // The initial value is "undefined" (because we didn't provide an explicit initialization).
@@ -651,7 +651,7 @@ class WasmFoundationTests: XCTestCase {
651651
652652 let module = b. buildWasmModule { wasmModule in
653653 let global = wasmModule. addGlobal ( wasmGlobal: . i31ref, isMutable: true )
654- XCTAssertEqual ( b. type ( of: global) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmI31Ref, isMutable: true ) ) )
654+ XCTAssertEqual ( b. type ( of: global) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withMethods : [ " valueOf " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmI31Ref, isMutable: true ) ) )
655655
656656 wasmModule. addWasmFunction ( with: [ ] => [ . wasmI31Ref] ) { function, label, args in
657657 [ function. wasmLoadGlobal ( globalVariable: global) ]
@@ -690,7 +690,7 @@ class WasmFoundationTests: XCTestCase {
690690 let b = fuzzer. makeBuilder ( )
691691
692692 let global : Variable = b. createWasmGlobal ( value: . i31ref, isMutable: true )
693- XCTAssertEqual ( b. type ( of: global) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmI31Ref, isMutable: true ) ) )
693+ XCTAssertEqual ( b. type ( of: global) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withMethods : [ " valueOf " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmI31Ref, isMutable: true ) ) )
694694
695695 let outputFunc = b. createNamedVariable ( forBuiltin: " output " )
696696 // The initial value is "null" (because we didn't provide an explicit initialization).
@@ -6268,7 +6268,7 @@ class WasmJSPITests: XCTestCase {
62686268 let b = fuzzer. makeBuilder ( )
62696269
62706270 let wasmGlobali64 : Variable = b. createWasmGlobal ( value: . wasmi64( 1337 ) , isMutable: true )
6271- XCTAssertEqual ( b. type ( of: wasmGlobali64) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmi64, isMutable: true ) ) )
6271+ XCTAssertEqual ( b. type ( of: wasmGlobali64) , . object( ofGroup: " WasmGlobal " , withProperties: [ " value " ] , withMethods : [ " valueOf " ] , withWasmType: WasmGlobalType ( valueType: ILType . wasmi64, isMutable: true ) ) )
62726272
62736273 let module = b. buildWasmModule { wasmModule in
62746274 // Function 0, modifies the imported global.
0 commit comments