this repo has no description

Fix backend_name: move after read_meta and add meta tag fallback

backend_name used read_meta before it was defined. Move it after
read_meta and add fallback to <meta name="x-ocaml-backend"> for when
x-ocaml.js is loaded via a plain <script src> (Js_url) without custom
attributes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+8 -8
+8 -8
src/x_ocaml.ml
··· 8 8 | None -> None 9 9 | Some url -> Some (Jstr.to_string url) 10 10 11 - let backend_name = 12 - match current_attribute "backend" with 13 - | Some name -> Jstr.to_string name 14 - | None -> 15 - match read_meta "x-ocaml-backend" with 16 - | Some name -> name 17 - | None -> "builtin" 18 - 19 11 let read_meta name = 20 12 let doc = Brr.Document.to_jv Brr.G.document in 21 13 let selector = Jstr.of_string ("meta[name=\"" ^ name ^ "\"]") in ··· 25 17 let content = Jv.call result "getAttribute" [| Jv.of_string "content" |] in 26 18 if Jv.is_none content then None 27 19 else Some (Jv.to_string content) 20 + 21 + let backend_name = 22 + match current_attribute "backend" with 23 + | Some name -> Jstr.to_string name 24 + | None -> 25 + match read_meta "x-ocaml-backend" with 26 + | Some name -> name 27 + | None -> "builtin" 28 28 29 29 let findlib_requires = 30 30 match read_meta "x-ocaml-packages" with