diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2024-01-08 18:40:35 +0100 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2024-01-08 18:40:35 +0100 |
commit | c06c399f4f8f8292e65e848ff3468f302c18a55e (patch) | |
tree | 1b6b2cc393abea39cdb5da0dc597d7c3755a61b9 /tests/test_language.js | |
parent | 5935a26eaed46f9e00cc5db73900321db940579a (diff) | |
download | quickjs-c06c399f4f8f8292e65e848ff3468f302c18a55e.tar.gz quickjs-c06c399f4f8f8292e65e848ff3468f302c18a55e.zip |
fixed next token parsing after a function definition (github issue #77)
Diffstat (limited to 'tests/test_language.js')
-rw-r--r-- | tests/test_language.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_language.js b/tests/test_language.js index f1df6a0..6785416 100644 --- a/tests/test_language.js +++ b/tests/test_language.js @@ -536,6 +536,28 @@ function test_function_expr_name() assert_throws(TypeError, f); } +function test_parse_semicolon() +{ + /* 'yield' or 'await' may not be considered as a token if the + previous ';' is missing */ + function *f() + { + function func() { + } + yield 1; + var h = x => x + 1 + yield 2; + } + async function g() + { + function func() { + } + await 1; + var h = x => x + 1 + await 2; + } +} + test_op1(); test_cvt(); test_eq(); @@ -555,3 +577,4 @@ test_spread(); test_function_length(); test_argument_scope(); test_function_expr_name(); +test_parse_semicolon(); |