Skip to content

Commit

Permalink
CR
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierNicole committed Sep 4, 2024
1 parent ee43168 commit 49ae88c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions compiler/lib/source_map.ml
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,17 @@ module Index = struct
| `Assoc fields -> (
let string name json = Option.map ~f:string_of_stringlit (stringlit name json) in
let file = string "file" fields in
(match List.assoc "version" fields with
| `Intlit v ->
if not (Int.equal (int_of_string v) 3)
then
invalid_arg
(Printf.sprintf
"Source_map.Index.of_json: sourcemap version %s not supported"
v)
| _ -> invalid_arg "Source_map.Index.of_json: non-integer `version` value"
| exception Not_found ->
warn "warning: Missing `version` field in sourcemap");
match List.assoc "sections" fields with
| `List sections ->
let sections = List.map ~f:section_of_json sections in
Expand Down

0 comments on commit 49ae88c

Please sign in to comment.