Skip to content

Commit fb26217

Browse files
committed
catch without underscore
1 parent e470411 commit fb26217

File tree

6 files changed

+10
-18
lines changed

6 files changed

+10
-18
lines changed

jscomp/main/builtin_cmj_datasets.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(* 7661cf15434bf85514844d97faa525a2 *)
1+
(* af520558d40cfd07880d752cd665a60b *)
22
let module_names : string array = Obj.magic (
33
"Js" (* 23 *),
44
"Arg" (* 217 *),
@@ -89,7 +89,7 @@ let module_names : string array = Obj.magic (
8989
"BytesLabels" (* 878 *),
9090
"Dom_storage" (* 386 *),
9191
"Js_mapperRt" (* 87 *),
92-
"Js_promise2" (* 66 *),
92+
"Js_promise2" (* 51 *),
9393
"JsxDOMStyle" (* 23 *),
9494
"Node_buffer" (* 23 *),
9595
"Node_module" (* 23 *),
@@ -225,7 +225,7 @@ let module_data : string array = Obj.magic (
225225
(* BytesLabels *)"\132\149\166\190\000\000\003Z\000\000\000\231\000\000\003\012\000\000\002\216\160\b\000\000\152\000\176#cat\144\160\160B@@@\176#map\144\160\160B@@@\176#sub\144\160\160C@@@\176$blit\144\160\160E@@@\176$copy\144\160\160A@@@\176$fill\144\160\160D@@@\176$init\144\160\160B@@@\176$iter\144\160\160B@@@\176$make\144\160\160B@@@\176$mapi\144\160\160B@@@\176$trim\144\160\160A@@@\176%equal\144\160\160B@@\144\148\192B\160\176\001\005z!x@\160\176\001\005{!y@@\151\176\1470caml_bytes_equal\160\144\004\011\160\144\004\n@\176\1929stdlib-406/bytesLabels.ml\001\001\171\0011\127\0011\155\192\004\002\001\001\171\0011\127\0011\160@\208B@@@@\176%index\144\160\160B@@@\176%iteri\144\160\160B@@@\176&concat\144\160\160B@@@\176&extend\144\160\160C@@@\176&rindex\144\160\160B@@@\176'compare\144\160\160B@@\144\148\192B\160\176\001\005w!x@\160\176\001\005x!y@@\151\176\1472caml_bytes_compare\160\144\004\011\160\144\004\n@\176\192\0044\001\001\170\0011L\0011h\192\0045\001\001\170\0011L\0011~@\208B@@@@\176'escaped\144\160\160A@@@\176(contains\144\160\160B@@@\176)index_opt\144\160\160B@@@\176)of_string\144\160\160A@@@\176)to_string\144\160\160A@@@\176*index_from\144\160\160C@@@\176*rindex_opt\144\160\160B@@@\176*sub_string\144\160\160C@@@\176+blit_string\144\160\160E@@@\176+rindex_from\144\160\160C@@@\176-contains_from\144\160\160C@@@\176.index_from_opt\144\160\160C@@@\176.rcontains_from\144\160\160C@@@\176/lowercase_ascii\144\160\160A@@@\176/rindex_from_opt\144\160\160C@@@\176/uppercase_ascii\144\160\160A@@@\1760capitalize_ascii\144\160\160A@@@\1760unsafe_of_string\144\004F@\1760unsafe_to_string\144\004D@\1762uncapitalize_ascii\144\160\160A@@@A",
226226
(* Dom_storage *)"\132\149\166\190\000\000\001n\000\000\000k\000\000\001^\000\000\001T\160\192\176#key\144\160\160B@@\144\148\192B\160\176\001\004\004!i@\160\176\001\004\005#obj@@\151\176\000B\160\151\176\180#key\160\160AA\160\004\002@\181#key@@\160\144\004\016\160\144\004\021@\176\1925others/dom_storage.mlR\001\003\022\001\0036\192\004\002R\001\003\022\001\003B@@\004\004\208B@@@@\176'getItem\144\160\160B@@\144\148\192B\160\176\001\003\246!s@\160\176\001\003\247#obj@@\151\176\000B\160\151\176\180'getItem\160\004#\160\004$@\181'getItem@@\160\144\004\015\160\144\004\020@\176\192\004\"D\000x\001\000\140\192\004#D\000x\001\000\156@@\004\003\208B@@@@\176'setItem\144\160\160C@@@\176*removeItem\144\160\160B@@\144\148\192B\160\176\001\003\255!s@\160\176\001\004\000#obj@@\174\151\176\180*removeItem\160\004G\160\004H@\181*removeItem@@\160\144\004\r\160\144\004\018@\176\192\004FL\001\001\208\001\001\238\192\004GL\001\001\208\001\002\001@\146A\208B@@A@A",
227227
(* Js_mapperRt *)"\132\149\166\190\000\000\000C\000\000\000\017\000\000\0009\000\000\0004\160\176\176'fromInt\144\160\160C@@@\176-fromIntAssert\144\160\160C@@@\1761raiseWhenNotFound\144\160\160A@@@A",
228-
(* Js_promise2 *)"\132\149\166\190\000\000\000.\000\000\000\017\000\000\0004\000\000\0001\160\176\176%catch\144\160\160B@@@\176%then_\144\160\160B@@@\176&catch_\144\160\160B@@@A",
228+
(* Js_promise2 *)"\132\149\166\190\000\000\000\031\000\000\000\012\000\000\000$\000\000\000\"\160\160\176%catch\144\160\160B@@@\176%then_\144\160\160B@@@A",
229229
(* JsxDOMStyle *)"\132\149\166\190\000\000\000\003\000\000\000\001\000\000\000\003\000\000\000\003\160\128A",
230230
(* Node_buffer *)"\132\149\166\190\000\000\000\003\000\000\000\001\000\000\000\003\000\000\000\003\160\128A",
231231
(* Node_module *)"\132\149\166\190\000\000\000\003\000\000\000\001\000\000\000\003\000\000\000\003\160\128A",

jscomp/others/js_promise2.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let then_ : 'a promise -> ('a -> 'b promise) -> 'b promise =
77
}
88
|}]
99

