Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

# 12.0.0-alpha.11 (Unreleased)

#### :bug: Bug fix

- Fix `Error.fromException`. https://github.com/rescript-lang/rescript/pull/7364

# 12.0.0-alpha.10

#### :rocket: New Feature

- Add `Dict.has` and double `Dict.forEachWithKey`/`Dict.mapValues` performance. https://github.com/rescript-lang/rescript/pull/7316
Expand Down
8 changes: 4 additions & 4 deletions lib/es6/Stdlib_Error.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@


import * as Stdlib_Exn from "./Stdlib_Exn.js";
import * as Primitive_option from "./Primitive_option.js";

function fromException(exn) {
if (exn.TAG === "Ok") {
return;
} else {
return Primitive_option.some(exn._0);
if (exn.RE_EXN_ID === Stdlib_Exn.$$Error) {
return Primitive_option.some(exn._1);
}

}

let $$EvalError = {};
Expand Down
8 changes: 4 additions & 4 deletions lib/js/Stdlib_Error.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use strict';

let Stdlib_Exn = require("./Stdlib_Exn.js");
let Primitive_option = require("./Primitive_option.js");

function fromException(exn) {
if (exn.TAG === "Ok") {
return;
} else {
return Primitive_option.some(exn._0);
if (exn.RE_EXN_ID === Stdlib_Exn.$$Error) {
return Primitive_option.some(exn._1);
}

}

let $$EvalError = {};
Expand Down
2 changes: 1 addition & 1 deletion runtime/Stdlib_Error.res
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type t = Stdlib_Exn.t

let fromException: exn => option<t> = exn =>
switch Obj.magic(exn) {
| Error(t) => Some(t)
| Stdlib_Exn.Error(t) => Some(t)
| _ => None
}
external toException: t => exn = "%identity"
Expand Down