Skip to content

Commit

Permalink
Reflect symbols in the Contract Proxy to target (#4048).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jul 24, 2023
1 parent 93af87c commit ac2f5e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src.ts/contract/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ export class BaseContract implements Addressable, EventEmitterable<ContractEvent
// Return a Proxy that will respond to functions
return new Proxy(this, {
get: (target, _prop, receiver) => {
if (_prop in target || passProperties.indexOf(<string>_prop) >= 0) {
if (_prop in target || passProperties.indexOf(<string>_prop) >= 0 || typeof(_prop) === "symbol") {
return Reflect.get(target, _prop, receiver);
}

Expand All @@ -767,7 +767,7 @@ export class BaseContract implements Addressable, EventEmitterable<ContractEvent
throw new Error(`unknown contract method: ${ prop }`);
},
has: (target, prop) => {
if (prop in target || passProperties.indexOf(<string>prop) >= 0) {
if (prop in target || passProperties.indexOf(<string>prop) >= 0 || typeof(prop) === "symbol") {
return Reflect.has(target, prop);
}

Expand Down

0 comments on commit ac2f5e5

Please # to comment.