diff --git a/jerry-core/ecma/base/ecma-module.c b/jerry-core/ecma/base/ecma-module.c index 21fc52fd70..1f6917eed9 100644 --- a/jerry-core/ecma/base/ecma-module.c +++ b/jerry-core/ecma/base/ecma-module.c @@ -335,10 +335,8 @@ ecma_module_resolve_import (ecma_module_resolve_result_t *resolve_result_p, /**< { ecma_module_node_t *import_node_p = module_p->imports_p; - while (true) + while (import_node_p != NULL) { - JERRY_ASSERT (import_node_p != NULL); - for (ecma_module_names_t *import_names_p = import_node_p->module_names_p; import_names_p != NULL; import_names_p = import_names_p->next_p) { @@ -368,6 +366,8 @@ ecma_module_resolve_import (ecma_module_resolve_result_t *resolve_result_p, /**< import_node_p = import_node_p->next_p; } + + return false; } /* ecma_module_resolve_import */ /** diff --git a/jerry-core/parser/js/js-parser-statm.c b/jerry-core/parser/js/js-parser-statm.c index 10df37e514..2a4f098a02 100644 --- a/jerry-core/parser/js/js-parser-statm.c +++ b/jerry-core/parser/js/js-parser-statm.c @@ -2327,6 +2327,12 @@ parser_parse_import_statement (parser_context_t *context_p) /**< parser context parser_raise_error (context_p, PARSER_ERR_IDENTIFIER_EXPECTED); } + if (context_p->next_scanner_info_p->source_p == context_p->source_p) + { + JERRY_ASSERT (context_p->next_scanner_info_p->type == SCANNER_TYPE_ERR_REDECLARED); + parser_raise_error (context_p, PARSER_ERR_VARIABLE_REDECLARED); + } + lexer_construct_literal_object (context_p, &context_p->token.lit_location, LEXER_IDENT_LITERAL); ecma_string_t *local_name_p = parser_new_ecma_string_from_literal (context_p->lit_object.literal_p);