You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hit this in the same experimentation that led to #26. Casting from strings to StringValues is extremely finicky, in ways I don't quite understand. It appears that round-tripping a string from Ink to js to Ink works, and the string looks like a normal string in the console. But if I return a string defined in JavaScript from an external function, then it will fail unless I use new String("foo"), apparently because "foo" instanceof String is false.
I don't know JavaScript well enough to understand how this behavior is even possible, but it happens.
The text was updated successfully, but these errors were encountered:
....right. Surely there's a npm module for that!
Just kidding, but yes, the String detection tests ned revision. Thanks for pointing it out! Feel free to submit a PR, otherwise I'll have a look at it when I get the chance.
I hit this in the same experimentation that led to #26. Casting from strings to StringValues is extremely finicky, in ways I don't quite understand. It appears that round-tripping a string from Ink to js to Ink works, and the string looks like a normal string in the console. But if I return a string defined in JavaScript from an external function, then it will fail unless I use
new String("foo")
, apparently because"foo" instanceof String
is false.I don't know JavaScript well enough to understand how this behavior is even possible, but it happens.
The text was updated successfully, but these errors were encountered: