diff --git a/jscomp/core/js_dump_property.ml b/jscomp/core/js_dump_property.ml index ea1d4bf2c0..6633cc98d2 100644 --- a/jscomp/core/js_dump_property.ml +++ b/jscomp/core/js_dump_property.ml @@ -84,6 +84,7 @@ let property_access f s = let property_key (s : J.property_name) : string = match s with | Lit s -> + let s = Ext_ident.unwrap_uppercase_exotic s in if obj_property_no_need_quot s then s else Js_dump_string.escape_to_string s | Symbol_name -> {|[Symbol.for("name")]|} diff --git a/jscomp/syntax/tests/oprint/expected/oprint.resi.txt b/jscomp/syntax/tests/oprint/expected/oprint.resi.txt index d2cce10ab0..83349c81af 100644 --- a/jscomp/syntax/tests/oprint/expected/oprint.resi.txt +++ b/jscomp/syntax/tests/oprint/expected/oprint.resi.txt @@ -170,7 +170,7 @@ type t22 = [#"Variant ⛰"] type \"let" = int type \"type" = [#"Point🗿"(\"let", float)] type t23 = [#1 | #"10space" | #123] -type exoticUser = {\"let": string, \"type": float} +type exoticUser = {\"let": string, \"type": float, \"Upper": int} type arity1a = unit => int type arity1b = int => int type arity2 = (int, int) => int @@ -184,6 +184,7 @@ type obj6 = {"a": int} type obj7 = {"a": int} type obj8<'a> = 'a constraint 'a = {.."a": int} +type obj9 = {"A": int} type objUser = {"age": int, "name": string} type objUserWithLongFields = { "age": int, @@ -192,6 +193,7 @@ type objUserWithLongFields = { "name": string, "x": int, } +type objUserWithUppsercaseKeys = {"AGE": int, "NAME": string} type objectCoordinate = {"x": float, "y": float} type threeDimensionalCoordinate = {"x": float, "y": float, "z": float} type differentSpreadedCoordinate = { diff --git a/jscomp/syntax/tests/oprint/oprint.res b/jscomp/syntax/tests/oprint/oprint.res index 3af354a61f..c9447566a5 100644 --- a/jscomp/syntax/tests/oprint/oprint.res +++ b/jscomp/syntax/tests/oprint/oprint.res @@ -215,7 +215,8 @@ type t23 = [ type exoticUser = { \"let": string, - \"type": float + \"type": float, + \"Upper": int } type arity1a = (. ()) => int @@ -230,9 +231,11 @@ type obj5<'a> = {..} as 'a type obj6 = {"a": int} type obj7 = {. "a": int} type obj8<'a> = {.. "a": int} as 'a +type obj9 = {"A": int} type objUser = {"name": string, "age": int} type objUserWithLongFields = {"name": string, "x": int, "age": int, "looooooongFiiiiiiiieeeeeeeldName": string, "anoooooooooooooooootherLongFiiiiiieeeeeeeldName": int} +type objUserWithUppsercaseKeys = {"NAME": string, "AGE": int} type objectCoordinate = {"x": float, "y": float} type threeDimensionalCoordinate = {...objectCoordinate, "z": float} diff --git a/jscomp/syntax/tests/printer/expr/exoticIdent.res b/jscomp/syntax/tests/printer/expr/exoticIdent.res index c096f19c5d..f1fda7ccc5 100644 --- a/jscomp/syntax/tests/printer/expr/exoticIdent.res +++ b/jscomp/syntax/tests/printer/expr/exoticIdent.res @@ -52,3 +52,13 @@ assert(\"let") let x = 1 let x =