From 9e549cc92381428f827b06058405f6507ba1853a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Tsnobiladz=C3=A9?= Date: Thu, 18 Apr 2024 19:29:32 +0200 Subject: [PATCH] Revert "allow hyphen in jsx prop names" (#6705) This reverts commit 1ec144b4acd8ca54438a946bb6c666159f7afa7e. --- CHANGELOG.md | 4 ++++ jscomp/syntax/src/res_printer.ml | 1 - .../syntax/tests/printer/expr/expected/exoticIdent.res.txt | 2 +- jscomp/syntax/tests/printer/expr/expected/jsx.res.txt | 5 ----- jscomp/syntax/tests/printer/expr/jsx.res | 1 - 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ccaf4bd3e..8449ec9292 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ # 11.1.0-rc.9 (Unreleased) +#### :bug: Bug Fix + +- revert escape JSX prop names with hyphens (#6705). https://github.com/rescript-lang/rescript-compiler/pull/6731. + # 11.1.0-rc.8 #### :rocket: New Feature diff --git a/jscomp/syntax/src/res_printer.ml b/jscomp/syntax/src/res_printer.ml index 96541a8d06..c7a715f8ce 100644 --- a/jscomp/syntax/src/res_printer.ml +++ b/jscomp/syntax/src/res_printer.ml @@ -4410,7 +4410,6 @@ and printJsxProps ~state args cmtTbl : Doc.t * Parsetree.expression option = loop [] args and printJsxProp ~state arg cmtTbl = - let printIdentLike ident = printIdentLike ~allowHyphen:true ident in match arg with | ( ((Asttypes.Labelled lblTxt | Optional lblTxt) as lbl), { diff --git a/jscomp/syntax/tests/printer/expr/expected/exoticIdent.res.txt b/jscomp/syntax/tests/printer/expr/expected/exoticIdent.res.txt index 21212ee4a8..d3dc9ecd77 100644 --- a/jscomp/syntax/tests/printer/expr/expected/exoticIdent.res.txt +++ b/jscomp/syntax/tests/printer/expr/expected/exoticIdent.res.txt @@ -62,7 +62,7 @@ lazy \"let" let x = 1 let x = -
+
\"module" \"let"
diff --git a/jscomp/syntax/tests/printer/expr/expected/jsx.res.txt b/jscomp/syntax/tests/printer/expr/expected/jsx.res.txt index e3912ef814..8c689a829c 100644 --- a/jscomp/syntax/tests/printer/expr/expected/jsx.res.txt +++ b/jscomp/syntax/tests/printer/expr/expected/jsx.res.txt @@ -47,11 +47,6 @@ let x = {a} -let x = - - {a} - - let x =
diff --git a/jscomp/syntax/tests/printer/expr/jsx.res b/jscomp/syntax/tests/printer/expr/jsx.res index a44ecaa71f..c86868bc38 100644 --- a/jscomp/syntax/tests/printer/expr/jsx.res +++ b/jscomp/syntax/tests/printer/expr/jsx.res @@ -17,7 +17,6 @@ let x = {a} let x = {a} {b} let x = {a} let x = {a} -let x = {a} let x =