Skip to content
Closed
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
6 changes: 3 additions & 3 deletions compiler/ml/translcore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ let comparisons_table =
objcomp = Pobjmax;
intcomp = Pintmax;
boolcomp = Pboolmax;
floatcomp = Pboolmax;
floatcomp = Pfloatmax;
stringcomp = Pstringmax;
bigintcomp = Pbigintmax;
simplify_constant_constructor = false;
Expand Down Expand Up @@ -215,7 +215,7 @@ let comparisons_table =
objcomp = Pobjmax;
intcomp = Pintmax;
boolcomp = Pboolmax;
floatcomp = Pboolmax;
floatcomp = Pfloatmax;
stringcomp = Pstringmax;
bigintcomp = Pbigintmax;
simplify_constant_constructor = false;
Expand Down Expand Up @@ -387,7 +387,7 @@ let primitives_table =
(* Compiler internals, never expose to ReScript files *)
("#raw_expr", Pjs_raw_expr);
("#raw_stmt", Pjs_raw_stmt);
(* FIXME: Core compatibility *)
(* FIXME: Core compatibility. Prefer starting with % *)
("#null", Pnull);
("#undefined", Pundefined);
("#typeof", Ptypeof);
Expand Down
5 changes: 2 additions & 3 deletions tests/tests/src/mario_game.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import * as Belt_List from "rescript/lib/es6/Belt_List.js";
import * as Pervasives from "rescript/lib/es6/Pervasives.js";
import * as Primitive_int from "rescript/lib/es6/Primitive_int.js";
import * as Primitive_bool from "rescript/lib/es6/Primitive_bool.js";
import * as Primitive_float from "rescript/lib/es6/Primitive_float.js";
import * as Primitive_object from "rescript/lib/es6/Primitive_object.js";
import * as Primitive_option from "rescript/lib/es6/Primitive_option.js";
Expand Down Expand Up @@ -979,7 +978,7 @@ function update_player(player, keys, context) {
if (!player.jumping && player.grounded) {
player.jumping = true;
player.grounded = false;
player.vel.y = Primitive_bool.max(player.vel.y - (5.7 + Math.abs(player.vel.x) * 0.25), -6);
player.vel.y = Primitive_float.max(player.vel.y - (5.7 + Math.abs(player.vel.x) * 0.25), -6);
return;
} else {
return;
Expand Down Expand Up @@ -1531,7 +1530,7 @@ function make$3(param, param$1) {

function calc_viewport_point(cc, vc, mc) {
let vc_half = vc / 2;
return Primitive_float.min(Primitive_bool.max(cc - vc_half, 0), Primitive_float.min(mc - vc, Math.abs(cc - vc_half)));
return Primitive_float.min(Primitive_float.max(cc - vc_half, 0), Primitive_float.min(mc - vc, Math.abs(cc - vc_half)));
}

function in_viewport(v, pos) {
Expand Down
16 changes: 15 additions & 1 deletion tests/tests/src/test_pervasive.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,20 @@ function a18(prim0, prim1) {
return Math.pow(prim0, prim1);
}

if ((
1 > 2 ? 1 : 2
) !== 2) {
throw {
RE_EXN_ID: "Assert_failure",
_1: [
"test_pervasive.res",
28,
0
],
Error: new Error()
};
}

let f = Pervasives.$at;

export {
Expand All @@ -214,4 +228,4 @@ export {
a17,
a18,
}
/* No side effect */
/* Not a pure module */
3 changes: 3 additions & 0 deletions tests/tests/src/test_pervasive.res
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ let a15 = log
let a16 = log10
let a17 = log1p
let a18 = \"**"

assert(max(1., 2.) === 2.)

/* local variables: */
/* compile-command: "ocamlc -dlambda -c test_pervasive.ml" */
/* end: */