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
It would be handy for a use case I have for this package to support a feature that could inject code verbatim if it appears in a JavaScript object.
To implement, we could use (A) a special object constructor, (B) a special property on a string, or (C) a tagged template literal returning some special value, which would allow us to detect such cases in the serialization code.
I tried a hack similar to #32 (comment) using a function as a value and overriding its toString method, but it didn't work since I can't include ( in the code without it being rewritten as part of the function serialization.
The text was updated successfully, but these errors were encountered:
It would be handy for a use case I have for this package to support a feature that could inject code verbatim if it appears in a JavaScript object.
To implement, we could use (A) a special object constructor, (B) a special property on a string, or (C) a tagged template literal returning some special value, which would allow us to detect such cases in the serialization code.
A:
B:
C:
I tried a hack similar to #32 (comment) using a function as a value and overriding its
toString
method, but it didn't work since I can't include(
in the code without it being rewritten as part of the function serialization.The text was updated successfully, but these errors were encountered: