mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 10:44:47 +01:00
fix parameter order of nonGC polyfill call
This commit is contained in:
parent
6ddf5b1c85
commit
5295096d89
@ -81,11 +81,13 @@ class WasmStructInstruction extends WasmInstruction {
|
||||
switch( op ) {
|
||||
case NEW:
|
||||
case NEW_DEFAULT:
|
||||
functionName = new JavaScriptSyntheticFunctionName( "NonGC", "new_" + getSciptTypeName(), () -> "{}", null, type );
|
||||
functionName = new JavaScriptSyntheticFunctionName( "NonGC", "new_" + type.getName().replace( '/', '_' ), () -> {
|
||||
return "() => {return {0:0}}"; //TODO default values of fields and then use Object.seal()
|
||||
}, null, type );
|
||||
break;
|
||||
case SET:
|
||||
AnyType fieldType = fieldName.getType();
|
||||
functionName = new JavaScriptSyntheticFunctionName( "NonGC", "set_" + fieldType, () -> "(a,i,v) => a[i]=v", ValueType.anyref, ValueType.i32, fieldType, null, null );
|
||||
functionName = new JavaScriptSyntheticFunctionName( "NonGC", "set_" + fieldType, () -> "(a,v,i) => a[i]=v", ValueType.anyref, ValueType.i32, fieldType, null, null );
|
||||
break;
|
||||
case GET:
|
||||
fieldType = fieldName.getType();
|
||||
@ -96,10 +98,6 @@ class WasmStructInstruction extends WasmInstruction {
|
||||
return functionName;
|
||||
}
|
||||
|
||||
private String getSciptTypeName() {
|
||||
return type.getName().replace( '/', '_' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the StructOperator
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user