Skip to content

Commit adeb487

Browse files
committed
Js.Promise -> Runtime_promise
1 parent 59c828f commit adeb487

File tree

9 files changed

+40
-6
lines changed

9 files changed

+40
-6
lines changed

jscomp/ext/js_runtime_modules.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,5 @@ let caml_js_exceptions = "Caml_js_exceptions"
7272
let caml_splice_call = "Caml_splice_call"
7373

7474
let deriving = "Runtime_deriving"
75+
76+
let promise = "Runtime_promise"

jscomp/ml/ast_async.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let add_promise_type ?(loc = Location.none) ~async
66
if async then
77
let unsafe_async =
88
Ast_helper.Exp.ident ~loc
9-
{txt = Ldot (Ldot (Lident "Js", "Promise"), "unsafe_async"); loc}
9+
{txt = Ldot (Lident Js_runtime_modules.promise, "unsafe_async"); loc}
1010
in
1111
Ast_helper.Exp.apply ~loc unsafe_async [(Nolabel, result)]
1212
else result

jscomp/ml/ast_await.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let create_await_expression (e : Parsetree.expression) =
55
let loc = {e.pexp_loc with loc_ghost = true} in
66
let unsafe_await =
77
Ast_helper.Exp.ident ~loc
8-
{txt = Ldot (Ldot (Lident "Js", "Promise"), "unsafe_await"); loc}
8+
{txt = Ldot (Lident Js_runtime_modules.promise, "unsafe_await"); loc}
99
in
1010
Ast_helper.Exp.apply ~loc unsafe_await [(Nolabel, e)]
1111

