diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-06-08 13:34:41 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-07-18 22:38:14 -0400 |
commit | f319f49a5280a7ba37cb551a7236505e496ae34a (patch) | |
tree | 6992d5f1e1522f1953169b1b84f193c081e2d8e9 /js/src/tests | |
parent | dcb43bda93f1f2cbe3da5ba1b7d3f783f1c8ad1c (diff) | |
download | UXP-f319f49a5280a7ba37cb551a7236505e496ae34a.tar UXP-f319f49a5280a7ba37cb551a7236505e496ae34a.tar.gz UXP-f319f49a5280a7ba37cb551a7236505e496ae34a.tar.lz UXP-f319f49a5280a7ba37cb551a7236505e496ae34a.tar.xz UXP-f319f49a5280a7ba37cb551a7236505e496ae34a.zip |
1317153 - Provide better error message when errornous syntax possibly match "await SOMETHING" outside async function.
Diffstat (limited to 'js/src/tests')
-rw-r--r-- | js/src/tests/ecma_2017/AsyncFunctions/await-error.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/js/src/tests/ecma_2017/AsyncFunctions/await-error.js b/js/src/tests/ecma_2017/AsyncFunctions/await-error.js new file mode 100644 index 000000000..1f40ea8a0 --- /dev/null +++ b/js/src/tests/ecma_2017/AsyncFunctions/await-error.js @@ -0,0 +1,16 @@ +var BUGNUMBER = 1317153; +var summary = "await outside of async function should provide better error"; + +print(BUGNUMBER + ": " + summary); + +let caught = false; +try { + eval("await 10"); +} catch(e) { + assertEq(e.message, "await is only valid in async functions"); + caught = true; +} +assertEq(caught, true); + +if (typeof reportCompare === "function") + reportCompare(true, true); |