Skip to content

Commit bc1fee9

Browse files
committed
Move Core Global into Pervasives
1 parent 9c0ae4c commit bc1fee9

17 files changed

+606
-1004
lines changed

lib/es6/Global.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/es6/Pervasives.js

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22

3+
import * as $$Error from "./Error.js";
34
import * as Primitive_exceptions from "./Primitive_exceptions.js";
45

56
function failwith(s) {
@@ -18,7 +19,7 @@ function invalid_arg(s) {
1819
};
1920
}
2021

21-
let Exit = /* @__PURE__ */Primitive_exceptions.create("Pervasives.Pervasives.Exit");
22+
let Exit = /* @__PURE__ */Primitive_exceptions.create("Pervasives.Exit");
2223

2324
function abs(x) {
2425
if (x >= 0) {
@@ -115,28 +116,6 @@ function $at(l1, l2) {
115116
}
116117
}
117118

118-
let Pervasives = {
119-
failwith: failwith,
120-
invalid_arg: invalid_arg,
121-
Exit: Exit,
122-
abs: abs,
123-
lnot: lnot,
124-
max_int: 2147483647,
125-
min_int: min_int,
126-
infinity: Infinity,
127-
neg_infinity: -Infinity,
128-
max_float: 1.79769313486231571e+308,
129-
min_float: 2.22507385850720138e-308,
130-
epsilon_float: 2.22044604925031308e-16,
131-
classify_float: classify_float,
132-
char_of_int: char_of_int,
133-
string_of_bool: string_of_bool,
134-
bool_of_string: bool_of_string,
135-
bool_of_string_opt: bool_of_string_opt,
136-
int_of_string_opt: int_of_string_opt,
137-
$at: $at
138-
};
139-
140119
let max_int = 2147483647;
141120

142121
let infinity = Infinity;
@@ -149,8 +128,9 @@ let min_float = 2.22507385850720138e-308;
149128

150129
let epsilon_float = 2.22044604925031308e-16;
151130

131+
let panic = $$Error.panic;
132+
152133
export {
153-
Pervasives,
154134
failwith,
155135
invalid_arg,
156136
Exit,
@@ -170,5 +150,6 @@ export {
170150
bool_of_string_opt,
171151
int_of_string_opt,
172152
$at,
153+
panic,
173154
}
174155
/* No side effect */

lib/es6/RescriptCore.js

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

lib/js/Global.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/js/Pervasives.js

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22

3+
let $$Error = require("./Error.js");
34
let Primitive_exceptions = require("./Primitive_exceptions.js");
45

56
function failwith(s) {
@@ -18,7 +19,7 @@ function invalid_arg(s) {
1819
};
1920
}
2021

21-
let Exit = /* @__PURE__ */Primitive_exceptions.create("Pervasives.Pervasives.Exit");
22+
let Exit = /* @__PURE__ */Primitive_exceptions.create("Pervasives.Exit");
2223

2324
function abs(x) {
2425
if (x >= 0) {
@@ -115,28 +116,6 @@ function $at(l1, l2) {
115116
}
116117
}
117118

118-
let Pervasives = {
119-
failwith: failwith,
120-
invalid_arg: invalid_arg,
121-
Exit: Exit,
122-
abs: abs,
123-
lnot: lnot,
124-
max_int: 2147483647,
125-
min_int: min_int,
126-
infinity: Infinity,
127-
neg_infinity: -Infinity,
128-
max_float: 1.79769313486231571e+308,
129-
min_float: 2.22507385850720138e-308,
130-
epsilon_float: 2.22044604925031308e-16,
131-
classify_float: classify_float,
132-
char_of_int: char_of_int,
133-
string_of_bool: string_of_bool,
134-
bool_of_string: bool_of_string,
135-
bool_of_string_opt: bool_of_string_opt,
136-
int_of_string_opt: int_of_string_opt,
137-
$at: $at
138-
};
139-
140119
let max_int = 2147483647;
141120

142121
let infinity = Infinity;
@@ -149,7 +128,8 @@ let min_float = 2.22507385850720138e-308;
149128

150129
let epsilon_float = 2.22044604925031308e-16;
151130

152-
exports.Pervasives = Pervasives;
131+
let panic = $$Error.panic;
132+
153133
exports.failwith = failwith;
154134
exports.invalid_arg = invalid_arg;
155135
exports.Exit = Exit;
@@ -169,4 +149,5 @@ exports.bool_of_string = bool_of_string;
169149
exports.bool_of_string_opt = bool_of_string_opt;
170150
exports.int_of_string_opt = int_of_string_opt;
171151
exports.$at = $at;
152+
exports.panic = panic;
172153
/* No side effect */

0 commit comments

Comments
 (0)