Fix build with disabled ES2015 module system (#4084)
With a disabled ES2015 module system the build fails as an enum value is incorrectly guarded and used. JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
This commit is contained in:
@@ -680,10 +680,11 @@ parser_parse_function_statement (parser_context_t *context_p) /**< context */
|
|||||||
{
|
{
|
||||||
parser_raise_error (context_p, PARSER_ERR_VARIABLE_REDECLARED);
|
parser_raise_error (context_p, PARSER_ERR_VARIABLE_REDECLARED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t function_name_index = context_p->lit_object.index;
|
||||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||||
|
|
||||||
#if ENABLED (JERRY_MODULE_SYSTEM)
|
#if ENABLED (JERRY_MODULE_SYSTEM)
|
||||||
uint16_t function_name_index = context_p->lit_object.index;
|
|
||||||
parser_module_append_export_name (context_p);
|
parser_module_append_export_name (context_p);
|
||||||
context_p->status_flags &= (uint32_t) ~(PARSER_MODULE_STORE_IDENT);
|
context_p->status_flags &= (uint32_t) ~(PARSER_MODULE_STORE_IDENT);
|
||||||
#endif /* ENABLED (JERRY_MODULE_SYSTEM) */
|
#endif /* ENABLED (JERRY_MODULE_SYSTEM) */
|
||||||
|
|||||||
@@ -1739,13 +1739,19 @@ scanner_is_context_needed (parser_context_t *context_p, /**< context */
|
|||||||
}
|
}
|
||||||
else if (check_type == PARSER_CHECK_GLOBAL_CONTEXT)
|
else if (check_type == PARSER_CHECK_GLOBAL_CONTEXT)
|
||||||
{
|
{
|
||||||
|
#if ENABLED (JERRY_MODULE_SYSTEM)
|
||||||
|
const bool is_import = (type == SCANNER_STREAM_TYPE_IMPORT);
|
||||||
|
#else
|
||||||
|
const bool is_import = true;
|
||||||
|
#endif /* ENABLED (JERRY_MODULE_SYSTEM) */
|
||||||
|
|
||||||
/* FIXME: a private declarative lexical environment should always be present
|
/* FIXME: a private declarative lexical environment should always be present
|
||||||
* for modules. Remove SCANNER_STREAM_TYPE_IMPORT after it is implemented. */
|
* for modules. Remove SCANNER_STREAM_TYPE_IMPORT after it is implemented. */
|
||||||
JERRY_ASSERT (type == SCANNER_STREAM_TYPE_VAR
|
JERRY_ASSERT (type == SCANNER_STREAM_TYPE_VAR
|
||||||
|| type == SCANNER_STREAM_TYPE_LET
|
|| type == SCANNER_STREAM_TYPE_LET
|
||||||
|| type == SCANNER_STREAM_TYPE_CONST
|
|| type == SCANNER_STREAM_TYPE_CONST
|
||||||
|| type == SCANNER_STREAM_TYPE_FUNC
|
|| type == SCANNER_STREAM_TYPE_FUNC
|
||||||
|| type == SCANNER_STREAM_TYPE_IMPORT);
|
|| is_import);
|
||||||
|
|
||||||
/* Only let/const can be stored in registers */
|
/* Only let/const can be stored in registers */
|
||||||
JERRY_ASSERT ((data & SCANNER_STREAM_NO_REG)
|
JERRY_ASSERT ((data & SCANNER_STREAM_NO_REG)
|
||||||
@@ -1792,10 +1798,16 @@ scanner_is_context_needed (parser_context_t *context_p, /**< context */
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLED (JERRY_ESNEXT)
|
#if ENABLED (JERRY_ESNEXT)
|
||||||
|
#if ENABLED (JERRY_MODULE_SYSTEM)
|
||||||
|
const bool is_import = (type == SCANNER_STREAM_TYPE_IMPORT);
|
||||||
|
#else
|
||||||
|
const bool is_import = true;
|
||||||
|
#endif /* ENABLED (JERRY_MODULE_SYSTEM) */
|
||||||
|
|
||||||
if (JERRY_UNLIKELY (check_type == PARSER_CHECK_GLOBAL_CONTEXT)
|
if (JERRY_UNLIKELY (check_type == PARSER_CHECK_GLOBAL_CONTEXT)
|
||||||
&& (type == SCANNER_STREAM_TYPE_VAR
|
&& (type == SCANNER_STREAM_TYPE_VAR
|
||||||
|| (type == SCANNER_STREAM_TYPE_FUNC && !(context_p->global_status_flags & ECMA_PARSE_DIRECT_EVAL))
|
|| (type == SCANNER_STREAM_TYPE_FUNC && !(context_p->global_status_flags & ECMA_PARSE_DIRECT_EVAL))
|
||||||
|| type == SCANNER_STREAM_TYPE_IMPORT))
|
|| is_import))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,6 +159,8 @@ JERRY_BUILDOPTIONS = [
|
|||||||
['--cmake-param=-DENABLE_ALL_IN_ONE_SOURCE=ON']),
|
['--cmake-param=-DENABLE_ALL_IN_ONE_SOURCE=ON']),
|
||||||
Options('buildoption_test-jerry-debugger',
|
Options('buildoption_test-jerry-debugger',
|
||||||
['--jerry-debugger=on']),
|
['--jerry-debugger=on']),
|
||||||
|
Options('buildoption_test-module-off',
|
||||||
|
['--compile-flag=-DJERRY_MODULE_SYSTEM=0', '--lto=off']),
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_arguments():
|
def get_arguments():
|
||||||
|
|||||||
Reference in New Issue
Block a user