fix prototype to string
This commit is contained in:
parent
7f3342e6c9
commit
a646e16f7b
@ -929,13 +929,13 @@ class Var(Generic[VAR_TYPE]):
|
|||||||
Returns:
|
Returns:
|
||||||
The string var.
|
The string var.
|
||||||
"""
|
"""
|
||||||
from .function import JSON_STRINGIFY, OBJECT_PROTOTYPE_TO_STRING
|
from .function import JSON_STRINGIFY, PROTOTYPE_TO_STRING
|
||||||
from .sequence import StringVar
|
from .sequence import StringVar
|
||||||
|
|
||||||
return (
|
return (
|
||||||
JSON_STRINGIFY.call(self).to(StringVar)
|
JSON_STRINGIFY.call(self).to(StringVar)
|
||||||
if use_json
|
if use_json
|
||||||
else OBJECT_PROTOTYPE_TO_STRING.call(self).to(StringVar)
|
else PROTOTYPE_TO_STRING.call(self).to(StringVar)
|
||||||
)
|
)
|
||||||
|
|
||||||
def as_ref(self) -> Var:
|
def as_ref(self) -> Var:
|
||||||
|
@ -180,4 +180,6 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar):
|
|||||||
|
|
||||||
|
|
||||||
JSON_STRINGIFY = FunctionStringVar.create("JSON.stringify")
|
JSON_STRINGIFY = FunctionStringVar.create("JSON.stringify")
|
||||||
OBJECT_PROTOTYPE_TO_STRING = FunctionStringVar.create("Object.prototype.toString")
|
PROTOTYPE_TO_STRING = FunctionStringVar.create(
|
||||||
|
"((__to_string) => __to_string.toString())"
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user