Skip to content

Commit bd35926

Browse files
committed
minor refactoring [skip ci]
1 parent 787e663 commit bd35926

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/glue/binaryen.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -917,28 +917,28 @@ export const {
917917
// parameters (built with -sWASM_BIGINT). In portable/JS mode AssemblyScript
918918
// represents i64 as Long, so we convert between Long and BigInt here.
919919

920-
function longToBigInt(value) {
920+
function toBigInt(value) {
921921
return (BigInt(value.high | 0) << 32n) | BigInt(value.low >>> 0);
922922
}
923923

924-
function bigIntToLong(value) {
924+
function toLong(value) {
925925
return Long.fromBits(Number(value & 0xFFFFFFFFn) | 0, Number(value >> 32n) | 0);
926926
}
927927

928928
export function _BinaryenLiteralInt64(literalOut, value) {
929-
return binaryen._BinaryenLiteralInt64(literalOut, longToBigInt(value));
929+
return binaryen._BinaryenLiteralInt64(literalOut, toBigInt(value));
930930
}
931931

932932
export function _BinaryenLiteralFloat64Bits(literalOut, value) {
933-
return binaryen._BinaryenLiteralFloat64Bits(literalOut, longToBigInt(value));
933+
return binaryen._BinaryenLiteralFloat64Bits(literalOut, toBigInt(value));
934934
}
935935

936936
export function _BinaryenConstGetValueI64(expr) {
937-
return bigIntToLong(binaryen._BinaryenConstGetValueI64(expr));
937+
return toLong(binaryen._BinaryenConstGetValueI64(expr));
938938
}
939939

940940
export function _BinaryenConstSetValueI64(expr, value) {
941-
binaryen._BinaryenConstSetValueI64(expr, longToBigInt(value));
941+
binaryen._BinaryenConstSetValueI64(expr, toBigInt(value));
942942
}
943943

944944
export default binaryen;

0 commit comments

Comments
 (0)