jscomp/others/js_promise.res

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ external catch: (@uncurry (error => promise<'a>)) => promise<'a> = "catch"
9494
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch
9595
*/
9696

97-
external unsafe_async: 'a => promise<'a> = "%identity"
98-
external unsafe_await: promise<'a> => 'a = "?await"
99-
10097
/*
10198
let errorAsExn (x : error) (e : (exn ->'a option))=
10299
if Caml_exceptions.isCamlExceptionOrOpenVariant (Obj.magic x ) then

jscomp/others/release.ninja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,5 @@ o others/dom_storage.cmi others/dom_storage.cmj : cc others/dom_storage.res | ot
158158
o others/dom_storage2.cmi others/dom_storage2.cmj : cc others/dom_storage2.res | others/belt_internals.cmi others/js.cmi $bsc
159159
o others/runtime_deriving.cmj : cc_cmi others/runtime_deriving.res | others/belt_internals.cmi others/js.cmi others/runtime_deriving.cmi $bsc js_pkg
160160
o others/runtime_deriving.cmi : cc others/runtime_deriving.resi | others/belt_internals.cmi others/js.cmi $bsc
161-
o others : phony others/belt_Array.cmi others/belt_Array.cmj others/belt_Float.cmi others/belt_Float.cmj others/belt_HashMap.cmi others/belt_HashMap.cmj others/belt_HashMapInt.cmi others/belt_HashMapInt.cmj others/belt_HashMapString.cmi others/belt_HashMapString.cmj others/belt_HashSet.cmi others/belt_HashSet.cmj others/belt_HashSetInt.cmi others/belt_HashSetInt.cmj others/belt_HashSetString.cmi others/belt_HashSetString.cmj others/belt_Id.cmi others/belt_Id.cmj others/belt_Int.cmi others/belt_Int.cmj others/belt_List.cmi others/belt_List.cmj others/belt_Map.cmi others/belt_Map.cmj others/belt_MapDict.cmi others/belt_MapDict.cmj others/belt_MapInt.cmi others/belt_MapInt.cmj others/belt_MapString.cmi others/belt_MapString.cmj others/belt_MutableMap.cmi others/belt_MutableMap.cmj others/belt_MutableMapInt.cmi others/belt_MutableMapInt.cmj others/belt_MutableMapString.cmi others/belt_MutableMapString.cmj others/belt_MutableQueue.cmi others/belt_MutableQueue.cmj others/belt_MutableSet.cmi others/belt_MutableSet.cmj others/belt_MutableSetInt.cmi others/belt_MutableSetInt.cmj others/belt_MutableSetString.cmi others/belt_MutableSetString.cmj others/belt_MutableStack.cmi others/belt_MutableStack.cmj others/belt_Option.cmi others/belt_Option.cmj others/belt_Range.cmi others/belt_Range.cmj others/belt_Result.cmi others/belt_Result.cmj others/belt_Set.cmi others/belt_Set.cmj others/belt_SetDict.cmi others/belt_SetDict.cmj others/belt_SetInt.cmi others/belt_SetInt.cmj others/belt_SetString.cmi others/belt_SetString.cmj others/belt_SortArray.cmi others/belt_SortArray.cmj others/belt_SortArrayInt.cmi others/belt_SortArrayInt.cmj others/belt_SortArrayString.cmi others/belt_SortArrayString.cmj others/belt_internalAVLset.cmi others/belt_internalAVLset.cmj others/belt_internalAVLtree.cmi others/belt_internalAVLtree.cmj others/belt_internalBuckets.cmi others/belt_internalBuckets.cmj others/belt_internalBucketsType.cmi others/belt_internalBucketsType.cmj others/belt_internalMapInt.cmi others/belt_internalMapInt.cmj others/belt_internalMapString.cmi others/belt_internalMapString.cmj others/belt_internalSetBuckets.cmi others/belt_internalSetBuckets.cmj others/belt_internalSetInt.cmi others/belt_internalSetInt.cmj others/belt_internalSetString.cmi others/belt_internalSetString.cmj others/dom.cmi others/dom.cmj others/dom_storage.cmi others/dom_storage.cmj others/dom_storage2.cmi others/dom_storage2.cmj others/runtime_deriving.cmi others/runtime_deriving.cmj
161+
o others/runtime_promise.cmi others/runtime_promise.cmj : cc others/runtime_promise.res | others/belt_internals.cmi others/js.cmi $bsc
162+
o others : phony others/belt_Array.cmi others/belt_Array.cmj others/belt_Float.cmi others/belt_Float.cmj others/belt_HashMap.cmi others/belt_HashMap.cmj others/belt_HashMapInt.cmi others/belt_HashMapInt.cmj others/belt_HashMapString.cmi others/belt_HashMapString.cmj others/belt_HashSet.cmi others/belt_HashSet.cmj others/belt_HashSetInt.cmi others/belt_HashSetInt.cmj others/belt_HashSetString.cmi others/belt_HashSetString.cmj others/belt_Id.cmi others/belt_Id.cmj others/belt_Int.cmi others/belt_Int.cmj others/belt_List.cmi others/belt_List.cmj others/belt_Map.cmi others/belt_Map.cmj others/belt_MapDict.cmi others/belt_MapDict.cmj others/belt_MapInt.cmi others/belt_MapInt.cmj others/belt_MapString.cmi others/belt_MapString.cmj others/belt_MutableMap.cmi others/belt_MutableMap.cmj others/belt_MutableMapInt.cmi others/belt_MutableMapInt.cmj others/belt_MutableMapString.cmi others/belt_MutableMapString.cmj others/belt_MutableQueue.cmi others/belt_MutableQueue.cmj others/belt_MutableSet.cmi others/belt_MutableSet.cmj others/belt_MutableSetInt.cmi others/belt_MutableSetInt.cmj others/belt_MutableSetString.cmi others/belt_MutableSetString.cmj others/belt_MutableStack.cmi others/belt_MutableStack.cmj others/belt_Option.cmi others/belt_Option.cmj others/belt_Range.cmi others/belt_Range.cmj others/belt_Result.cmi others/belt_Result.cmj others/belt_Set.cmi others/belt_Set.cmj others/belt_SetDict.cmi others/belt_SetDict.cmj others/belt_SetInt.cmi others/belt_SetInt.cmj others/belt_SetString.cmi others/belt_SetString.cmj others/belt_SortArray.cmi others/belt_SortArray.cmj others/belt_SortArrayInt.cmi others/belt_SortArrayInt.cmj others/belt_SortArrayString.cmi others/belt_SortArrayString.cmj others/belt_internalAVLset.cmi others/belt_internalAVLset.cmj others/belt_internalAVLtree.cmi others/belt_internalAVLtree.cmj others/belt_internalBuckets.cmi others/belt_internalBuckets.cmj others/belt_internalBucketsType.cmi others/belt_internalBucketsType.cmj others/belt_internalMapInt.cmi others/belt_internalMapInt.cmj others/belt_internalMapString.cmi others/belt_internalMapString.cmj others/belt_internalSetBuckets.cmi others/belt_internalSetBuckets.cmj others/belt_internalSetInt.cmi others/belt_internalSetInt.cmj others/belt_internalSetString.cmi others/belt_internalSetString.cmj others/dom.cmi others/dom.cmj others/dom_storage.cmi others/dom_storage.cmj others/dom_storage2.cmi others/dom_storage2.cmj others/runtime_deriving.cmi others/runtime_deriving.cmj others/runtime_promise.cmi others/runtime_promise.cmj

jscomp/others/runtime_promise.res

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/* Copyright (C) 2017 Hongbo Zhang, Authors of ReScript
2+
*
3+
* This program is free software: you can redistribute it and/or modify
4+
* it under the terms of the GNU Lesser General Public License as published by
5+
* the Free Software Foundation, either version 3 of the License, or
6+
* (at your option) any later version.
7+
*
8+
* In addition to the permissions granted to you by the LGPL, you may combine
9+
* or link a "work that uses the Library" with a publicly distributed version
10+
* of this file to produce a combined library or application, then distribute
11+
* that combined work under the terms of your choosing, with no requirement
12+
* to comply with the obligations normally placed on you by section 4 of the
13+
* LGPL version 3 (or the corresponding section of a later version of the LGPL
14+
* should you choose to use a later version).
15+
*
16+
* This program is distributed in the hope that it will be useful,
17+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
* GNU Lesser General Public License for more details.
20+
*
21+
* You should have received a copy of the GNU Lesser General Public License
22+
* along with this program; if not, write to the Free Software
23+
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
24+
25+
external unsafe_async: 'a => promise<'a> = "%identity"
26+
external unsafe_await: promise<'a> => 'a = "?await"

lib/es6/runtime_promise.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */

lib/js/runtime_promise.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */

packages/artifacts.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ lib/es6/pervasivesU.js
179179
lib/es6/queue.js
180180
lib/es6/random.js
181181
lib/es6/runtime_deriving.js
182+
lib/es6/runtime_promise.js
182183
lib/es6/set.js
183184
lib/es6/setLabels.js
184185
lib/es6/sort.js
@@ -343,6 +344,7 @@ lib/js/pervasivesU.js
343344
lib/js/queue.js
344345
lib/js/random.js
345346
lib/js/runtime_deriving.js
347+
lib/js/runtime_promise.js
346348
lib/js/set.js
347349
lib/js/setLabels.js
348350
lib/js/sort.js
@@ -1003,6 +1005,10 @@ lib/ocaml/runtime_deriving.cmt
10031005
lib/ocaml/runtime_deriving.cmti
10041006
lib/ocaml/runtime_deriving.res
10051007
lib/ocaml/runtime_deriving.resi
1008+
lib/ocaml/runtime_promise.cmi
1009+
lib/ocaml/runtime_promise.cmj
1010+
lib/ocaml/runtime_promise.cmt
1011+
lib/ocaml/runtime_promise.res
10061012
lib/ocaml/set.cmi
10071013
lib/ocaml/set.cmj
10081014
lib/ocaml/set.cmt

0 commit comments

Comments
 (0)