There is an Assertion 'context_p->next_scanner_info_p->type == SCANNER_TYPE_FUNCTION' failed at js-parser-statm.c:733 in parser_parse_function_statement in JerryScript 2.2.0.
###### JerryScript revision
d06c3a7

###### Build platform
Ubuntu 16.04.6 LTS (Linux 4.15.0-99-generic x86_64)

###### Build steps
```
python tools/build.py --profile=es2015-subset --lto=off --compile-flag=-g \
--error-messages=on --debug --compile-flag=-g --strip=off --logging=on \
--compile-flag=-fsanitize=address --stack-limit=15
```

###### Test case
```
function a") {
```

###### Output
```
ICE: Assertion 'context_p->next_scanner_info_p->type == SCANNER_TYPE_FUNCTION' failed at /home/JerryScript/jerryscript/jerry-core/parser/js/js-parser-statm.c(parser_parse_function_statement):733.
Error: ERR_FAILED_INTERNAL_ASSERTION
Aborted (core dumped)
```

Credits: This vulnerability is detected by chong from OWL337.

Assertion 'context_p->next_scanner_info_p->type == SCANNER_TYPE_FUNCTION' in parser_parse_function_statement
This is a GitHub Issue
repo:jerryscript
owner:jerryscript-project
Title : Assertion 'context_p->next_scanner_info_p->type == SCANNER_TYPE_FUNCTION' in parser_parse_function_statement
Issue date:

--- start body ---
###### JerryScript revision
d06c3a7

###### Build platform
Ubuntu 16.04.6 LTS (Linux 4.15.0-99-generic x86_64)

###### Build steps
```
python tools/build.py --profile=es2015-subset --lto=off --compile-flag=-g \
--error-messages=on --debug --compile-flag=-g --strip=off --logging=on \
--compile-flag=-fsanitize=address --stack-limit=15
```

###### Test case
```
function a") {
```

###### Output
```
ICE: Assertion 'context_p->next_scanner_info_p->type == SCANNER_TYPE_FUNCTION' failed at /home/JerryScript/jerryscript/jerry-core/parser/js/js-parser-statm.c(parser_parse_function_statement):733.
Error: ERR_FAILED_INTERNAL_ASSERTION
Aborted (core dumped)
```

Credits: This vulnerability is detected by chong from OWL337.

--- end body ---

An internal assertion failure in the JerryScript parser when handling malformed function declarations can lead to a Denial of Service (DoS) via crafted JavaScript code. The assertion failure occurs due to an unexpected scanner type, which indicates a potential vulnerability in input validation.