Skip to content

Commit

Permalink
Fixes incorrect renaming of Second to TupleFirst in 79a3ba
Browse files Browse the repository at this point in the history
  • Loading branch information
filipeom committed Jan 9, 2024
1 parent 548c5b1 commit cda2dc2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ECMA-SL/semantics/extended/compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,15 @@ C_s({e}(e1, ..., en) catch g) =
*)
let build_if_throw_basic (x : string) (s_then : Stmt.t) (at : region) : Stmt.t =
let guard = Expr.UnOpt (TupleFirst, Expr.Var x) in
let s_else = Stmt.Assign (x, Expr.UnOpt (TupleFirst, Expr.Var x)) @> at in
let s_else = Stmt.Assign (x, Expr.UnOpt (TupleSecond, Expr.Var x)) @> at in
Stmt.If (guard, s_then, Some s_else) @> at

let build_if_throw (x : string) (g : string option) (at : region) : Stmt.t =
match g with
| None -> build_if_throw_basic x (Stmt.Return (Expr.Var x) @> at) at
| Some g ->
let args =
[ Expr.Var __INTERNAL_ESL_GLOBAL__; Expr.UnOpt (TupleFirst, Expr.Var x) ]
[ Expr.Var __INTERNAL_ESL_GLOBAL__; Expr.UnOpt (TupleSecond, Expr.Var x) ]
in
let call_stmt = Stmt.AssignCall (x, Expr.Val (Val.Str g), args) @> at in
let inner_if = build_if_throw_basic x (Stmt.Return (Expr.Var x) @> at) at in
Expand Down

0 comments on commit cda2dc2

Please sign in to comment.