Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: attempt to add test for printexn issue #482

Merged
merged 3 commits into from
Feb 20, 2023
Merged

Conversation

jchavarri
Copy link
Member

No description provided.

@anmonteiro anmonteiro marked this pull request as ready for review February 11, 2023 02:14
@anmonteiro
Copy link
Member

I implemented exn_slot_id in the runtime (which wasn't implemented since exceptions moved to being a record).

but there are some builtin exceptions for which it'll return -1, because e.g. in stdlib.js var Not_found = "Not_found" for example.

@jchavarri
Copy link
Member Author

there are some builtin exceptions for which it'll return -1, because e.g. in stdlib.js var Not_found = "Not_found" for example.

I guess this is ok? Assuming the only purpose of these functions is to print / log exceptions, and not something else 🤔 I have never used these functions tbh.

There are some test failures related to the change:

File "/build/source/_build/default/jscomp/runtime/caml_exceptions.ml", line 92, characters 14-29:
92 |   let parts = Js_string.split "/" x.id in
                   ^^^^^^^^^^^^^^^
Error: Unbound module Js_string

@anmonteiro
Copy link
Member

I guess this is ok?

I think it's OK, just that the results between OCaml / JS won't be reliably equal (or at all).

@anmonteiro anmonteiro merged commit 66b2207 into main Feb 20, 2023
@anmonteiro anmonteiro deleted the test/print-exn branch February 20, 2023 17:14
anmonteiro added a commit to anmonteiro/opam-repository that referenced this pull request May 31, 2023
CHANGES:

- melange: print an error message if `$MELANGELIB` is set to a directory that
  doesn't exist ([melange-re/melange#449](melange-re/melange#449))
- melange: fix bug where `--bs-module-name` didn't always affect generated JS
  file casing ([melange-re/melange#446](melange-re/melange#446))
- melange: fix bug where `-o output.js` didn't always write a JavaScript file
  ([melange-re/melange#454](melange-re/melange#454))
- melange: remove the `-bs-read-cmi` flag in favor of the builtin
  `-intf-suffix` flag, standard in OCaml
  ([melange-re/melange#458](melange-re/melange#458),
  [melange-re/melange#460](melange-re/melange#460))
- melange: return an actionable error message when no output is specified
  with `-impl` / `-intf`
  ([melange-re/melange#465](melange-re/melange#465),
  [melange-re/melange#466](melange-re/melange#466))
- melange: use `Object.prototype.hasOwnProperty` in the `Caml_obj` runtime
  ([melange-re/melange#469](melange-re/melange#469))
- melange: transform
  [`NonEscapeCharacter`](https://tc39.es/ecma262/#prod-NonEscapeCharacter)
  correctly in JS strings (those written using `{js|string here|js}`)
  ([melange-re/melange#469](melange-re/melange#469))
- melange: define `MELANGE` conditional compilation variable
  ([melange-re/melange#472](melange-re/melange#472))
- melange: Make `Pervasives` exactly match the `Stdlib` behavior
  ([melange-re/melange#476](melange-re/melange#476))
- melange: fix unbound error when trying to use `Printexc.exn_slot_id`
  ([melange-re/melange#482](melange-re/melange#482))
- melange: fix codegen issue accessing a nested module path that is also
  `include`d ([melange-re/melange#487](melange-re/melange#487))
- melange: preserve the correct command-line order for load path directories
  ([melange-re/melange#492](melange-re/melange#492))
- melange: respect the `-nostdlib` option; don't add stdlib / runtime to the
  load path in that case
  ([melange-re/melange#496](melange-re/melange#496))
- melange: build the Melange runtime / stdlib / runtime tests with the dune
  integration ([melange-re/melange#493](melange-re/melange#493)). Thus
  melange now requires Dune 3.8.
- melange: allow shadowing sub-modules of Stdlib in user projects
  ([melange-re/melange#512](melange-re/melange#512))
- melange, reactjs-jsx-ppx: introduce a `reactjs-jsx-ppx` package, remove its
  dependency from melange
  ([melange-re/melange#517](melange-re/melange#517))
- melange: remove the `--bs-jsx <version>` flag from `melc` now that
  `reactjs-jsx-ppx` is a separate package
  ([melange-re/melange#525](melange-re/melange#525))
- melange: add `melpp` executable to preprocess `#if` conditionals with the
  melange parser ([melange-re/melange#539](melange-re/melange#539))
- mel: delete the `mel` package. The dune integration is now the only
  officially supported workflow for orchestrating melange builds
  ([melange-re/melange#546](melange-re/melange#546))
- melange: Extract `melange.ppx` from the melange package. This preprocessing
  step interprets extensions such as `%bs.obj`, `%bs.raw`, `%bs.re`, etc.
  ([melange-re/melange#534](melange-re/melange#534))
- melange: allow installing melange in more OCaml versions and compiler
  switches. Melange now migrates binary AST to the version it understands
  ([melange-re/melange#548](melange-re/melange#548))
- melange: don't run anonymous args function from
  `[@@@bs.config {flags = [| ... |]}]` attributes
  ([melange-re/melange#554](melange-re/melange#554))
- melange: add `--preamble` flag to add a preamble to emitted JS. An example is
  `"use client";` in React Server Components, which needs to appear before
  imports ([melange-re/melange#545](melange-re/melange#545),
  [melange-re/melange#574](melange-re/melange#574))
- melange: turn off warning 20 (`ignore-extra-argument`) by default. This
  warning is rarely useful in Melange due to false positives when invoking
  functions defined with `%bs.raw`
  ([melange-re/melange#488](melange-re/melange#488),
  [melange-re/melange#576](melange-re/melange#576))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants