Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Keep track of compiler info during build. https://github.com/rescript-lang/rescript/pull/7889
- Improve option optimization for constants. https://github.com/rescript-lang/rescript/pull/7913
- Option optimization: do not create redundant local vars. https://github.com/rescript-lang/rescript/pull/7915
- Js output: remove superfluous newline after every `if`. https://github.com/rescript-lang/rescript/pull/7920

#### :house: Internal

Expand Down
4 changes: 1 addition & 3 deletions compiler/core/js_dump.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1365,9 +1365,7 @@ and statement_desc top cxt f (s : J.statement_desc) : cxt =
P.space f;
let cxt = brace_block cxt f s1 in
match s2 with
| [] | [{statement_desc = Block [] | Exp {expression_desc = Var _}}] ->
P.newline f;
cxt
| [] | [{statement_desc = Block [] | Exp {expression_desc = Var _}}] -> cxt
| [({statement_desc = If _} as nest)]
| [{statement_desc = Block [({statement_desc = If _; _} as nest)]; _}] ->
P.space f;
Expand Down
4 changes: 0 additions & 4 deletions packages/@rescript/runtime/lib/es6/Belt_Array.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ function get(arr, i) {
if (i >= 0 && i < arr.length) {
return Primitive_option.some(arr[i]);
}

}

function getOrThrow(arr, i) {
Expand Down Expand Up @@ -328,7 +327,6 @@ function keep(a, f) {
r[j] = v;
j = j + 1 | 0;
}

}
r.length = j;
return r;
Expand All @@ -344,7 +342,6 @@ function keepWithIndex(a, f) {
r[j] = v;
j = j + 1 | 0;
}

}
r.length = j;
return r;
Expand All @@ -361,7 +358,6 @@ function keepMap(a, f) {
r[j] = Primitive_option.valFromOption(v$1);
j = j + 1 | 0;
}

}
r.length = j;
return r;
Expand Down
4 changes: 0 additions & 4 deletions packages/@rescript/runtime/lib/es6/Belt_HashMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function set0(h, key, value, eq, hash) {
};
h.size = h.size + 1 | 0;
}

} else {
h_buckets[i] = {
key: key,
Expand All @@ -84,11 +83,9 @@ function set0(h, key, value, eq, hash) {
if (tail !== undefined) {
tail.next = undefined;
}

}
return;
}

}

function set(h, key, value) {
Expand Down Expand Up @@ -166,7 +163,6 @@ function get(h, key) {
};
}
}

}

function has(h, key) {
Expand Down
5 changes: 0 additions & 5 deletions packages/@rescript/runtime/lib/es6/Belt_HashMapInt.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ function set(h, key, value) {
};
h.size = h.size + 1 | 0;
}

} else {
h_buckets[i] = {
key: key,
Expand All @@ -81,11 +80,9 @@ function set(h, key, value) {
if (tail !== undefined) {
tail.next = undefined;
}

}
return;
}

}

function remove(h, key) {
Expand Down Expand Up @@ -118,7 +115,6 @@ function remove(h, key) {
};
}
}

}

function get(h, key) {
Expand Down Expand Up @@ -157,7 +153,6 @@ function get(h, key) {
};
}
}

}

function has(h, key) {
Expand Down
5 changes: 0 additions & 5 deletions packages/@rescript/runtime/lib/es6/Belt_HashMapString.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ function set(h, key, value) {
};
h.size = h.size + 1 | 0;
}

} else {
h_buckets[i] = {
key: key,
Expand All @@ -81,11 +80,9 @@ function set(h, key, value) {
if (tail !== undefined) {
tail.next = undefined;
}

}
return;
}

}

function remove(h, key) {
Expand Down Expand Up @@ -118,7 +115,6 @@ function remove(h, key) {
};
}
}

}

function get(h, key) {
Expand Down Expand Up @@ -157,7 +153,6 @@ function get(h, key) {
};
}
}

}

function has(h, key) {
Expand Down
2 changes: 0 additions & 2 deletions packages/@rescript/runtime/lib/es6/Belt_HashSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,9 @@ function add0(h, key, hash, eq) {
if (tail !== undefined) {
tail.next = undefined;
}

}
return;
}

}

function add(h, key) {
Expand Down
2 changes: 0 additions & 2 deletions packages/@rescript/runtime/lib/es6/Belt_HashSetInt.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,9 @@ function add(h, key) {
if (tail !== undefined) {
tail.next = undefined;
}

}
return;
}

}

function has(h, key) {
Expand Down
2 changes: 0 additions & 2 deletions packages/@rescript/runtime/lib/es6/Belt_HashSetString.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,9 @@ function add(h, key) {
if (tail !== undefined) {
tail.next = undefined;
}

}
return;
}

}

