salesforce/near-membrane

`Symbol.toStringTag` checks for proxies

Closed this issue · 2 comments

This is just a todo to remember to address the Symbol.toStringTag check for proxies. The issue is proxies will Object.prototype.toString.call(proxied) as either an [object Object] or a [object Function] but not as anything else. In those cases the proxied value will need to project a Symbol.toStringTag value to cover it.

For reference you can see this and this.

@jdalton can you take this one?

Additionally, this issue should also hide the function body when stringifying them across the membrane to produce the equivalent to native functions. The sandbox should never get access to the source of a function from the outer realm because the source might contain information (secrets) that they might be able to scrape out of the string value.