mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Fix error when superclass has final String fields
This commit is contained in:
parent
a9f70b76a0
commit
caaf2114bf
|
@ -441,7 +441,7 @@ function $rt_metadata(data) {
|
|||
m.supertypes = data[i + 3];
|
||||
if (m.superclass) {
|
||||
m.supertypes.push(m.superclass);
|
||||
cls.prototype = new m.superclass();
|
||||
cls.prototype = Object.create(m.superclass.prototype);
|
||||
} else {
|
||||
cls.prototype = {};
|
||||
}
|
||||
|
|
|
@ -440,4 +440,17 @@ public class VMTest {
|
|||
a[0] = "bar";
|
||||
assertEquals("foo", b[0]);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void stringConstantsInBaseClass() {
|
||||
new DerivedClassWithConstantFields();
|
||||
}
|
||||
|
||||
static class BaseClassWithConstantFields {
|
||||
public final String foo = "bar";
|
||||
}
|
||||
|
||||
static class DerivedClassWithConstantFields extends BaseClassWithConstantFields {
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user