function has(h, key) {
Expand Down
4 changes: 0 additions & 4 deletions packages/@rescript/runtime/lib/es6/Belt_List.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ function head(x) {
if (x !== 0) {
return Primitive_option.some(x.hd);
}

}

function headOrThrow(x) {
Expand All @@ -25,7 +24,6 @@ function tail(x) {
if (x !== 0) {
return x.tl;
}

}

function tailOrThrow(x) {
Expand Down Expand Up @@ -445,7 +443,6 @@ function take(lst, n) {
if (has) {
return cell;
}

}

function drop(lst, n) {
Expand Down Expand Up @@ -494,7 +491,6 @@ function splitAt(lst, n) {
rest
];
}

}

function concat(xs, ys) {
Expand Down
2 changes: 0 additions & 2 deletions packages/@rescript/runtime/lib/es6/Belt_MapDict.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ function remove(n, x, cmp) {
if (n !== undefined) {
return removeAux0(n, x, cmp);
}

}

function mergeMany(h, arr, cmp) {
Expand Down Expand Up @@ -255,7 +254,6 @@ function removeMany(t, keys, cmp) {
continue;
};
}

}

let empty;
Expand Down
2 changes: 0 additions & 2 deletions packages/@rescript/runtime/lib/es6/Belt_MapInt.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ function remove(n, x) {
if (n !== undefined) {
return removeAux(n, x);
}

}

function removeMany(t, keys) {
Expand All @@ -137,7 +136,6 @@ function removeMany(t, keys) {
continue;
};
}

}

function mergeMany(h, arr) {
Expand Down
2 changes: 0 additions & 2 deletions packages/@rescript/runtime/lib/es6/Belt_MapString.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ function remove(n, x) {
if (n !== undefined) {
return removeAux(n, x);
}

}

function removeMany(t, keys) {
Expand All @@ -137,7 +136,6 @@ function removeMany(t, keys) {
continue;
};
}

}

function mergeMany(h, arr) {
Expand Down
5 changes: 0 additions & 5 deletions packages/@rescript/runtime/lib/es6/Belt_MutableMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ function remove(d, k) {
d.data = newRoot;
return;
}

}

function removeArrayMutateAux(_t, xs, _i, len, cmp) {
Expand Down Expand Up @@ -82,7 +81,6 @@ function removeMany(d, xs) {
d.data = newRoot;
return;
}

}

function updateDone(t, x, f, cmp) {
Expand Down Expand Up @@ -132,7 +130,6 @@ function update(t, x, f) {
t.data = newRoot;
return;
}

}

function make(id) {
Expand Down Expand Up @@ -280,7 +277,6 @@ function set(m, e, v) {
m.data = newRoot;
return;
}

}

function mergeManyAux(t, xs, cmp) {
Expand All @@ -299,7 +295,6 @@ function mergeMany(d, xs) {
d.data = newRoot;
return;
}

}

let Int;
Expand Down
4 changes: 0 additions & 4 deletions packages/@rescript/runtime/lib/es6/Belt_MutableMapInt.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ function set(m, k, v) {
m.data = v$1;
return;
}

}

function forEach(d, f) {
Expand Down Expand Up @@ -161,7 +160,6 @@ function remove(d, v) {
d.data = newRoot;
return;
}

}

function updateDone(t, x, f) {
Expand Down Expand Up @@ -211,7 +209,6 @@ function update(t, x, f) {
t.data = newRoot;
return;
}

}

function removeArrayMutateAux(_t, xs, _i, len) {
Expand Down Expand Up @@ -243,7 +240,6 @@ function removeMany(d, xs) {
d.data = newRoot;
return;
}

}

function fromArray(xs) {
Expand Down
4 changes: 0 additions & 4 deletions packages/@rescript/runtime/lib/es6/Belt_MutableMapString.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ function set(m, k, v) {
m.data = v$1;
return;
}

}

function forEach(d, f) {
Expand Down Expand Up @@ -161,7 +160,6 @@ function remove(d, v) {
d.data = newRoot;
return;
}

}

function updateDone(t, x, f) {
Expand Down Expand Up @@ -211,7 +209,6 @@ function update(t, x, f) {
t.data = newRoot;
return;
}

}

function removeArrayMutateAux(_t, xs, _i, len) {
Expand Down Expand Up @@ -243,7 +240,6 @@ function removeMany(d, xs) {
d.data = newRoot;
return;
}

}

function fromArray(xs) {
Expand Down
2 changes: 0 additions & 2 deletions packages/@rescript/runtime/lib/es6/Belt_MutableQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@ function peek(q) {
if (v !== undefined) {
return Primitive_option.some(v.content);
}

}

function peekUndefined(q) {
let v = q.first;
if (v !== undefined) {
return v.content;
}

}

function peekOrThrow(q) {
Expand Down
Loading
Loading