-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
85 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
jscomp/build_tests/super_errors/expected/await.res.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36m/.../fixtures/await.res[0m:[2m4:9-17[0m | ||
|
||
2 [2m│[0m let foo = async () => { | ||
3 [2m│[0m let _ = () | ||
[1;31m4[0m [2m│[0m () => [1;31mawait a()[0m | ||
5 [2m│[0m } | ||
6 [2m│[0m | ||
|
||
Await on expression not in an async context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
let a = async () => 3 | ||
let foo = async () => { | ||
let _ = () | ||
() => await a() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
'use strict'; | ||
|
||
var Curry = require("../../lib/js/curry.js"); | ||
var Caml_array = require("../../lib/js/caml_array.js"); | ||
|
||
function next(n) { | ||
return n + 1 | 0; | ||
} | ||
|
||
async function useNext(param) { | ||
return 4; | ||
} | ||
|
||
function Make(I) { | ||
var get = async function (key) { | ||
return await Curry._1(I.get, key); | ||
}; | ||
return { | ||
get: get | ||
}; | ||
} | ||
|
||
async function topFoo(param) { | ||
return 1; | ||
} | ||
|
||
var arr = [ | ||
1, | ||
2, | ||
3 | ||
]; | ||
|
||
var toplevelAwait = await topFoo(undefined); | ||
|
||
var toplevelAwait2 = Caml_array.get(arr, await topFoo(undefined)); | ||
|
||
exports.next = next; | ||
exports.useNext = useNext; | ||
exports.Make = Make; | ||
exports.topFoo = topFoo; | ||
exports.arr = arr; | ||
exports.toplevelAwait = toplevelAwait; | ||
exports.toplevelAwait2 = toplevelAwait2; | ||
/* toplevelAwait Not a pure module */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@@uncurried | ||
|
||
let next = n => n + 1 | ||
let useNext = async () => next(3) | ||
|
||
module type Impl = { | ||
let get: string => Js.Promise.t<string> | ||
} | ||
|
||
module Make = (I: Impl) => { | ||
let get = async (key) => await I.get(key) | ||
} | ||
|
||
let topFoo = async () => 1 | ||
let arr = [1, 2, 3] | ||
|
||
let toplevelAwait = await topFoo() | ||
let toplevelAwait2 = arr[await topFoo()] |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters