Skip to content

Commit 531822a

Browse files
authored
Merge pull request #4287 from BuckleScript/meaingful_names_for_pattern
meaningful names for pattern match
2 parents 467cc7b + 80490e3 commit 531822a

File tree

155 files changed

+64428
-64410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+64428
-64410
lines changed

jscomp/main/builtin_cmj_datasets.ml

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

jscomp/others/release.ninja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ build others/belt_MutableMapInt.cmj : cc_cmi others/belt_MutableMapInt.ml | othe
9191
build others/belt_MutableMapInt.cmi : cc others/belt_MutableMapInt.mli | runtime
9292
build others/belt_MutableMapString.cmj : cc_cmi others/belt_MutableMapString.ml | others/belt.cmi others/belt_Array.cmj others/belt_MutableMapString.cmi others/belt_internalAVLtree.cmj others/belt_internalMapString.cmj js_pkg runtime
9393
build others/belt_MutableMapString.cmi : cc others/belt_MutableMapString.mli | runtime
94-
build others/belt_MutableQueue.cmj : cc_cmi others/belt_MutableQueue.ml | others/belt.cmi others/belt_Array.cmj others/belt_MutableQueue.cmi others/js_null.cmj js_pkg runtime
94+
build others/belt_MutableQueue.cmj : cc_cmi others/belt_MutableQueue.ml | others/belt.cmi others/belt_Array.cmj others/belt_MutableQueue.cmi js_pkg runtime
9595
build others/belt_MutableQueue.cmi : cc others/belt_MutableQueue.mli | runtime
9696
build others/belt_MutableSet.cmj : cc_cmi others/belt_MutableSet.ml | others/belt.cmi others/belt_Array.cmj others/belt_Id.cmj others/belt_MutableSet.cmi others/belt_MutableSetInt.cmj others/belt_MutableSetString.cmj others/belt_SortArray.cmj others/belt_internalAVLset.cmj js_pkg runtime
9797
build others/belt_MutableSet.cmi : cc others/belt_MutableSet.mli | others/belt.cmi others/belt_Id.cmi others/belt_MutableSetInt.cmi others/belt_MutableSetString.cmi js_pkg runtime
9898
build others/belt_MutableSetInt.cmj : cc_cmi others/belt_MutableSetInt.ml | others/belt.cmi others/belt_Array.cmj others/belt_MutableSetInt.cmi others/belt_SortArrayInt.cmj others/belt_internalAVLset.cmj others/belt_internalSetInt.cmj js_pkg runtime
9999
build others/belt_MutableSetInt.cmi : cc others/belt_MutableSetInt.mli | runtime
100100
build others/belt_MutableSetString.cmj : cc_cmi others/belt_MutableSetString.ml | others/belt.cmi others/belt_Array.cmj others/belt_MutableSetString.cmi others/belt_SortArrayString.cmj others/belt_internalAVLset.cmj others/belt_internalSetString.cmj js_pkg runtime
101101
build others/belt_MutableSetString.cmi : cc others/belt_MutableSetString.mli | runtime
102-
build others/belt_MutableStack.cmj : cc_cmi others/belt_MutableStack.ml | others/belt.cmi others/belt_MutableStack.cmi others/js_null.cmj js_pkg runtime
102+
build others/belt_MutableStack.cmj : cc_cmi others/belt_MutableStack.ml | others/belt.cmi others/belt_MutableStack.cmi js_pkg runtime
103103
build others/belt_MutableStack.cmi : cc others/belt_MutableStack.mli | runtime
104104
build others/belt_Option.cmj : cc_cmi others/belt_Option.ml | others/belt.cmi others/belt_Option.cmi js_pkg runtime
105105
build others/belt_Option.cmi : cc others/belt_Option.mli | runtime

jscomp/test/app_root_finder.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ function find_package_json(_dir) {
2121
};
2222
}
2323

24-
var match = typeof __dirname === "undefined" ? undefined : __dirname;
24+
var x = typeof __dirname === "undefined" ? undefined : __dirname;
2525

