Fixed Contract properties that collide with null member properties (#1393).

This commit is contained in:
Richard Moore 2021-03-26 16:37:08 -04:00
parent c47d2eba4d
commit 0e1721b130
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651

@ -741,9 +741,12 @@ export class Contract {
const signature = signatures[0];
if (this[name] == null) {
defineReadOnly(this, name, this[signature]);
}
// If overwriting a member property that is null, swallow the error
try {
if (this[name] == null) {
defineReadOnly(this, name, this[signature]);
}
} catch (e) { }
if (this.functions[name] == null) {
defineReadOnly(this.functions, name, this.functions[signature]);