Skip to content

Commit c414faf

Browse files
committed
Don't accept label for while
1 parent 940b42c commit c414faf

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

jscomp/core/js_stmt_make.ml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ let if_ ?comment ?declaration ?else_ (e : J.expression) (then_ : J.block) : t =
318318
let assign ?comment id e : t =
319319
{ statement_desc = J.Exp (E.assign (E.var id) e); comment }
320320

321-
let while_ ?comment ?label ?env (e : E.t) (st : J.block) : t =
321+
let while_ ?comment ?env (e : E.t) (st : J.block) : t =
322322
let env = match env with None -> Js_closure.empty () | Some x -> x in
323-
{ statement_desc = While (label, e, st, env); comment }
323+
{ statement_desc = While (None, e, st, env); comment }
324324

325325
let for_ ?comment ?env for_ident_expression finish_ident_expression id direction
326326
(b : J.block) : t =
@@ -335,15 +335,6 @@ let for_ ?comment ?env for_ident_expression finish_ident_expression id direction
335335
let try_ ?comment ?with_ ?finally body : t =
336336
{ statement_desc = Try (body, with_, finally); comment }
337337

338-
(* TODO:
339-
actually, only loops can be labelled
340-
*)
341-
(* let continue_stmt ?comment ?(label="") () : t =
342-
{
343-
statement_desc = J.Continue label;
344-
comment;
345-
} *)
346-
347338
let continue_ : t = { statement_desc = Continue None; comment = None }
348339

349340
let debugger_block : t list = [ { statement_desc = Debugger; comment = None } ]

jscomp/core/js_stmt_make.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ val assign : ?comment:string -> J.ident -> J.expression -> t
132132

133133
val while_ :
134134
?comment:string ->
135-
?label:J.label ->
136135
?env:Js_closure.t ->
137136
J.expression ->
138137
J.block ->

0 commit comments

Comments
 (0)