10-
let catch_ : 'a promise -> (error -> 'a promise) -> 'a promise =
10+
let catch : 'a promise -> (error -> 'a promise) -> 'a promise =
1111
[%raw
1212
{|
1313
function(p, cont) {

jscomp/test/SafePromises.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ async function nestedPromise(xxx) {
77
Js_promise2.then_(xx, (function (x) {
88
return Promise.resolve((console.log("Promise2.then_", x), undefined));
99
}));
10-
Js_promise2.catch_(xx, (function (x) {
10+
Js_promise2.$$catch(xx, (function (x) {
1111
console.log("Promise2.catch_", x);
1212
return Promise.resolve(0);
1313
}));

jscomp/test/SafePromises.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ let nestedPromise = async (xxx: promise<promise<int>>) => {
44
let xx = await xxx
55

66
let _ = xx->Js.Promise2.then_(x => Js.log2("Promise2.then_", x) |> Js.Promise.resolve)
7-
let _ = xx->Js.Promise2.catch_(x => {
7+
let _ = xx->Js.Promise2.catch(x => {
88
Js.log2("Promise2.catch_", x)
99
0 |> Js.Promise.resolve
1010
})

lib/es6/js_promise2.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11

22

3-
import * as Js_promise from "./js_promise.js";
43

54
var then_ = (function(p, cont) {
65
Promise.resolve(p).then(cont)
76
});
87

9-
var catch_ = (function(p, cont) {
8+
var $$catch = (function(p, cont) {
109
Promise.resolve(p).catch(cont)
1110
});
1211

13-
var $$catch = Js_promise.$$catch;
14-
1512
export {
16-
$$catch ,
1713
then_ ,
18-
catch_ ,
14+
$$catch ,
1915
}
2016
/* No side effect */

lib/js/js_promise2.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
'use strict';
22

3-
var Js_promise = require("./js_promise.js");
43

54
var then_ = (function(p, cont) {
65
Promise.resolve(p).then(cont)
76
});
87

9-
var catch_ = (function(p, cont) {
8+
var $$catch = (function(p, cont) {
109
Promise.resolve(p).catch(cont)
1110
});
1211

13-
var $$catch = Js_promise.$$catch;
14-
15-
exports.$$catch = $$catch;
1612
exports.then_ = then_;
17-
exports.catch_ = catch_;
13+
exports.$$catch = $$catch;
1814
/* No side effect */

0 commit comments

Comments
 (0)