Skip to content

Commit 44dd54a

Browse files
committed
move util primitives
1 parent 1e7c839 commit 44dd54a

File tree

10 files changed

+45
-63
lines changed

10 files changed

+45
-63
lines changed

jscomp/ext/js_runtime_modules.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ let exceptions = "Primitive_exceptions"
5252

5353
let curry = "Primitive_curry"
5454

55-
let deriving = "Runtime_deriving"
55+
let util = "Primitive_util"

jscomp/frontend/ast_derive_js_mapper.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ let app2 = Ast_compatible.app2
130130
let ( ->~ ) a b = Ast_compatible.arrow a b
131131

132132
let raise_when_not_found_ident =
133-
Longident.Ldot (Lident Js_runtime_modules.deriving, "raiseWhenNotFound")
133+
Longident.Ldot (Lident Js_runtime_modules.util, "raiseWhenNotFound")
134134

135135
let raise_when_not_found x =
136136
app1 (Exp.ident {loc = noloc; txt = raise_when_not_found_ident}) x

jscomp/others/release.ninja

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,4 @@ o others/belt_internalSetString.cmi others/belt_internalSetString.cmj : cc other
148148
o others/dom.cmi others/dom.cmj : cc others/dom.res | others/belt_internals.cmi others/dom_storage.cmj others/dom_storage2.cmj others/js.cmi $bsc js_pkg
149149
o others/dom_storage.cmi others/dom_storage.cmj : cc others/dom_storage.res | others/belt_internals.cmi others/dom_storage2.cmj others/js.cmi $bsc js_pkg
150150
o others/dom_storage2.cmi others/dom_storage2.cmj : cc others/dom_storage2.res | others/belt_internals.cmi others/js.cmi $bsc
151-
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
152-
o others/runtime_deriving.cmi : cc others/runtime_deriving.resi | others/belt_internals.cmi others/js.cmi $bsc
153-
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
151+
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

jscomp/others/runtime_deriving.res

Lines changed: 0 additions & 30 deletions
This file was deleted.

jscomp/others/runtime_deriving.resi

Lines changed: 0 additions & 25 deletions
This file was deleted.

jscomp/runtime/primitive_util.res

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
let raiseWhenNotFound = x =>
2+
if Js.testAny(x) {
3+
raise(Not_found)
4+
} else {
5+
x
6+
}

jscomp/runtime/release.ninja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ o runtime/primitive_object_extern.cmi runtime/primitive_object_extern.cmj : cc r
4141
o runtime/primitive_promise.cmi runtime/primitive_promise.cmj : cc runtime/primitive_promise.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
4242
o runtime/primitive_string.cmi runtime/primitive_string.cmj : cc runtime/primitive_string.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj runtime/primitive_string_extern.cmj
4343
o runtime/primitive_string_extern.cmi runtime/primitive_string_extern.cmj : cc runtime/primitive_string_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
44+
o runtime/primitive_util.cmi runtime/primitive_util.cmj : cc runtime/primitive_util.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
4445
o runtime/string.cmi runtime/string.cmj : cc runtime/string.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj runtime/primitive_string.cmj runtime/primitive_string_extern.cmj
45-
o runtime : phony runtime/bs_stdlib_mini.cmi runtime/js.cmj runtime/js.cmi runtime/lazy.cmi runtime/lazy.cmj runtime/primitive_exceptions.cmi runtime/primitive_exceptions.cmj runtime/primitive_hash.cmi runtime/primitive_hash.cmj runtime/primitive_lazy.cmi runtime/primitive_lazy.cmj runtime/primitive_module.cmi runtime/primitive_module.cmj runtime/primitive_object.cmi runtime/primitive_object.cmj runtime/primitive_option.cmi runtime/primitive_option.cmj runtime/char.cmi runtime/char.cmj runtime/obj.cmi runtime/obj.cmj runtime/primitive_array.cmi runtime/primitive_array.cmj runtime/primitive_bigint.cmi runtime/primitive_bigint.cmj runtime/primitive_bool.cmi runtime/primitive_bool.cmj runtime/primitive_char_extern.cmi runtime/primitive_char_extern.cmj runtime/primitive_curry.cmi runtime/primitive_curry.cmj runtime/primitive_dict.cmi runtime/primitive_dict.cmj runtime/primitive_float.cmi runtime/primitive_float.cmj runtime/primitive_int.cmi runtime/primitive_int.cmj runtime/primitive_object_extern.cmi runtime/primitive_object_extern.cmj runtime/primitive_promise.cmi runtime/primitive_promise.cmj runtime/primitive_string.cmi runtime/primitive_string.cmj runtime/primitive_string_extern.cmi runtime/primitive_string_extern.cmj runtime/string.cmi runtime/string.cmj
46+
o runtime : phony runtime/bs_stdlib_mini.cmi runtime/js.cmj runtime/js.cmi runtime/lazy.cmi runtime/lazy.cmj runtime/primitive_exceptions.cmi runtime/primitive_exceptions.cmj runtime/primitive_hash.cmi runtime/primitive_hash.cmj runtime/primitive_lazy.cmi runtime/primitive_lazy.cmj runtime/primitive_module.cmi runtime/primitive_module.cmj runtime/primitive_object.cmi runtime/primitive_object.cmj runtime/primitive_option.cmi runtime/primitive_option.cmj runtime/char.cmi runtime/char.cmj runtime/obj.cmi runtime/obj.cmj runtime/primitive_array.cmi runtime/primitive_array.cmj runtime/primitive_bigint.cmi runtime/primitive_bigint.cmj runtime/primitive_bool.cmi runtime/primitive_bool.cmj runtime/primitive_char_extern.cmi runtime/primitive_char_extern.cmj runtime/primitive_curry.cmi runtime/primitive_curry.cmj runtime/primitive_dict.cmi runtime/primitive_dict.cmj runtime/primitive_float.cmi runtime/primitive_float.cmj runtime/primitive_int.cmi runtime/primitive_int.cmj runtime/primitive_object_extern.cmi runtime/primitive_object_extern.cmj runtime/primitive_promise.cmi runtime/primitive_promise.cmj runtime/primitive_string.cmi runtime/primitive_string.cmj runtime/primitive_string_extern.cmi runtime/primitive_string_extern.cmj runtime/primitive_util.cmi runtime/primitive_util.cmj runtime/string.cmi runtime/string.cmj

jscomp/test/ast_abstract_test.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/es6/primitive_util.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
3+
4+
function raiseWhenNotFound(x) {
5+
if (x == null) {
6+
throw {
7+
RE_EXN_ID: "Not_found",
8+
Error: new Error()
9+
};
10+
}
11+
return x;
12+
}
13+
14+
export {
15+
raiseWhenNotFound,
16+
}
17+
/* No side effect */

lib/js/primitive_util.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
3+
4+
function raiseWhenNotFound(x) {
5+
if (x == null) {
6+
throw {
7+
RE_EXN_ID: "Not_found",
8+
Error: new Error()
9+
};
10+
}
11+
return x;
12+
}
13+
14+
exports.raiseWhenNotFound = raiseWhenNotFound;
15+
/* No side effect */

0 commit comments

Comments
 (0)