mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +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 ) {
|
switch( op ) {
|
||||||
case NEW:
|
case NEW:
|
||||||
case NEW_DEFAULT:
|
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;
|
break;
|
||||||
case SET:
|
case SET:
|
||||||
AnyType fieldType = fieldName.getType();
|
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;
|
break;
|
||||||
case GET:
|
case GET:
|
||||||
fieldType = fieldName.getType();
|
fieldType = fieldName.getType();
|
||||||
@ -96,10 +98,6 @@ class WasmStructInstruction extends WasmInstruction {
|
|||||||
return functionName;
|
return functionName;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getSciptTypeName() {
|
|
||||||
return type.getName().replace( '/', '_' );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the StructOperator
|
* Get the StructOperator
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user