mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
JS: fix class of object created by multianewarray instruction
This commit is contained in:
parent
c89bc11d02
commit
7058a195b7
|
@ -1479,7 +1479,7 @@ public class StatementRenderer implements ExprVisitor, StatementVisitor {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
writer.append("$rt_createMultiArray(");
|
writer.append("$rt_createMultiArray(");
|
||||||
context.typeToClsString(writer, expr.getType());
|
context.typeToClsString(writer, type);
|
||||||
writer.append(",").ws();
|
writer.append(",").ws();
|
||||||
}
|
}
|
||||||
writer.append("[");
|
writer.append("[");
|
||||||
|
|
|
@ -579,4 +579,16 @@ public class VMTest {
|
||||||
array.wait(1);
|
array.wait(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void castMultiArray() {
|
||||||
|
Object o = new String[0][0];
|
||||||
|
assertEquals(0, ((String[][]) o).length);
|
||||||
|
o = new String[0][];
|
||||||
|
assertEquals(0, ((String[][]) o).length);
|
||||||
|
o = new int[0][0];
|
||||||
|
assertEquals(0, ((int[][]) o).length);
|
||||||
|
o = new int[0][];
|
||||||
|
assertEquals(0, ((int[][]) o).length);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user