mirror of
https://github.com/konsoletyper/teavm.git
synced 2024-11-27 01:30:35 +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