26-
if (match !== undefined) {
27-
console.log(find_package_json(match));
26+
if (x !== undefined) {
27+
console.log(find_package_json(x));
2828
}
2929

3030
exports.package_json = package_json;
3131
exports.find_package_json = find_package_json;
32-
/* match Not a pure module */
32+
/* x Not a pure module */

jscomp/test/array_safe_get.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ var y;
1414
try {
1515
y = Caml_array.caml_array_get(x, 3);
1616
}
17-
catch (raw_exn){
18-
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
19-
if (exn[0] === Caml_builtin_exceptions.invalid_argument) {
20-
console.log(exn[1]);
17+
catch (raw_msg){
18+
var msg = Caml_js_exceptions.internalToOCamlException(raw_msg);
19+
if (msg[0] === Caml_builtin_exceptions.invalid_argument) {
20+
console.log(msg[1]);
2121
y = 0;
2222
} else {
23-
throw exn;
23+
throw msg;
2424
}
2525
}
2626

jscomp/test/array_subtle_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ eq("File \"array_subtle_test.ml\", line 29, characters 5-12", /* tuple */[
8080
]);
8181

8282
function f(v) {
83-
var match = v.pop();
84-
if (match !== undefined) {
83+
var x = v.pop();
84+
if (x !== undefined) {
8585
console.log("hi");
8686
} else {
8787
console.log("hi2");

jscomp/test/bs_abstract_test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ function uff2(f) {
3737
}
3838

3939
function uff3(f) {
40-
var match = f.yyyy2;
41-
if (match !== undefined) {
42-
return Curry._1(match, 0);
40+
var x = f.yyyy2;
41+
if (x !== undefined) {
42+
return Curry._1(x, 0);
4343
} else {
4444
return 0;
4545
}

jscomp/test/bs_splice_partial.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ function test(g) {
88
}
99

1010
function test_hi(x) {
11-
var match = x.hi(1, 2, 3);
12-
if (match !== null) {
13-
console.log(match);
11+
var y = x.hi(1, 2, 3);
12+
if (y !== null) {
13+
console.log(y);
1414
return 2;
1515
} else {
1616
return 1;

jscomp/test/caml_format_test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,13 +1436,13 @@ function kwd(ppf, s) {
14361436
]), s);
14371437
}
14381438

1439-
function pr_exp0(ppf, lam) {
1440-
switch (lam.tag | 0) {
1439+
function pr_exp0(ppf, s) {
1440+
switch (s.tag | 0) {
14411441
case /* Var */1 :
14421442
return Curry._2(Format.fprintf(ppf, /* Format */[
14431443
/* Alpha */Block.__(15, [/* End_of_format */0]),
14441444
"%a"
1445-
]), ident, lam[0]);
1445+
]), ident, s[0]);
14461446
case /* Lambda */0 :
14471447
case /* Apply */2 :
14481448
break;
@@ -1469,7 +1469,7 @@ function pr_exp0(ppf, lam) {
14691469
])
14701470
]),
14711471
"@[<1>(%a)@]"
1472-
]), pr_lambda, lam);
1472+
]), pr_lambda, s);
14731473
}
14741474

14751475
function pr_app(ppf, e) {

jscomp/test/chn_test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ console.log("\x3f\u003f\b\t\n\v\f\r\0\"\'");
3737

3838
function convert(s) {
3939
return $$Array.to_list(Array.from(s, (function (x) {
40-
var match = x.codePointAt(0);
41-
if (match !== undefined) {
42-
return match;
40+
var x$1 = x.codePointAt(0);
41+
if (x$1 !== undefined) {
42+
return x$1;
4343
}
4444
throw [
4545
Caml_builtin_exceptions.assert_failure,

jscomp/test/class7_test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ function backup_init($$class) {
143143
}),
144144
restore,
145145
(function (self$3) {
146-
var match = self$3[copy];
147-
if (match !== undefined) {
148-
return Caml_option.valFromOption(match);
146+
var x = self$3[copy];
147+
if (x !== undefined) {
148+
return Caml_option.valFromOption(x);
149149
} else {
150150
return self$3;
151151
}
@@ -240,9 +240,9 @@ function backup2_init($$class) {
240240
}),
241241
restore,
242242
(function (self$5) {
243-
var match = self$5[copy];
244-
if (match !== undefined) {
245-
return Caml_option.valFromOption(match);
243+
var x = self$5[copy];
244+
if (x !== undefined) {
245+
return Caml_option.valFromOption(x);
246246
} else {
247247
return self$5;
248248
}

0 commit comments

Comments
 (0)