mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
implement Class.getComponentType(), WIP
This commit is contained in:
parent
3f89240a8b
commit
67f8fd4355
@ -173,6 +173,14 @@ class ReplacementForClass {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replacement of the native Java methods getComponentType()
|
||||
*/
|
||||
ReplacementForClass getComponentType() {
|
||||
int classIdx = getIntFromMemory( vtable + TypeManager.TYPE_DESCRIPTION_ARRAY_TYPE );
|
||||
return classIdx >= 0 ? classConstant( classIdx ) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replacement of the native Java methods
|
||||
*
|
||||
|
@ -63,6 +63,7 @@ public class StructsNonGC extends AbstractBaseTest {
|
||||
addParam( list, script, "classClassName" );
|
||||
addParam( list, script, "classConst" );
|
||||
addParam( list, script, "intClassName" );
|
||||
addParam( list, script, "getComponentType" );
|
||||
addParam( list, script, "branchWithObjectResult" );
|
||||
}
|
||||
rule.setTestParameters( list );
|
||||
@ -218,6 +219,13 @@ public class StructsNonGC extends AbstractBaseTest {
|
||||
return JSObject.domString( clazz.getName() );
|
||||
}
|
||||
|
||||
@Export
|
||||
static boolean getComponentType() {
|
||||
Class<?> clazz = byte.class;
|
||||
clazz = clazz.getComponentType();
|
||||
return clazz == null;
|
||||
}
|
||||
|
||||
@Export
|
||||
static int branchWithObjectResult() {
|
||||
Integer val1 = 42;
|
||||
|
Loading…
x
Reference in New Issue
Block a user