-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Description
Port, board and/or hardware
webassembly
MicroPython version
MicroPython webassembly latest from npm
Reproduction
In here we solved the in
operation check #17604 but if any libraries tries to read the stringified version of a reference we have the same issue via the get
proxy trap.
function test(value) {
return Object.prototype.toString.call(value);
}
import js
js.test({})
Result:
RuntimeError: Aborted(Assertion failed: stringToUTF8Array expects a string (got symbol))
Expected behaviour
We covered Symbol.iterator
we should cover also Symbol.toStringTag
as that's implicitly retrieved when Object.prototype.toString.call(ref)
happens, which is a very common way to retrieve the kind of the reference as it returns:
[object Object]
[object Array]
[object Null]
[object Function]
[object Anything]
This practice is particularly useful when unknown kinds are around and any serializer would like to guess how to handle these, and it's currently breaking a specific PyScript use case which is also pretty common when used in IoT contrained environments.
Observed behaviour
An error is throws every single time.
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree