Skip to content

Commit 7249048

Browse files
committed
Add a util g and snapshot previous changes
1 parent 542c2d2 commit 7249048

File tree

5 files changed

+43
-13
lines changed

5 files changed

+43
-13
lines changed

jscomp/cleanlib.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22
var cp = require('child_process')
33
var fs = require('fs')
4-
exports.run = function () {
4+
function run() {
55
cp.execSync(`make clean`)
66
if (fs.existsSync(`stdlib-406`)) {
77
cp.execSync(`git clean -dfx stdlib-406`)
@@ -13,3 +13,5 @@ exports.run = function () {
1313
if(require.main === module){
1414
run()
1515
}
16+
17+
exports.run = run

jscomp/test/adt_optimize_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function f11(x) {
160160
Caml_builtin_exceptions.assert_failure,
161161
/* tuple */[
162162
"adt_optimize_test.ml",
163-
155,
163+
191,
164164
9
165165
]
166166
];

jscomp/test/g

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
BS_DEBUG_FILE=$1 ../../lib/bsc.exe -I ../others/ -I ../stdlib-402 -I ../runtime/ -c $1

jscomp/test/local_exception_test.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,12 @@ var d = [
1919
3
2020
];
2121

22-
var A$1 = Caml_exceptions.create("Local_exception_test.A");
23-
24-
var x = [
25-
A$1,
26-
3
27-
];
28-
2922
var u = B;
3023

24+
exports.A = A;
3125
exports.v = v;
3226
exports.B = B;
3327
exports.u = u;
3428
exports.D = D;
3529
exports.d = d;
36-
exports.A = A$1;
37-
exports.x = x;
3830
/* No side effect */

jscomp/test/recursive_module.js

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
'use strict';
22

3+
var Mt = require("./mt.js");
4+
var Curry = require("../../lib/js/curry.js");
5+
var Js_exn = require("../../lib/js/js_exn.js");
36
var Caml_module = require("../../lib/js/caml_module.js");
7+
var Caml_builtin_exceptions = require("../../lib/js/caml_builtin_exceptions.js");
8+
9+
var suites = /* record */[/* contents : [] */0];
10+
11+
var test_id = /* record */[/* contents */0];
12+
13+
function eq(loc, x, y) {
14+
return Mt.eq_suites(test_id, suites, loc, x, y);
15+
}
416

517
var Int32 = Caml_module.init_mod([
618
"recursive_module.ml",
7-
9,
19+
14,
820
6
921
], [[
1022
0,
@@ -24,12 +36,34 @@ Caml_module.update_mod([[
2436

2537
var Int3 = Caml_module.init_mod([
2638
"recursive_module.ml",
27-
14,
39+
19,
2840
6
2941
], [[0]]);
3042

3143
Caml_module.update_mod([[0]], Int3, Int3);
3244

45+
var tmp;
46+
47+
try {
48+
Curry._1(Int3[/* u */0], 3);
49+
tmp = 3;
50+
}
51+
catch (raw_exn){
52+
var exn = Js_exn.internalToOCamlException(raw_exn);
53+
if (exn[0] === Caml_builtin_exceptions.undefined_recursive_module) {
54+
tmp = 4;
55+
} else {
56+
throw exn;
57+
}
58+
}
59+
60+
eq("File \"recursive_module.ml\", line 24, characters 6-13", 4, tmp);
61+
62+
Mt.from_pair_suites("recursive_module.ml", suites[0]);
63+
64+
exports.suites = suites;
65+
exports.test_id = test_id;
66+
exports.eq = eq;
3367
exports.Int32 = Int32;
3468
exports.Int3 = Int3;
3569
/* Int32 Not a pure module */

0 commit comments

Comments
 (0)