Skip to content

Commit

Permalink
Add type guard for AsyncGeneratorValidate / Preser refinements for Co…
Browse files Browse the repository at this point in the history
…mpletion
  • Loading branch information
jhnaldo committed Sep 22, 2024
1 parent 33cd183 commit c5fea4b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/scala/esmeta/analyzer/TypeAnalyzer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class TypeAnalyzer(
AbsValue(refined, Map())
},
"Completion" -> { (xs, vs, retTy) =>
AbsValue(vs(0).ty && CompT, Map())
vs(0)AbsValue(CompT)
},
"NormalCompletion" -> { (xs, vs, retTy) =>
AbsValue(NormalT(vs(0).ty -- CompT), Map())
Expand Down Expand Up @@ -492,6 +492,13 @@ class TypeAnalyzer(
xs(0).map { x => map += True -> Map(x -> (ObjectT || SymbolT)) }
AbsValue(retTy, map)
},
"AsyncGeneratorValidate" -> { (xs, vs, retTy) =>
var map: Refinements = Map()
xs(0).map { x =>
map += Normal -> Map(x -> RecordT("AsyncGenerator"))
}
AbsValue(retTy, map)
},
)

/** update return points */
Expand Down

0 comments on commit c5fea4b

Please sign in to comment.