File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -1135,17 +1135,14 @@ def _as_ref(self) -> Var:
11351135 Returns:
11361136 The reference to the var.
11371137 """
1138- from .object import ObjectVar
1139-
1140- refs = Var (
1141- _js_expr = "refs" ,
1138+ return Var (
1139+ _js_expr = f"refs[{ Var .create (str (self ))} ]" ,
11421140 _var_data = VarData (
11431141 imports = {
11441142 f"$/{ constants .Dirs .STATE_PATH } " : [imports .ImportVar (tag = "refs" )]
11451143 }
11461144 ),
1147- ).to (ObjectVar , Mapping [str , str ])
1148- return refs [LiteralVar .create (str (self ))]
1145+ ).to (str )
11491146
11501147 def js_type (self ) -> StringVar :
11511148 """Returns the javascript type of the object.
Original file line number Diff line number Diff line change @@ -2819,7 +2819,8 @@ class UnionState(BaseState):
28192819 str (UnionState .c3 .c2r .c1 .foo ) == f'{ UnionState .c3 !s} ?.["c2r"]?.["c1"]?.["foo"]' # pyright: ignore [reportOptionalMemberAccess]
28202820 )
28212821 assert (
2822- str (UnionState .c3 .c2r .c1r .foo ) == f'{ UnionState .c3 !s} ?.["c2r"]?.["c1r"]?.["foo"]' # pyright: ignore [reportOptionalMemberAccess]
2822+ str (UnionState .c3 .c2r .c1r .foo )
2823+ == f'{ UnionState .c3 !s} ?.["c2r"]?.["c1r"]?.["foo"]' # pyright: ignore [reportOptionalMemberAccess]
28232824 )
28242825 assert str (UnionState .c3i .c2 ) == f'{ UnionState .c3i !s} ?.["c2"]'
28252826 assert str (UnionState .c3r .c2 ) == f'{ UnionState .c3r !s} ?.["c2"]'
You can’t perform that action at this time.
0 commit comments