Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
mununki committed Oct 9, 2022
1 parent 53c01f1 commit 504adfc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions jscomp/test/Import.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@ var each = import("../../lib/js/belt_List.js").then(function (m) {
return m.forEach;
});

function eachInt(list, f) {
var arg1 = function (each) {
return Promise.resolve(Curry._2(each, list, f));
};
return each.then(arg1);
}

var beltAsModule = import("../../lib/js/belt_List.js");

async function eachInt(list, f) {
async function eachIntAsync(list, f) {
var each$1 = await each;
return Curry._2(each$1, list, f);
}

exports.each = each;
exports.beltAsModule = beltAsModule;
exports.eachInt = eachInt;
exports.beltAsModule = beltAsModule;
exports.eachIntAsync = eachIntAsync;
/* No side effect */
4 changes: 2 additions & 2 deletions jscomp/test/Import.res
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ module type BeltList = module type of Belt.List

let beltAsModule = Js.import(module(Belt.List: BeltList))

let eachInt = async (list: list<int>, f: int => unit) => {
let eachIntAsync = async (list: list<int>, f: int => unit) => {
let each = await each
list->each(f)
}

let eachLazy = () => Js.import(Belt.List.forEach)

let eachInt = (list: list<int>, f: int => unit) =>
let eachIntLazy = (list: list<int>, f: int => unit) =>
eachLazy() |> Js.Promise.then_(each => list->each(f)->Js.Promise.resolve)

0 comments on commit 504adfc

Please sign in to comment.