From 261a55c6b5b05035b00d44d0fbc712b7fed4f456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20G=C3=A1l?= Date: Thu, 1 Oct 2020 16:36:48 +0200 Subject: [PATCH] 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 --- jerry-core/parser/js/js-scanner-util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jerry-core/parser/js/js-scanner-util.c b/jerry-core/parser/js/js-scanner-util.c index 8577c0a9b..75eec3d52 100644 --- a/jerry-core/parser/js/js-scanner-util.c +++ b/jerry-core/parser/js/js-scanner-util.c @@ -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)