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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- GenType: fix issue with V3 compatibility mode (see https://github.com/rescript-lang/rescript-compiler/issues/5990) https://github.com/rescript-lang/rescript-compiler/pull/5992
- Fix issue with overlapping labelled argument with default value https://github.com/rescript-lang/syntax/pull/734
- Fix issue with using alias and default value together https://github.com/rescript-lang/syntax/pull/734
- Fix issue in `Js.Promise2` where `then` and `catch` were returning `undefined` https://github.com/rescript-lang/rescript-compiler/pull/5996

# 10.1.2

Expand Down
4 changes: 2 additions & 2 deletions jscomp/others/js_promise2.res
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ type error
/** Type-safe t-first then */
let then: (promise<'a>, 'a => promise<'b>) => promise<'b> = %raw(`
function(p, cont) {
Promise.resolve(p).then(cont)
return Promise.resolve(p).then(cont)
}
`)

/** Type-safe t-first catch */
let catch: (promise<'a>, error => promise<'a>) => promise<'a> = %raw(`
function(p, cont) {
Promise.resolve(p).catch(cont)
return Promise.resolve(p).catch(cont)
}
`)

Expand Down
4 changes: 2 additions & 2 deletions lib/es6/js_promise2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@


var then = (function(p, cont) {
Promise.resolve(p).then(cont)
return Promise.resolve(p).then(cont)
});

var $$catch = (function(p, cont) {
Promise.resolve(p).catch(cont)
return Promise.resolve(p).catch(cont)
});

export {
Expand Down
4 changes: 2 additions & 2 deletions lib/js/js_promise2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@


var then = (function(p, cont) {
Promise.resolve(p).then(cont)
return Promise.resolve(p).then(cont)
});

var $$catch = (function(p, cont) {
Promise.resolve(p).catch(cont)
return Promise.resolve(p).catch(cont)
});

exports.then = then;
Expand Down