Fix class handling with disabled module system (#4247)

If the module system is disabled however the es.next is enabled the following
code triggers an assert:

```js
class Demo {}
```

This was due to an incorrect scanner data processing where it was always
assumed that there is a module related information.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
This commit is contained in:
Péter Gál 2020-10-01 16:36:48 +02:00 committed by GitHub
parent 8fe3891b15
commit 261a55c6b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1889,8 +1889,8 @@ scanner_is_context_needed (parser_context_t *context_p, /**< context */
#if ENABLED (JERRY_ESNEXT)
#if ENABLED (JERRY_MODULE_SYSTEM)
const bool is_import = (type == SCANNER_STREAM_TYPE_IMPORT);
#else
const bool is_import = true;
#else /* !ENABLED (JERRY_MODULE_SYSTEM) */
const bool is_import = false;
#endif /* ENABLED (JERRY_MODULE_SYSTEM) */
if (JERRY_UNLIKELY (check_type == PARSER_CHECK_GLOBAL_CONTEXT)