aboutsummaryrefslogtreecommitdiff
path: root/jerry-core
diff options
context:
space:
mode:
Diffstat (limited to 'jerry-core')
-rw-r--r--jerry-core/api/jerry-snapshot.c12
-rw-r--r--jerry-core/api/jerryscript.c123
-rw-r--r--jerry-core/config.h66
-rw-r--r--jerry-core/debugger/debugger.c2
-rw-r--r--jerry-core/ecma/base/ecma-error-messages.inc.h242
-rw-r--r--jerry-core/ecma/base/ecma-error-messages.ini4
-rw-r--r--jerry-core/ecma/base/ecma-extended-info.c6
-rw-r--r--jerry-core/ecma/base/ecma-extended-info.h4
-rw-r--r--jerry-core/ecma/base/ecma-gc.c55
-rw-r--r--jerry-core/ecma/base/ecma-globals.h68
-rw-r--r--jerry-core/ecma/base/ecma-helpers-collection.c4
-rw-r--r--jerry-core/ecma/base/ecma-helpers-conversion.c16
-rw-r--r--jerry-core/ecma/base/ecma-helpers-string.c15
-rw-r--r--jerry-core/ecma/base/ecma-helpers-value.c23
-rw-r--r--jerry-core/ecma/base/ecma-helpers.c18
-rw-r--r--jerry-core/ecma/base/ecma-helpers.h19
-rw-r--r--jerry-core/ecma/base/ecma-init-finalize.c8
-rw-r--r--jerry-core/ecma/base/ecma-literal-storage.c6
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c164
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.inc.h7
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-array.c11
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-array.inc.h5
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.c6
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-async-function.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-async-function.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.c6
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.c8
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-boolean.inc.h3
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c40
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h11
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-date.c29
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-date.inc.h2
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-error.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-error.inc.h2
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h2
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c16
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.inc.h5
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-function.inc.h3
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.c6
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.c8
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-generator.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-generator.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-global.c2
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h8
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-handlers.c12
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-handlers.h9
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-defines.inc.h2
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-undefs.inc.h2
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c62
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h34
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h2
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.c50
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-json.c15
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-json.inc.h2
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-math.c17
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-math.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-number.c5
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-number.inc.h6
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c12
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-object.c54
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h12
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-promise.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-promise.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.inc.h3
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.inc.h3
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.c110
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h17
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-regexp.c22
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-regexp.inc.h3
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c87
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-string.c14
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-string.inc.h6
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.inc.h3
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-symbol.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-symbol.inc.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.inc.h3
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.inc.h3
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-urierror.c4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-urierror.inc.h3
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtins-internal.h4
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtins.c89
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtins.h8
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtins.inc.h34
-rw-r--r--jerry-core/ecma/operations/ecma-arguments-object.c32
-rw-r--r--jerry-core/ecma/operations/ecma-array-object.c4
-rw-r--r--jerry-core/ecma/operations/ecma-array-object.h2
-rw-r--r--jerry-core/ecma/operations/ecma-async-generator-object.c7
-rw-r--r--jerry-core/ecma/operations/ecma-async-generator-object.h4
-rw-r--r--jerry-core/ecma/operations/ecma-big-uint.c4
-rw-r--r--jerry-core/ecma/operations/ecma-big-uint.h2
-rw-r--r--jerry-core/ecma/operations/ecma-bigint.c4
-rw-r--r--jerry-core/ecma/operations/ecma-bigint.h2
-rw-r--r--jerry-core/ecma/operations/ecma-boolean-object.c5
-rw-r--r--jerry-core/ecma/operations/ecma-comparison.c12
-rw-r--r--jerry-core/ecma/operations/ecma-container-object.c6
-rw-r--r--jerry-core/ecma/operations/ecma-conversion.c84
-rw-r--r--jerry-core/ecma/operations/ecma-conversion.h2
-rw-r--r--jerry-core/ecma/operations/ecma-eval.c8
-rw-r--r--jerry-core/ecma/operations/ecma-exceptions.c12
-rw-r--r--jerry-core/ecma/operations/ecma-exceptions.h2
-rw-r--r--jerry-core/ecma/operations/ecma-function-object.c154
-rw-r--r--jerry-core/ecma/operations/ecma-function-object.h7
-rw-r--r--jerry-core/ecma/operations/ecma-get-put-value.c17
-rw-r--r--jerry-core/ecma/operations/ecma-iterator-object.c4
-rw-r--r--jerry-core/ecma/operations/ecma-iterator-object.h4
-rw-r--r--jerry-core/ecma/operations/ecma-jobqueue.c3
-rw-r--r--jerry-core/ecma/operations/ecma-jobqueue.h4
-rw-r--r--jerry-core/ecma/operations/ecma-lex-env.c15
-rw-r--r--jerry-core/ecma/operations/ecma-lex-env.h4
-rw-r--r--jerry-core/ecma/operations/ecma-number-object.c8
-rw-r--r--jerry-core/ecma/operations/ecma-objects-general.c30
-rw-r--r--jerry-core/ecma/operations/ecma-objects-general.h2
-rw-r--r--jerry-core/ecma/operations/ecma-objects.c120
-rw-r--r--jerry-core/ecma/operations/ecma-objects.h4
-rw-r--r--jerry-core/ecma/operations/ecma-promise-object.c3
-rw-r--r--jerry-core/ecma/operations/ecma-promise-object.h7
-rw-r--r--jerry-core/ecma/operations/ecma-reference.c19
-rw-r--r--jerry-core/ecma/operations/ecma-reference.h2
-rw-r--r--jerry-core/ecma/operations/ecma-regexp-object.c358
-rw-r--r--jerry-core/ecma/operations/ecma-regexp-object.h3
-rw-r--r--jerry-core/ecma/operations/ecma-string-object.c7
-rw-r--r--jerry-core/ecma/operations/ecma-symbol-object.c3
-rw-r--r--jerry-core/ecma/operations/ecma-symbol-object.h3
-rw-r--r--jerry-core/jcontext/jcontext.h9
-rw-r--r--jerry-core/lit/lit-char-helpers.c45
-rw-r--r--jerry-core/lit/lit-char-helpers.h4
-rw-r--r--jerry-core/lit/lit-magic-strings.inc.h493
-rw-r--r--jerry-core/parser/js/byte-code.h7
-rw-r--r--jerry-core/parser/js/common.c4
-rw-r--r--jerry-core/parser/js/common.h2
-rw-r--r--jerry-core/parser/js/js-lexer.c200
-rw-r--r--jerry-core/parser/js/js-lexer.h27
-rw-r--r--jerry-core/parser/js/js-parser-expr.c350
-rw-r--r--jerry-core/parser/js/js-parser-internal.h53
-rw-r--r--jerry-core/parser/js/js-parser-statm.c176
-rw-r--r--jerry-core/parser/js/js-parser-tagged-template-literal.c2
-rw-r--r--jerry-core/parser/js/js-parser-tagged-template-literal.h2
-rw-r--r--jerry-core/parser/js/js-parser-util.c4
-rw-r--r--jerry-core/parser/js/js-parser.c99
-rw-r--r--jerry-core/parser/js/js-scanner-internal.h55
-rw-r--r--jerry-core/parser/js/js-scanner-ops.c32
-rw-r--r--jerry-core/parser/js/js-scanner-util.c208
-rw-r--r--jerry-core/parser/js/js-scanner.c262
-rw-r--r--jerry-core/parser/js/js-scanner.h41
-rw-r--r--jerry-core/parser/js/parser-error-messages.inc.h98
-rw-r--r--jerry-core/parser/js/parser-error-messages.ini2
-rw-r--r--jerry-core/parser/regexp/re-bytecode.c21
-rw-r--r--jerry-core/parser/regexp/re-bytecode.h2
-rw-r--r--jerry-core/parser/regexp/re-parser.c33
-rw-r--r--jerry-core/profiles/README.md55
-rw-r--r--jerry-core/profiles/es2015-subset.profile1
-rw-r--r--jerry-core/profiles/es5.1.profile1
-rw-r--r--jerry-core/profiles/minimal.profile1
-rw-r--r--jerry-core/vm/opcodes-ecma-arithmetics.c4
-rw-r--r--jerry-core/vm/opcodes-ecma-relational-equality.c2
-rw-r--r--jerry-core/vm/opcodes.c48
-rw-r--r--jerry-core/vm/opcodes.h11
-rw-r--r--jerry-core/vm/vm-defines.h6
-rw-r--r--jerry-core/vm/vm-stack.c30
-rw-r--r--jerry-core/vm/vm-stack.h12
-rw-r--r--jerry-core/vm/vm.c87
-rw-r--r--jerry-core/vm/vm.h89
198 files changed, 484 insertions, 4998 deletions
diff --git a/jerry-core/api/jerry-snapshot.c b/jerry-core/api/jerry-snapshot.c
index 55e905a4..35478e4b 100644
--- a/jerry-core/api/jerry-snapshot.c
+++ b/jerry-core/api/jerry-snapshot.c
@@ -50,9 +50,8 @@ snapshot_get_global_flags (bool has_regex, /**< regex literal is present */
#if JERRY_BUILTIN_REGEXP
flags |= (has_regex ? JERRY_SNAPSHOT_HAS_REGEX_LITERAL : 0);
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_ESNEXT
+
flags |= (has_class ? JERRY_SNAPSHOT_HAS_CLASS_LITERAL : 0);
-#endif /* JERRY_ESNEXT */
return flags;
} /* snapshot_get_global_flags */
@@ -68,9 +67,8 @@ snapshot_check_global_flags (uint32_t global_flags) /**< global flags */
#if JERRY_BUILTIN_REGEXP
global_flags &= (uint32_t) ~JERRY_SNAPSHOT_HAS_REGEX_LITERAL;
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_ESNEXT
+
global_flags &= (uint32_t) ~JERRY_SNAPSHOT_HAS_CLASS_LITERAL;
-#endif /* JERRY_ESNEXT */
return global_flags == snapshot_get_global_flags (false, false);
} /* snapshot_check_global_flags */
@@ -164,7 +162,6 @@ snapshot_add_compiled_code (const ecma_compiled_code_t *compiled_code_p, /**< co
uint8_t *copied_code_start_p = snapshot_buffer_p + globals_p->snapshot_buffer_write_offset;
ecma_compiled_code_t *copied_code_p = (ecma_compiled_code_t *) copied_code_start_p;
-#if JERRY_ESNEXT
if (compiled_code_p->status_flags & CBC_CODE_FLAGS_HAS_TAGGED_LITERALS)
{
globals_p->snapshot_error =
@@ -176,7 +173,6 @@ snapshot_add_compiled_code (const ecma_compiled_code_t *compiled_code_p, /**< co
{
globals_p->class_found = true;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_REGEXP
if (!CBC_IS_FUNCTION (compiled_code_p->status_flags))
@@ -629,7 +625,6 @@ snapshot_load_compiled_code (const uint8_t *base_addr_p, /**< base address of th
extra_bytes += (uint32_t) (argument_end * sizeof (ecma_value_t));
}
-#if JERRY_ESNEXT
/* function name */
if (CBC_FUNCTION_GET_TYPE (bytecode_p->status_flags) != CBC_FUNCTION_CONSTRUCTOR)
{
@@ -641,7 +636,6 @@ snapshot_load_compiled_code (const uint8_t *base_addr_p, /**< base address of th
{
extra_bytes += (uint32_t) sizeof (ecma_value_t);
}
-#endif /* JERRY_ESNEXT */
#if JERRY_SOURCE_NAME
/* source name */
@@ -1011,12 +1005,10 @@ jerry_exec_snapshot (const uint32_t *snapshot_p, /**< snapshot */
JERRY_ASSERT (global_object_p == (ecma_object_t *) ecma_op_function_get_realm (bytecode_p));
#endif /* JERRY_BUILTIN_REALMS */
-#if JERRY_ESNEXT
if (bytecode_p->status_flags & CBC_CODE_FLAGS_LEXICAL_BLOCK_NEEDED)
{
ecma_create_global_lexical_block (global_object_p);
}
-#endif /* JERRY_ESNEXT */
ecma_object_t *lex_env_p = ecma_get_global_scope (global_object_p);
ecma_object_t *func_obj_p = ecma_op_create_simple_function_object (lex_env_p, bytecode_p);
diff --git a/jerry-core/api/jerryscript.c b/jerry-core/api/jerryscript.c
index 75022c7f..15a426f4 100644
--- a/jerry-core/api/jerryscript.c
+++ b/jerry-core/api/jerryscript.c
@@ -74,12 +74,10 @@ JERRY_STATIC_ASSERT ((int) RE_FLAG_GLOBAL == (int) JERRY_REGEXP_FLAG_GLOBAL
re_flags_t_must_be_equal_to_jerry_regexp_flags_t);
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_ESNEXT
/* The internal ECMA_PROMISE_STATE_* values are "one byte away" from the API values */
JERRY_STATIC_ASSERT ((int) ECMA_PROMISE_IS_PENDING == (int) JERRY_PROMISE_STATE_PENDING
&& (int) ECMA_PROMISE_IS_FULFILLED == (int) JERRY_PROMISE_STATE_FULFILLED,
promise_internal_state_matches_external);
-#endif /* JERRY_ESNEXT */
/**
* Offset between internal and external arithmetic operator types
@@ -221,9 +219,7 @@ jerry_cleanup (void)
}
}
-#if JERRY_ESNEXT
ecma_free_all_enqueued_jobs ();
-#endif /* JERRY_ESNEXT */
ecma_finalize ();
jerry_api_disable ();
@@ -1079,11 +1075,7 @@ jerry_run_jobs (void)
{
jerry_assert_api_enabled ();
-#if JERRY_ESNEXT
return jerry_return (ecma_process_all_enqueued_jobs ());
-#else /* !JERRY_ESNEXT */
- return ECMA_VALUE_UNDEFINED;
-#endif /* JERRY_ESNEXT */
} /* jerry_run_jobs */
/**
@@ -1234,7 +1226,6 @@ jerry_value_is_async_function (const jerry_value_t value) /**< api value */
{
jerry_assert_api_enabled ();
-#if JERRY_ESNEXT
if (ecma_is_value_object (value))
{
ecma_object_t *obj_p = ecma_get_object_from_value (value);
@@ -1248,9 +1239,6 @@ jerry_value_is_async_function (const jerry_value_t value) /**< api value */
return (type == CBC_FUNCTION_ASYNC || type == CBC_FUNCTION_ASYNC_ARROW || type == CBC_FUNCTION_ASYNC_GENERATOR);
}
}
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (value);
-#endif /* JERRY_ESNEXT */
return false;
} /* jerry_value_is_async_function */
@@ -1307,12 +1295,8 @@ bool
jerry_value_is_promise (const jerry_value_t value) /**< api value */
{
jerry_assert_api_enabled ();
-#if JERRY_ESNEXT
+
return (ecma_is_value_object (value) && ecma_is_promise (ecma_get_object_from_value (value)));
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (value);
- return false;
-#endif /* JERRY_ESNEXT */
} /* jerry_value_is_promise */
/**
@@ -1358,12 +1342,7 @@ jerry_value_is_symbol (const jerry_value_t value) /**< api value */
{
jerry_assert_api_enabled ();
-#if JERRY_ESNEXT
return ecma_is_value_symbol (value);
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (value);
- return false;
-#endif /* JERRY_ESNEXT */
} /* jerry_value_is_symbol */
/**
@@ -1436,12 +1415,10 @@ jerry_value_type (const jerry_value_t value) /**< input value to check */
{
return JERRY_TYPE_STRING;
}
-#if JERRY_ESNEXT
case LIT_MAGIC_STRING_SYMBOL:
{
return JERRY_TYPE_SYMBOL;
}
-#endif /* JERRY_ESNEXT */
case LIT_MAGIC_STRING_FUNCTION:
{
return JERRY_TYPE_FUNCTION;
@@ -1478,8 +1455,7 @@ static const uint8_t jerry_class_object_type[] = {
JERRY_OBJECT_TYPE_MODULE_NAMESPACE, /**< type of ECMA_OBJECT_CLASS_MODULE_NAMESPACE */
#endif /* JERRY_MODULE_SYSTEM */
-/* These objects are marked by Garbage Collector. */
-#if JERRY_ESNEXT
+ /* These objects are marked by Garbage Collector. */
JERRY_OBJECT_TYPE_GENERATOR, /**< type of ECMA_OBJECT_CLASS_GENERATOR */
JERRY_OBJECT_TYPE_GENERATOR, /**< type of ECMA_OBJECT_CLASS_ASYNC_GENERATOR */
JERRY_OBJECT_TYPE_ITERATOR, /**< type of ECMA_OBJECT_CLASS_ARRAY_ITERATOR */
@@ -1488,15 +1464,12 @@ static const uint8_t jerry_class_object_type[] = {
#if JERRY_BUILTIN_REGEXP
JERRY_OBJECT_TYPE_ITERATOR, /**< type of ECMA_OBJECT_CLASS_REGEXP_STRING_ITERATOR */
#endif /* JERRY_BUILTIN_REGEXP */
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
JERRY_OBJECT_TYPE_MODULE, /**< type of ECMA_OBJECT_CLASS_MODULE */
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_ESNEXT
JERRY_OBJECT_TYPE_PROMISE, /**< type of ECMA_OBJECT_CLASS_PROMISE */
JERRY_OBJECT_TYPE_GENERIC, /**< type of ECMA_OBJECT_CLASS_PROMISE_CAPABILITY */
JERRY_OBJECT_TYPE_GENERIC, /**< type of ECMA_OBJECT_CLASS_ASYNC_FROM_SYNC_ITERATOR */
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_DATAVIEW
JERRY_OBJECT_TYPE_DATAVIEW, /**< type of ECMA_OBJECT_CLASS_DATAVIEW */
#endif /* JERRY_BUILTIN_DATAVIEW */
@@ -1518,10 +1491,8 @@ static const uint8_t jerry_class_object_type[] = {
#if JERRY_BUILTIN_REGEXP
JERRY_OBJECT_TYPE_REGEXP, /**< type of ECMA_OBJECT_CLASS_REGEXP */
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_ESNEXT
JERRY_OBJECT_TYPE_SYMBOL, /**< type of ECMA_OBJECT_CLASS_SYMBOL */
JERRY_OBJECT_TYPE_ITERATOR, /**< type of ECMA_OBJECT_CLASS_STRING_ITERATOR */
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
JERRY_OBJECT_TYPE_ARRAYBUFFER, /**< type of ECMA_OBJECT_CLASS_ARRAY_BUFFER */
#if JERRY_BUILTIN_SHAREDARRAYBUFFER
@@ -1571,12 +1542,10 @@ jerry_object_type (const jerry_value_t value) /**< input value to check */
{
return JERRY_OBJECT_TYPE_ARRAY;
}
-#if JERRY_ESNEXT
case ECMA_OBJECT_TYPE_PROXY:
{
return JERRY_OBJECT_TYPE_PROXY;
}
-#endif /* JERRY_ESNEXT */
case ECMA_OBJECT_TYPE_FUNCTION:
case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
case ECMA_OBJECT_TYPE_NATIVE_FUNCTION:
@@ -1626,7 +1595,6 @@ jerry_function_type (const jerry_value_t value) /**< input value to check */
switch (CBC_FUNCTION_GET_TYPE (bytecode_data_p->status_flags))
{
-#if JERRY_ESNEXT
case CBC_FUNCTION_ARROW:
case CBC_FUNCTION_ASYNC_ARROW:
{
@@ -1637,7 +1605,6 @@ jerry_function_type (const jerry_value_t value) /**< input value to check */
{
return JERRY_FUNCTION_TYPE_GENERATOR;
}
-#endif /* JERRY_ESNEXT */
case CBC_FUNCTION_ACCESSOR:
{
return JERRY_FUNCTION_TYPE_ACCESSOR;
@@ -1670,7 +1637,6 @@ jerry_iterator_type (const jerry_value_t value) /**< input value to check */
{
jerry_assert_api_enabled ();
-#if JERRY_ESNEXT
if (ecma_is_value_object (value))
{
ecma_object_t *obj_p = ecma_get_object_from_value (value);
@@ -1705,9 +1671,6 @@ jerry_iterator_type (const jerry_value_t value) /**< input value to check */
}
}
}
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (value);
-#endif /* JERRY_ESNEXT */
return JERRY_ITERATOR_TYPE_NONE;
} /* jerry_iterator_type */
@@ -1760,9 +1723,6 @@ jerry_feature_enabled (const jerry_feature_t feature) /**< feature to check */
#if JERRY_BUILTIN_JSON
|| feature == JERRY_FEATURE_JSON
#endif /* JERRY_BUILTIN_JSON */
-#if JERRY_ESNEXT
- || feature == JERRY_FEATURE_PROMISE || feature == JERRY_FEATURE_SYMBOL
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
|| feature == JERRY_FEATURE_TYPEDARRAY
#endif /* JERRY_BUILTIN_TYPEDARRAY */
@@ -2610,12 +2570,8 @@ jerry_promise (void)
{
jerry_assert_api_enabled ();
-#if JERRY_ESNEXT
return jerry_return (ecma_op_create_promise_object (ECMA_VALUE_EMPTY, ECMA_VALUE_UNDEFINED, NULL));
-#else /* !JERRY_ESNEXT */
- return jerry_throw_sz (JERRY_ERROR_TYPE, ecma_get_error_msg (ECMA_ERR_PROMISE_NOT_SUPPORTED));
-#endif /* JERRY_ESNEXT */
-} /* jerry_promise */
+} /* jerry_create_promise */
/**
* Create a new Proxy object with the given target and handler
@@ -2797,12 +2753,8 @@ jerry_symbol_with_description (const jerry_value_t value) /**< api value */
return jerry_throw_sz (JERRY_ERROR_TYPE, ecma_get_error_msg (ECMA_ERR_WRONG_ARGS_MSG));
}
-#if JERRY_ESNEXT
return jerry_return (ecma_op_create_symbol (&value, 1));
-#else /* !JERRY_ESNEXT */
- return jerry_throw_sz (JERRY_ERROR_TYPE, ecma_get_error_msg (ECMA_ERR_SYMBOL_NOT_SUPPORTED));
-#endif /* JERRY_ESNEXT */
-} /* jerry_symbol_with_description */
+} /* jerry_create_symbol */
/**
* Create BigInt from a sequence of uint64 digits.
@@ -4772,7 +4724,6 @@ jerry_promise_resolve (jerry_value_t promise, /**< the promise value */
{
jerry_assert_api_enabled ();
-#if JERRY_ESNEXT
if (!jerry_value_is_promise (promise))
{
return jerry_throw_sz (JERRY_ERROR_TYPE, ecma_get_error_msg (ECMA_ERR_WRONG_ARGS_MSG));
@@ -4784,12 +4735,6 @@ jerry_promise_resolve (jerry_value_t promise, /**< the promise value */
}
return ecma_fulfill_promise_with_checks (promise, argument);
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (promise);
- JERRY_UNUSED (argument);
-
- return jerry_throw_sz (JERRY_ERROR_TYPE, ecma_get_error_msg (ECMA_ERR_PROMISE_NOT_SUPPORTED));
-#endif /* JERRY_ESNEXT */
} /* jerry_promise_resolve */
/**
@@ -4804,7 +4749,6 @@ jerry_promise_reject (jerry_value_t promise, /**< the promise value */
{
jerry_assert_api_enabled ();
-#if JERRY_ESNEXT
if (!jerry_value_is_promise (promise))
{
return jerry_throw_sz (JERRY_ERROR_TYPE, ecma_get_error_msg (ECMA_ERR_WRONG_ARGS_MSG));
@@ -4816,12 +4760,6 @@ jerry_promise_reject (jerry_value_t promise, /**< the promise value */
}
return ecma_reject_promise_with_checks (promise, argument);
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (promise);
- JERRY_UNUSED (argument);
-
- return jerry_throw_sz (JERRY_ERROR_TYPE, ecma_get_error_msg (ECMA_ERR_PROMISE_NOT_SUPPORTED));
-#endif /* JERRY_ESNEXT */
} /* jerry_promise_reject */
/**
@@ -4835,18 +4773,13 @@ jerry_promise_result (const jerry_value_t promise) /**< promise object to get th
{
jerry_assert_api_enabled ();
-#if JERRY_ESNEXT
if (!jerry_value_is_promise (promise))
{
return jerry_throw_sz (JERRY_ERROR_TYPE, ecma_get_error_msg (ECMA_ERR_WRONG_ARGS_MSG));
}
return ecma_promise_get_result (ecma_get_object_from_value (promise));
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (promise);
- return jerry_throw_sz (JERRY_ERROR_TYPE, ecma_get_error_msg (ECMA_ERR_PROMISE_NOT_SUPPORTED));
-#endif /* JERRY_ESNEXT */
-} /* jerry_promise_result */
+} /* jerry_get_promise_result */
/**
* Get the state of a promise object.
@@ -4860,7 +4793,6 @@ jerry_promise_state (const jerry_value_t promise) /**< promise object to get the
{
jerry_assert_api_enabled ();
-#if JERRY_ESNEXT
if (!jerry_value_is_promise (promise))
{
return JERRY_PROMISE_STATE_NONE;
@@ -4870,11 +4802,7 @@ jerry_promise_state (const jerry_value_t promise) /**< promise object to get the
flags &= (ECMA_PROMISE_IS_PENDING | ECMA_PROMISE_IS_FULFILLED);
return (flags ? flags : JERRY_PROMISE_STATE_REJECTED);
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (promise);
- return JERRY_PROMISE_STATE_NONE;
-#endif /* JERRY_ESNEXT */
-} /* jerry_promise_state */
+} /* jerry_get_promise_state */
/**
* Sets a callback for tracking Promise and async operations.
@@ -4889,7 +4817,7 @@ jerry_promise_on_event (jerry_promise_event_filter_t filters, /**< combination o
{
jerry_assert_api_enabled ();
-#if JERRY_ESNEXT && JERRY_PROMISE_CALLBACK
+#if JERRY_PROMISE_CALLBACK
if (filters == JERRY_PROMISE_EVENT_FILTER_DISABLE || callback == NULL)
{
JERRY_CONTEXT (promise_callback_filters) = JERRY_PROMISE_EVENT_FILTER_DISABLE;
@@ -4899,12 +4827,12 @@ jerry_promise_on_event (jerry_promise_event_filter_t filters, /**< combination o
JERRY_CONTEXT (promise_callback_filters) = (uint32_t) filters;
JERRY_CONTEXT (promise_callback) = callback;
JERRY_CONTEXT (promise_callback_user_p) = user_p;
-#else /* !JERRY_ESNEXT && !JERRY_PROMISE_CALLBACK */
+#else /* !JERRY_PROMISE_CALLBACK */
JERRY_UNUSED (filters);
JERRY_UNUSED (callback);
JERRY_UNUSED (user_p);
-#endif /* JERRY_ESNEXT && JERRY_PROMISE_CALLBACK */
-} /* jerry_promise_on_event */
+#endif /* JERRY_PROMISE_CALLBACK */
+} /* jerry_promise_set_callback */
/**
* Get the well-knwon symbol represented by the given `symbol` enum value.
@@ -4920,7 +4848,6 @@ jerry_symbol (jerry_well_known_symbol_t symbol) /**< jerry_well_known_symbol_t e
{
jerry_assert_api_enabled ();
-#if JERRY_ESNEXT
lit_magic_string_id_t id = (lit_magic_string_id_t) (LIT_GLOBAL_SYMBOL__FIRST + symbol);
if (!LIT_IS_GLOBAL_SYMBOL (id))
@@ -4929,12 +4856,7 @@ jerry_symbol (jerry_well_known_symbol_t symbol) /**< jerry_well_known_symbol_t e
}
return ecma_make_symbol_value (ecma_op_get_global_symbol (id));
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (symbol);
-
- return ECMA_VALUE_UNDEFINED;
-#endif /* JERRY_ESNEXT */
-} /* jerry_symbol */
+} /* jerry_get_well_known_symbol */
/**
* Returns the description internal property of a symbol.
@@ -4950,7 +4872,6 @@ jerry_symbol_description (const jerry_value_t symbol) /**< symbol value */
{
jerry_assert_api_enabled ();
-#if JERRY_ESNEXT
if (!ecma_is_value_symbol (symbol))
{
return jerry_throw_sz (JERRY_ERROR_TYPE, ecma_get_error_msg (ECMA_ERR_WRONG_ARGS_MSG));
@@ -4958,12 +4879,7 @@ jerry_symbol_description (const jerry_value_t symbol) /**< symbol value */
/* Note: This operation cannot throw an error */
return ecma_copy_value (ecma_get_symbol_description (ecma_get_symbol_from_value (symbol)));
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (symbol);
-
- return jerry_throw_sz (JERRY_ERROR_TYPE, ecma_get_error_msg (ECMA_ERR_SYMBOL_NOT_SUPPORTED));
-#endif /* JERRY_ESNEXT */
-} /* jerry_symbol_description */
+} /* jerry_get_symbol_description */
/**
* Call the SymbolDescriptiveString ecma builtin operation on the symbol value.
@@ -4979,7 +4895,6 @@ jerry_symbol_descriptive_string (const jerry_value_t symbol) /**< symbol value *
{
jerry_assert_api_enabled ();
-#if JERRY_ESNEXT
if (!ecma_is_value_symbol (symbol))
{
return jerry_throw_sz (JERRY_ERROR_TYPE, ecma_get_error_msg (ECMA_ERR_WRONG_ARGS_MSG));
@@ -4987,12 +4902,7 @@ jerry_symbol_descriptive_string (const jerry_value_t symbol) /**< symbol value *
/* Note: This operation cannot throw an error */
return ecma_get_symbol_descriptive_string (symbol);
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (symbol);
-
- return jerry_throw_sz (JERRY_ERROR_TYPE, ecma_get_error_msg (ECMA_ERR_SYMBOL_NOT_SUPPORTED));
-#endif /* JERRY_ESNEXT */
-} /* jerry_symbol_descriptive_string */
+} /* jerry_get_symbol_descriptive_string */
/**
* Get the number of uint64 digits of a BigInt value
@@ -5775,12 +5685,10 @@ jerry_source_info (const jerry_value_t value) /**< jerry api value */
uint8_t *extended_info_p = ecma_compiled_code_resolve_extended_info (bytecode_p);
uint8_t extended_info = *extended_info_p;
-#if JERRY_ESNEXT
if (extended_info & CBC_EXTENDED_CODE_FLAGS_HAS_ARGUMENT_LENGTH)
{
ecma_extended_info_decode_vlq (&extended_info_p);
}
-#endif /* JERRY_ESNEXT */
if (extended_info & CBC_EXTENDED_CODE_FLAGS_SOURCE_CODE_IN_ARGUMENTS)
{
@@ -5819,14 +5727,12 @@ jerry_source_info (const jerry_value_t value) /**< jerry api value */
ECMA_GET_NON_NULL_POINTER_FROM_POINTER_TAG (ecma_object_t, ext_object_p->u.bound_function.target_function);
continue;
}
-#if JERRY_ESNEXT
case ECMA_OBJECT_TYPE_CONSTRUCTOR_FUNCTION:
{
ecma_value_t script_value = ((ecma_extended_object_t *) object_p)->u.constructor_function.script_value;
script_p = ECMA_GET_INTERNAL_VALUE_POINTER (cbc_script_t, script_value);
break;
}
-#endif /* JERRY_ESNEXT */
default:
{
return NULL;
@@ -5989,9 +5895,8 @@ jerry_realm_set_this (jerry_value_t realm, /**< realm value */
ecma_object_t *global_lex_env_p = ecma_create_object_lex_env (NULL, ecma_get_object_from_value (this_value));
ECMA_SET_NON_NULL_POINTER (global_object_p->global_env_cp, global_lex_env_p);
-#if JERRY_ESNEXT
global_object_p->global_scope_cp = global_object_p->global_env_cp;
-#endif /* JERRY_ESNEXT */
+
ecma_deref_object (global_lex_env_p);
return ECMA_VALUE_TRUE;
}
diff --git a/jerry-core/config.h b/jerry-core/config.h
index 7444fd9a..002f49e3 100644
--- a/jerry-core/config.h
+++ b/jerry-core/config.h
@@ -72,59 +72,52 @@
#define JERRY_BUILTIN_STRING JERRY_BUILTINS
#endif /* !defined (JERRY_BUILTIN_STRING) */
-/**
- * ES2015+ related features, by default all of them are enabled.
- */
-#ifndef JERRY_ESNEXT
-#define JERRY_ESNEXT 1
-#endif /* !defined (JERRY_ESNEXT) */
-
#ifndef JERRY_BUILTIN_BIGINT
-#define JERRY_BUILTIN_BIGINT JERRY_ESNEXT
+#define JERRY_BUILTIN_BIGINT JERRY_BUILTINS
#endif /* !defined (JERRY_BUILTIN_BIGINT) */
#ifndef JERRY_BUILTIN_CONTAINER
-#define JERRY_BUILTIN_CONTAINER JERRY_ESNEXT
+#define JERRY_BUILTIN_CONTAINER JERRY_BUILTINS
#endif /* !defined (JERRY_BUILTIN_CONTAINER) */
#ifndef JERRY_BUILTIN_DATAVIEW
-#define JERRY_BUILTIN_DATAVIEW JERRY_ESNEXT
+#define JERRY_BUILTIN_DATAVIEW JERRY_BUILTINS
#endif /* !defined (JERRY_BUILTIN_DATAVIEW) */
#ifndef JERRY_BUILTIN_GLOBAL_THIS
-#define JERRY_BUILTIN_GLOBAL_THIS JERRY_ESNEXT
+#define JERRY_BUILTIN_GLOBAL_THIS JERRY_BUILTINS
#endif /* !defined (JERRY_BUILTIN_GLOBAL_THIS) */
#ifndef JERRY_BUILTIN_PROXY
-#define JERRY_BUILTIN_PROXY JERRY_ESNEXT
+#define JERRY_BUILTIN_PROXY JERRY_BUILTINS
#endif /* !defined (JERRY_BUILTIN_PROXY) */
#ifndef JERRY_BUILTIN_REALMS
-#define JERRY_BUILTIN_REALMS JERRY_ESNEXT
+#define JERRY_BUILTIN_REALMS JERRY_BUILTINS
#endif /* !defined (JERRY_BUILTIN_REALMS) */
#ifndef JERRY_BUILTIN_REFLECT
-#define JERRY_BUILTIN_REFLECT JERRY_ESNEXT
+#define JERRY_BUILTIN_REFLECT JERRY_BUILTINS
#endif /* !defined (JERRY_BUILTIN_REFLECT) */
#ifndef JERRY_BUILTIN_TYPEDARRAY
-#define JERRY_BUILTIN_TYPEDARRAY JERRY_ESNEXT
+#define JERRY_BUILTIN_TYPEDARRAY JERRY_BUILTINS
#endif /* !defined (JERRY_BUILTIN_TYPEDARRAY) */
#ifndef JERRY_BUILTIN_SHAREDARRAYBUFFER
-#define JERRY_BUILTIN_SHAREDARRAYBUFFER JERRY_ESNEXT
+#define JERRY_BUILTIN_SHAREDARRAYBUFFER JERRY_BUILTINS
#endif /* !defined (JERRY_BUILTIN_SHAREDARRAYBUFFER) */
#ifndef JERRY_BUILTIN_ATOMICS
-#define JERRY_BUILTIN_ATOMICS JERRY_ESNEXT
+#define JERRY_BUILTIN_ATOMICS JERRY_BUILTINS
#endif /* !defined (JERRY_BUILTIN_ATOMICS) */
#ifndef JERRY_BUILTIN_WEAKREF
-#define JERRY_BUILTIN_WEAKREF JERRY_ESNEXT
+#define JERRY_BUILTIN_WEAKREF JERRY_BUILTINS
#endif /* !defined (JERRY_BUILTIN_WEAKREF) */
#ifndef JERRY_MODULE_SYSTEM
-#define JERRY_MODULE_SYSTEM JERRY_ESNEXT
+#define JERRY_MODULE_SYSTEM JERRY_BUILTINS
#endif /* !defined (JERRY_MODULE_SYSTEM) */
/**
@@ -541,13 +534,6 @@
#if (JERRY_BUILTINS != 0) && (JERRY_BUILTINS != 1)
#error "Invalid value for JERRY_BUILTINS macro."
#endif /* (JERRY_BUILTINS != 0) && (JERRY_BUILTINS != 1) */
-
-/**
- * Check ES2015+ features
- */
-#if (JERRY_ESNEXT != 0) && (JERRY_ESNEXT != 1)
-#error "Invalid value for JERRY_ESNEXT macro."
-#endif /* (JERRY_ESNEXT != 0) && (JERRY_ESNEXT != 1) */
#if (JERRY_BUILTIN_REALMS != 0) && (JERRY_BUILTIN_REALMS != 1)
#error "Invalid value for JERRY_BUILTIN_REALMS macro."
#endif /* (JERRY_BUILTIN_REALMS != 0) && (JERRY_BUILTIN_REALMS != 1) */
@@ -581,27 +567,6 @@
#if (JERRY_MODULE_SYSTEM != 0) && (JERRY_MODULE_SYSTEM != 1)
#error "Invalid value for JERRY_MODULE_SYSTEM macro."
#endif /* (JERRY_MODULE_SYSTEM != 0) && (JERRY_MODULE_SYSTEM != 1) */
-#if (JERRY_ESNEXT == 0) && (JERRY_BUILTIN_DATAVIEW == 1)
-#error "JERRY_ESNEXT should be enabled too to enable JERRY_BUILTIN_DATAVIEW macro."
-#endif /* (JERRY_ESNEXT == 0) && (JERRY_BUILTIN_DATAVIEW == 1) */
-#if (JERRY_ESNEXT == 0) && (JERRY_BUILTIN_CONTAINER == 1)
-#error "JERRY_ESNEXT should be enabled too to enable JERRY_BUILTIN_CONTAINER macro."
-#endif /* (JERRY_ESNEXT == 0) && (JERRY_BUILTIN_CONTAINER == 1) */
-#if (JERRY_ESNEXT == 0) && (JERRY_BUILTIN_PROXY == 1)
-#error "JERRY_ESNEXT should be enabled too to enable JERRY_BUILTIN_PROXY macro."
-#endif /* (JERRY_ESNEXT == 0) && (JERRY_BUILTIN_PROXY == 1) */
-#if (JERRY_ESNEXT == 0) && (JERRY_BUILTIN_REFLECT == 1)
-#error "JERRY_ESNEXT should be enabled too to enable JERRY_BUILTIN_REFLECT macro."
-#endif /* (JERRY_ESNEXT == 0) && (JERRY_BUILTIN_REFLECT == 1) */
-#if (JERRY_ESNEXT == 0) && (JERRY_BUILTIN_TYPEDARRAY == 1)
-#error "JERRY_ESNEXT should be enabled too to enable JERRY_BUILTIN_TYPEDARRAY macro."
-#endif /* (JERRY_ESNEXT == 0) && (JERRY_BUILTIN_TYPEDARRAY == 1) */
-#if (JERRY_ESNEXT == 0) && (JERRY_BUILTIN_WEAKREF == 1)
-#error "JERRY_ESNEXT should be enabled too to enable JERRY_BUILTIN_WEAKREF macro."
-#endif /* (JERRY_ESNEXT == 0) && (JERRY_BUILTIN_WEAKREF == 1) */
-#if (JERRY_ESNEXT == 0) && (JERRY_MODULE_SYSTEM == 1)
-#error "JERRY_ESNEXT should be enabled too to enable JERRY_MODULE_SYSTEM macro."
-#endif /* (JERRY_ESNEXT == 0) && (JERRY_MODULE_SYSTEM == 1) */
#if (JERRY_BUILTIN_TYPEDARRAY == 0) && (JERRY_BUILTIN_SHAREDARRAYBUFFER == 1)
#error "JERRY_BUILTIN_TYPEDARRAY should be enabled too to enable JERRY_BUILTIN_SHAREDARRAYBUFFER macro."
#endif /* (JERRY_BUILTIN_TYPEDARRAY == 0) && (JERRY_BUILTIN_SHAREDARRAYBUFFER == 1) */
@@ -709,13 +674,6 @@
#endif /* JERRY_BUILTIN_DATE && !JERRY_NUMBER_TYPE_FLOAT64 */
/**
- * Promise support must be enabled if Promise callback support is enabled.
- */
-#if JERRY_PROMISE_CALLBACK && !JERRY_ESNEXT
-#error "Promise callback support depends on ESNext support"
-#endif /* JERRY_PROMISE_CALLBACK && !JERRY_ESNEXT */
-
-/**
* Source name related types into a single guard
*/
#if JERRY_LINE_INFO || JERRY_ERROR_MESSAGES || JERRY_MODULE_SYSTEM
diff --git a/jerry-core/debugger/debugger.c b/jerry-core/debugger/debugger.c
index d7c310c4..2d77f883 100644
--- a/jerry-core/debugger/debugger.c
+++ b/jerry-core/debugger/debugger.c
@@ -1445,13 +1445,11 @@ jerry_debugger_exception_object_to_string (ecma_value_t exception_obj_value) /**
string_id = LIT_MAGIC_STRING_TYPE_ERROR_UL;
break;
}
-#if JERRY_ESNEXT
case ECMA_BUILTIN_ID_AGGREGATE_ERROR_PROTOTYPE:
{
string_id = LIT_MAGIC_STRING_AGGREGATE_ERROR_UL;
break;
}
-#endif /* JERRY_ESNEXT */
case ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE:
{
string_id = LIT_MAGIC_STRING_URI_ERROR_UL;
diff --git a/jerry-core/ecma/base/ecma-error-messages.inc.h b/jerry-core/ecma/base/ecma-error-messages.inc.h
index b131911a..7711f871 100644
--- a/jerry-core/ecma/base/ecma-error-messages.inc.h
+++ b/jerry-core/ecma/base/ecma-error-messages.inc.h
@@ -36,12 +36,10 @@ ECMA_ERROR_DEF (ECMA_ERR_INVALID_ENCODING, "Invalid encoding")
ECMA_ERROR_DEF (ECMA_ERR_NOTHING_TO_REPEAT, "Nothing to repeat")
#endif /* JERRY_BUILTIN_REGEXP */
ECMA_ERROR_DEF (ECMA_ERR_EXPECTED_AN_OBJECT, "Expected an object")
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVALID_CAPABILITY, "Invalid capability")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
+#if JERRY_BUILTIN_STRING
ECMA_ERROR_DEF (ECMA_ERR_INVALID_CODE_POINT, "Invalid code point")
-#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_STRING */
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_INVALID_QUANTIFIER, "Invalid quantifier")
#endif /* JERRY_BUILTIN_REGEXP */
@@ -56,9 +54,9 @@ ECMA_ERROR_DEF (ECMA_ERR_EXPECTED_A_FUNCTION, "Expected a function")
ECMA_ERROR_DEF (ECMA_ERR_INVALID_JSON_FORMAT, "Invalid JSON format")
#endif /* JERRY_BUILTIN_JSON */
ECMA_ERROR_DEF (ECMA_ERR_INVALID_UTF8_STRING, "Invalid UTF8 string")
-#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
+#if JERRY_BUILTIN_STRING
ECMA_ERROR_DEF (ECMA_ERR_INVALID_COUNT_VALUE, "Invalid count value")
-#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_STRING */
#if !(JERRY_BUILTIN_REALMS)
ECMA_ERROR_DEF (ECMA_ERR_REALMS_ARE_DISABLED, "Realms are disabled")
#endif /* !(JERRY_BUILTIN_REALMS) */
@@ -80,9 +78,9 @@ ECMA_ERROR_DEF (ECMA_ERR_TARGET_IS_NOT_OBJECT, "Target is not Object")
ECMA_ERROR_DEF (ECMA_ERR_BIGINT_VALUE_EXCPECTED, "BigInt value expected")
#endif /* JERRY_BUILTIN_BIGINT */
ECMA_ERROR_DEF (ECMA_ERR_BINDING_CANNOT_SET, "Binding cannot be set")
-#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
+#if JERRY_BUILTIN_STRING
ECMA_ERROR_DEF (ECMA_ERR_INVALID_STRING_, "Invalid string length")
-#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_STRING */
#if JERRY_BUILTIN_CONTAINER
ECMA_ERROR_DEF (ECMA_ERR_KEY_MUST_BE_AN_OBJECT, "Key must be an object")
#endif /* JERRY_BUILTIN_CONTAINER */
@@ -95,9 +93,9 @@ ECMA_ERROR_DEF (ECMA_ERR_TARGET_IS_NOT_WEAKREF, "Target is not weakRef")
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TARGET_NOT_EXTENSIBLE, "Target not extensible")
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB
+#if JERRY_BUILTIN_ANNEXB
ECMA_ERROR_DEF (ECMA_ERR_GETTER_IS_NOT_CALLABLE, "Getter is not callable")
-#endif /* JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB */
+#endif /* JERRY_BUILTIN_ANNEXB */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_HANDLER_CANNOT_BE_NULL, "Handler cannot be null")
#endif /* JERRY_BUILTIN_PROXY */
@@ -119,19 +117,19 @@ ECMA_ERROR_DEF (ECMA_ERR_REALM_IS_NOT_AVAILABLE, "Realm is not available")
ECMA_ERROR_DEF (ECMA_ERR_BIGINT_ZERO_DIVISION, "BigInt division by zero")
#endif /* JERRY_BUILTIN_BIGINT */
ECMA_ERROR_DEF (ECMA_ERR_EXPECTED_AN_ARRAYBUFFER, "Expected an ArrayBuffer")
-#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT
+#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_INVALID_CHARACTER_CLASS, "Invalid character class")
ECMA_ERROR_DEF (ECMA_ERR_INVALID_ESCAPE_SEQUENCE, "Invalid escape sequence")
-#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_SNAPSHOT_EXEC
ECMA_ERROR_DEF (ECMA_ERR_INVALID_SNAPSHOT_FORMAT, "Invalid snapshot format")
#endif /* JERRY_SNAPSHOT_EXEC */
#if JERRY_BUILTIN_JSON
ECMA_ERROR_DEF (ECMA_ERR_JSON_STRING_PARSE_ERROR, "JSON string parse error")
#endif /* JERRY_BUILTIN_JSON */
-#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT
+#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_LONE_QUANTIFIER_BRACKET, "Lone quantifier bracket")
-#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_OBJECT_CANNOT_BE_FROZEN, "Object cannot be frozen")
ECMA_ERROR_DEF (ECMA_ERR_OBJECT_CANNOT_BE_SEALED, "Object cannot be sealed")
@@ -145,24 +143,18 @@ ECMA_ERROR_DEF (ECMA_ERR_UNMATCHED_CLOSE_BRACKET, "Unmatched close bracket")
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_NOT_MODULE, "Argument is not a module")
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_SET_PROTOTYPE, "Cannot set [[Prototype]]")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_ARRAY && JERRY_ESNEXT
+#if JERRY_BUILTIN_ARRAY
ECMA_ERROR_DEF (ECMA_ERR_INVALID_NEW_ARRAY_LENGTH, "Invalid new Array length")
-#endif /* JERRY_BUILTIN_ARRAY && JERRY_ESNEXT */
-#if JERRY_ESNEXT
+#endif /* JERRY_BUILTIN_ARRAY */
ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_IS_NOT_CALLABLE, "Iterator is not callable")
-#endif /* JERRY_ESNEXT */
#if !(JERRY_BUILTIN_JSON)
ECMA_ERROR_DEF (ECMA_ERR_JSON_NOT_SUPPORTED, "JSON support is disabled")
#endif /* !(JERRY_BUILTIN_JSON) */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_MODULE_IS_IN_ERROR_STATE, "Module is in error state")
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_REJECT_MUST_BE_UNDEFINED, "Reject must be undefined")
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_REQUEST_IS_NOT_AVAILABLE, "Request is not available")
#endif /* JERRY_MODULE_SYSTEM */
@@ -170,17 +162,15 @@ ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_IS_NOT_AN_OBJECT, "Argument is not an object")
#if JERRY_BUILTIN_ATOMICS
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_NOT_SUPPORTED, "Argument is not supported")
#endif /* JERRY_BUILTIN_ATOMICS */
-#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
+#if JERRY_BUILTIN_STRING
ECMA_ERROR_DEF (ECMA_ERR_INVALID_CODE_POINT_ERROR, "Error: Invalid code point")
-#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_STRING */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_INVALID_TYPEDARRAY_LENGTH, "Invalid TypedArray length")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
ECMA_ERROR_DEF (ECMA_ERR_INVALID_HEXADECIMAL_VALUE, "Invalid hexadecimal value")
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_IS_NOT_AN_OBJECT, "Iterator is not an object")
ECMA_ERROR_DEF (ECMA_ERR_RESOLVE_MUST_BE_UNDEFINED, "Resolve must be undefined")
-#endif /* JERRY_ESNEXT */
#if JERRY_SNAPSHOT_SAVE
ECMA_ERROR_DEF (ECMA_ERR_SNAPSHOT_BUFFER_SMALL, "Snapshot buffer too small")
#endif /* JERRY_SNAPSHOT_SAVE */
@@ -209,37 +199,22 @@ ECMA_ERROR_DEF (ECMA_ERR_MODULE_NOT_SUPPORTED, "Module support is disabled")
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_OBJECT_IS_NOT_A_TYPEDARRAY, "Object is not a TypedArray")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_RECEIVER_MUST_BE_AN_OBJECT, "Receiver must be an object")
-#endif /* JERRY_ESNEXT */
-#if !(JERRY_ESNEXT)
-ECMA_ERROR_DEF (ECMA_ERR_SYMBOL_NOT_SUPPORTED, "Symbol support is disabled")
-#endif /* !(JERRY_ESNEXT) */
#if JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_JSON
ECMA_ERROR_DEF (ECMA_ERR_BIGINT_SERIALIZED, "BigInt cannot be serialized")
#endif /* JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_JSON */
#if JERRY_BUILTIN_CONTAINER
ECMA_ERROR_DEF (ECMA_ERR_CONTAINER_IS_NOT_AN_OBJECT, "Container is not an object.")
#endif /* JERRY_BUILTIN_CONTAINER */
-#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT
+#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_INVALID_HEX_ESCAPE_SEQUENCE, "Invalid hex escape sequence")
-#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */
-#if JERRY_ESNEXT
+#endif /* JERRY_BUILTIN_REGEXP */
ECMA_ERROR_DEF (ECMA_ERR_INVALID_SPECIES_CONSTRUCTOR, "Invalid species constructor")
-#endif /* JERRY_ESNEXT */
-#if !(JERRY_ESNEXT)
-ECMA_ERROR_DEF (ECMA_ERR_PROMISE_NOT_SUPPORTED, "Promise support is disabled")
-#endif /* !(JERRY_ESNEXT) */
-#if JERRY_BUILTIN_PROXY || JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_PROXY_TRAP_RETURNED_FALSISH, "Proxy trap returned falsish")
-#endif /* JERRY_BUILTIN_PROXY \
-|| JERRY_ESNEXT */
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_MIN_GREATER_THAN_MAX, "Quantifier error: min > max")
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_SYMBOL_IS_NOT_A_CONSTRUCTOR, "Symbol is not a constructor")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_REFLECT
ECMA_ERROR_DEF (ECMA_ERR_TARGET_IS_NOT_A_CONSTRUCTOR, "Target is not a constructor")
#endif /* JERRY_BUILTIN_REFLECT */
@@ -250,21 +225,13 @@ ECMA_ERROR_DEF (ECMA_ERR_DATA_VIEW_NOT_SUPPORTED, "DataView support is disabled"
#if JERRY_BUILTIN_DATE
ECMA_ERROR_DEF (ECMA_ERR_DATE_MUST_BE_A_FINITE_NUMBER, "Date must be a finite number")
#endif /* JERRY_BUILTIN_DATE */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_LOCAL_VARIABLE_IS_REDECLARED, "Local variable is redeclared")
-#endif /* JERRY_ESNEXT */
ECMA_ERROR_DEF (ECMA_ERR_UNSUPPORTED_BINARY_OPERATION, "Unsupported binary operation")
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_UNTERMINATED_CHARACTER_CLASS, "Unterminated character class")
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_BUILTIN_DATAVIEW || JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ARRAYBUFFER_IS_DETACHED, "ArrayBuffer has been detached")
-#endif /* JERRY_BUILTIN_DATAVIEW \
-|| JERRY_BUILTIN_TYPEDARRAY \
-|| JERRY_ESNEXT */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_NOT_AN_OBJECT, "Constructor must be an object")
-#endif /* JERRY_ESNEXT */
#if !(JERRY_BUILTIN_CONTAINER)
ECMA_ERROR_DEF (ECMA_ERR_CONTAINER_NOT_SUPPORTED, "Container support is disabled")
#endif /* !(JERRY_BUILTIN_CONTAINER) */
@@ -277,18 +244,14 @@ ECMA_ERROR_DEF (ECMA_ERR_INCOMPATIBLE_TYPEDARRAY_TYPES, "Incompatible TypedArray
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_INCORRECT_TYPE_FOR_TYPEDARRAY, "Incorrect type for TypedArray")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVALID_OR_OUT_OF_RANGE_INDEX, "Invalid or out-of-range index")
-#endif /* JERRY_ESNEXT */
#if JERRY_SNAPSHOT_SAVE
ECMA_ERROR_DEF (ECMA_ERR_MAXIMUM_SNAPSHOT_SIZE, "Maximum snapshot size reached")
#endif /* JERRY_SNAPSHOT_SAVE */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_MODULE_CANNOT_BE_INSTANTIATED, "Module cannot be instantiated")
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_SPECIES_MUST_BE_A_CONSTRUCTOR, "Species must be a constructor")
-#endif /* JERRY_ESNEXT */
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_IS_NOT_A_PROXY, "Argument is not a Proxy object")
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_NOT_ARRAY_BUFFER, "Argument is not an ArrayBuffer")
@@ -302,9 +265,7 @@ ECMA_ERROR_DEF (ECMA_ERR_MODULE_MUST_BE_IN_LINKED_STATE, "Module must be in link
ECMA_ERROR_DEF (ECMA_ERR_UNKNOWN_EXPORT, "Native module export not found")
#endif /* JERRY_MODULE_SYSTEM */
ECMA_ERROR_DEF (ECMA_ERR_PASSED_ARGUMENT_IS_NOT_A_REALM, "Passed argument is not a realm")
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_PRIVATE_METHOD_IS_NOT_WRITABLE, "Private method is not writable")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT || JERRY_BUILTIN_NUMBER
ECMA_ERROR_DEF (ECMA_ERR_RADIX_IS_OUT_OF_RANGE, "Radix must be between 2 and 36")
#endif /* JERRY_BUILTIN_BIGINT \
@@ -316,15 +277,13 @@ ECMA_ERROR_DEF (ECMA_ERR_SNAPSHOT_EXEC_DISABLED, "Snapshot execution is disabled
ECMA_ERROR_DEF (ECMA_ERR_TYPED_ARRAY_NOT_SUPPORTED, "TypedArray support is disabled")
#endif /* !(JERRY_BUILTIN_TYPEDARRAY) */
ECMA_ERROR_DEF (ECMA_ERR_UNICODE_SURROGATE_PAIR_MISSING, "Unicode surrogate pair missing")
-#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT
+#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_INVALID_CONTROL_ESCAPE_SEQUENCE, "Invalid control escape sequence")
ECMA_ERROR_DEF (ECMA_ERR_INVALID_UNICODE_ESCAPE_SEQUENCE, "Invalid unicode escape sequence")
-#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */
-#if JERRY_ESNEXT
+#endif /* JERRY_BUILTIN_REGEXP */
ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_NEXT_IS_NOT_CALLABLE, "Iterator 'next' is not callable")
ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_VALUE_IS_NOT_AN_OBJECT, "Iterator value is not an object")
ECMA_ERROR_DEF (ECMA_ERR_RESOLVE_METHOD_MUST_BE_CALLABLE, "Resolve method must be callable")
-#endif /* JERRY_ESNEXT */
#if !(JERRY_SNAPSHOT_SAVE)
ECMA_ERROR_DEF (ECMA_ERR_SNAPSHOT_SAVE_DISABLED, "Snapshot generation is disabled")
#endif /* !(JERRY_SNAPSHOT_SAVE) */
@@ -337,20 +296,14 @@ ECMA_ERROR_DEF (ECMA_ERR_TRAP_MUST_RETURN_WITH_AN_OBJECT, "Trap must return with
#if JERRY_BUILTIN_CONTAINER
ECMA_ERROR_DEF (ECMA_ERR_UNSUPPORTED_CONTAINER_OPERATION, "Unsupported container operation")
#endif /* JERRY_BUILTIN_CONTAINER */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_METHOD_RETURN_IS_NOT_CALLABLE, "method 'return' is not callable")
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_PROMISE, "Argument 'this' is not a Promise")
-#endif /* JERRY_ESNEXT */
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT, "Argument 'this' is not an object")
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_SYMBOL, "Argument 'this' must be a Symbol")
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_CALLBACK_RESULT_NOT_MODULE, "Callback result must be a module")
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CLASS_CONSTRUCTOR_REQUIRES_NEW, "Class constructor requires 'new'")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_ARRAY
ECMA_ERROR_DEF (ECMA_ERR_COMPARE_FUNC_NOT_CALLABLE, "Compare function is not callable")
#endif /* JERRY_BUILTIN_ARRAY */
@@ -358,21 +311,15 @@ ECMA_ERROR_DEF (ECMA_ERR_COMPARE_FUNC_NOT_CALLABLE, "Compare function is not cal
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_PROXY_REQUIRES_NEW, "Constructor Proxy requires 'new'")
#endif /* JERRY_BUILTIN_PROXY */
ECMA_ERROR_DEF (ECMA_ERR_EXPECTED_A_CONFIGURABLE_PROPERTY, "Expected a configurable property")
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_FIRST_PARAMETER_MUST_BE_CALLABLE, "First parameter must be callable")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_CONTAINER && JERRY_ESNEXT
+#if JERRY_BUILTIN_CONTAINER
ECMA_ERROR_DEF (ECMA_ERR_FUNCTION_ADD_ORSET_IS_NOT_CALLABLE, "Function add/set is not callable")
-#endif /* JERRY_BUILTIN_CONTAINER && JERRY_ESNEXT */
-#if JERRY_ESNEXT
+#endif /* JERRY_BUILTIN_CONTAINER */
ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_RESULT_IS_NOT_AN_OBJECT, "Iterator result is not an object")
-#endif /* JERRY_ESNEXT */
#if (JERRY_STACK_LIMIT != 0)
ECMA_ERROR_DEF (ECMA_ERR_MAXIMUM_CALL_STACK_SIZE_EXCEEDED, "Maximum call stack size exceeded")
#endif /* (JERRY_STACK_LIMIT != 0) */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_MAXIMUM_STRING_LENGTH_IS_REACHED, "Maximum string length is reached")
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_MODULE_MUST_BE_IN_UNLINKED_STATE, "Module must be in unlinked state")
#endif /* JERRY_MODULE_SYSTEM */
@@ -398,9 +345,7 @@ ECMA_ERROR_DEF (ECMA_ERR_INITIAL_VALUE_CANNOT_BE_UNDEFINED, "Initial value canno
ECMA_ERROR_DEF (ECMA_ERR_INVALID_SHARED_ARRAYBUFFER_LENGTH, "Invalid Shared ArrayBuffer length")
#endif /* JERRY_BUILTIN_SHAREDARRAYBUFFER */
ECMA_ERROR_DEF (ECMA_ERR_INVALID_TYPE_FOR_CONSTRUCTOR_CALL, "Invalid type for constructor call")
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_THROW_IS_NOT_AVAILABLE, "Iterator 'throw' is not available")
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_NAMESPACE_OBJECT_IS_NOT_AVAILABLE, "Namespace object is not available")
#endif /* JERRY_MODULE_SYSTEM */
@@ -413,13 +358,9 @@ ECMA_ERROR_DEF (ECMA_ERR_SECOND_ARGUMENT_MUST_BE_AN_OBJECT, "Second argument mus
#if JERRY_BUILTIN_DATAVIEW
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_BUFFER_NOT_OBJECT, "Argument 'buffer' is not an object")
#endif /* JERRY_BUILTIN_DATAVIEW */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_ITERATOR, "Argument 'this' is not an iterator")
-#endif /* JERRY_ESNEXT */
ECMA_ERROR_DEF (ECMA_ERR_VALUE_MSG, "Argument cannot be marked as error")
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_PROMISE_REQUIRES_NEW, "Constructor Promise requires 'new'")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_CONTAINER
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_WEAKMAP_REQUIRES_NEW, "Constructor WeakMap requires 'new'")
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_WEAKSET_REQUIRES_NEW, "Constructor WeakSet requires 'new'")
@@ -430,39 +371,30 @@ ECMA_ERROR_DEF (ECMA_ERR_INVALID_SCOPE_CHAIN_INDEX_FOR_EVAL, "Invalid scope chai
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_MAXIMUM_TYPEDARRAY_SIZE_IS_REACHED, "Maximum TypedArray size is reached")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_THE_GIVEN_ARGUMENT_IS_NOT_A_SYMBOL, "The given argument is not a Symbol")
ECMA_ERROR_DEF (ECMA_ERR_PARAMETER_REJECT_MUST_BE_CALLABLE, "'reject' parameter must be callable")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT
+#if JERRY_BUILTIN_ATOMICS || JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_TYPED_ARRAY, "Argument 'this' is not a TypedArray")
-#endif /* JERRY_BUILTIN_TYPEDARRAY \
-|| JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_ATOMICS \
+|| JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_SNAPSHOT_SAVE
ECMA_ERROR_DEF (ECMA_ERR_CANNOT_ALLOCATE_MEMORY_LITERALS, "Cannot allocate memory for literals")
#endif /* JERRY_SNAPSHOT_SAVE */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVOKE_NULLABLE_SUPER_METHOD, "Cannot invoke nullable super method")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_DATAVIEW
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_DATAVIEW_REQUIRES_NEW, "Constructor DataView requires 'new'")
#endif /* JERRY_BUILTIN_DATAVIEW */
#if JERRY_BUILTIN_WEAKREF
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_WEAKREF_REQUIRES_NEW, "Constructor WeakRef requires 'new'.")
#endif /* JERRY_BUILTIN_WEAKREF */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_SUPER_BINDING_MUST_BE_A_CONSTRUCTOR, "Super binding must be a constructor")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_VALUE_CANNOT_BE_CONVERTED_TO_BIGINT, "Value cannot be converted to BigInt")
#endif /* JERRY_BUILTIN_BIGINT */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_PARAMETER_RESOLVE_MUST_BE_CALLABLE, "'resolve' parameter must be callable")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_DATE || JERRY_ESNEXT
+#if JERRY_BUILTIN_DATE
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_DATE_OBJECT, "Argument 'this' is not a Date object")
-#endif /* JERRY_BUILTIN_DATE \
-|| JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_DATE */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_CONSTRUCTOR, "Argument 'this' is not a constructor")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
@@ -476,19 +408,16 @@ ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_INT8_ARRAY_REQUIRES_NEW, "Constructor Int8A
#if JERRY_BUILTIN_CONTAINER
ECMA_ERROR_DEF (ECMA_ERR_CONTAINER_IS_NOT_A_CONTAINER_OBJECT, "Container is not a container object.")
#endif /* JERRY_BUILTIN_CONTAINER */
-#if JERRY_BUILTIN_DATE && JERRY_ESNEXT
+#if JERRY_BUILTIN_DATE
ECMA_ERROR_DEF (ECMA_ERR_INVALID_ARGUMENT_TYPE_IN_TOPRIMITIVE, "Invalid argument type in toPrimitive")
-#endif /* JERRY_BUILTIN_DATE && JERRY_ESNEXT */
-#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT
+#endif /* JERRY_BUILTIN_DATE */
+#if JERRY_ERROR_MESSAGES
ECMA_ERROR_DEF (ECMA_ERR_METHODS_INVOKE_WITH_NEW, "Methods cannot be invoked with 'new'")
-#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */
+#endif /* JERRY_ERROR_MESSAGES */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_MODULE_EXPORTS_MUST_BE_STRING_VALUES, "Module exports must be string values")
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_BUILTIN_REFLECT || JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_PROTOTYPE_IS_NEITHER_OBJECT_NOR_NULL, "Prototype is neither object nor null")
-#endif /* JERRY_BUILTIN_REFLECT \
-|| JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_THE_MAPFN_ARGUMENT_IS_NOT_CALLABLE, "The 'mapfn' argument is not callable")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
@@ -529,38 +458,26 @@ ECMA_ERROR_DEF (ECMA_ERR_TRAP_WITH_DUPLICATED_ENTRIES, "Trap returned with dupli
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_UNARY_PLUS_IS_NOT_ALLOWED_FOR_BIGINTS, "Unary plus is not allowed for BigInts")
#endif /* JERRY_BUILTIN_BIGINT */
-#if !JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB && JERRY_BUILTIN_REGEXP || JERRY_BUILTIN_REGEXP && JERRY_ESNEXT
+#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_IS_NOT_AN_REGEXP, "Argument 'this' is not a RegExp object")
-#endif /* !JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB && JERRY_BUILTIN_REGEXP \
-|| JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_ALLOCATE_ARRAY_BUFFER, "Cannot allocate memory for ArrayBuffer")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CONSTANT_BINDINGS_CANNOT_BE_REASSIGNED, "Constant bindings cannot be reassigned")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_ARRAYBUFFER_REQUIRES_NEW, "Constructor ArrayBuffer requires 'new'")
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_UINT16_ARRAY_REQUIRES_NEW, "Constructor Uint16Array requires 'new'")
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_UINT32_ARRAY_REQUIRES_NEW, "Constructor Uint32Array requires 'new'")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_GENERATOR_IS_CURRENTLY_UNDER_EXECUTION, "Generator is currently under execution")
ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_RETURN_RESULT_IS_NOT_OBJECT, "Iterator 'return' result is not object")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_TYPEDARRAY
-ECMA_ERROR_DEF (ECMA_ERR_RETURNED_ARRAYBUFFER_HAS_BEEN_DETACHED, "Returned ArrayBuffer has been detached")
-#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_SEARCH_STRING_CANNOT_BE_OF_TYPE_REGEXP, "Search string can't be of type: RegExp")
ECMA_ERROR_DEF (ECMA_ERR_VALUE_RECEIVED_BY_YIELD_IS_NOT_OBJECT, "Value received by yield* is not object")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BOOLEAN
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_BOOLEAN_OBJECT, "Argument 'this' is not a Boolean object")
#endif /* JERRY_BUILTIN_BOOLEAN */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CANNOT_DECLARE_SAME_PRIVATE_FIELD_TWICE, "Cannot declare same private field twice")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_FLOAT32_ARRAY_REQUIRES_NEW, "Constructor Float32Array requires 'new'")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
@@ -574,33 +491,27 @@ ECMA_ERROR_DEF (ECMA_ERR_IMPORTED_BINDING_SHADOWS_LOCAL_VARIABLE, "Imported bind
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_PROTOTYPE_FROM_REVOKED_PROXY_IS_INVALID, "Prototype from revoked Proxy is invalid")
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING && JERRY_ESNEXT
+#if JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING
ECMA_ERROR_DEF (ECMA_ERR_REGEXP_ARGUMENT_SHOULD_HAVE_GLOBAL_FLAG, "RegExp argument should have global flag")
-#endif /* JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TRAP_IS_NEITHER_AN_OBJECT_NOR_UNDEFINED, "Trap is neither an object nor undefined")
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_PROMISE_RESOLVE_ITSELF, "A promise cannot be resolved with itself")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_BIGINT64_ARRAY_REQUIRES_NEW, "Constructor BigInt64Array requires 'new'")
#endif /* JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_MODULE_EXPORTS_MUST_BE_VALID_IDENTIFIERS, "Module exports must be valid identifiers")
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_GENERATOR_OBJECT, "Argument 'this' is not a generator object")
-#endif /* JERRY_ESNEXT */
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_CANNOT_CONVERT_TO_OBJECT, "Argument cannot be converted to an object")
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_ALLOCATE_BIGINT_VALUE, "Cannot allocate memory for a BigInt value")
ECMA_ERROR_DEF (ECMA_ERR_CONVERT_BIGINT_TO_NUMBER, "Cannot convert a BigInt value to a number")
#endif /* JERRY_BUILTIN_BIGINT */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CONVERT_SYMBOL_TO_NUMBER, "Cannot convert a Symbol value to a number")
ECMA_ERROR_DEF (ECMA_ERR_CONVERT_SYMBOL_TO_STRING, "Cannot convert a Symbol value to a string")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_BIG_UINT64_ARRAY_REQUIRES_NEW, "Constructor BigUInt64Array requires 'new'")
#endif /* JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY */
@@ -610,21 +521,17 @@ ECMA_ERROR_DEF (ECMA_ERR_FRACTION_DIGITS_OUT_OF_RANGE, "Fraction digits must be
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_RETURN_VALUE_IS_NOT_AN_ARRAYBUFFER_OBJECT, "Return value is not an ArrayBuffer object")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_SUPER_CONSTRUCTOR_MAY_ONLY_BE_CALLED_ONCE, "Super constructor may only be called once")
-#endif /* JERRY_ESNEXT */
ECMA_ERROR_DEF (ECMA_ERR_BINDING_NOT_EXIST_OR_UNINITIALIZED, "Binding does not exist or is uninitialised")
-#if JERRY_BUILTIN_ARRAY && JERRY_ESNEXT
+#if JERRY_BUILTIN_ARRAY
ECMA_ERROR_DEF (ECMA_ERR_CANNOT_CONVERT_TO_OBJECT, "Cannot convert undefined or null to object")
-#endif /* JERRY_BUILTIN_ARRAY && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_ARRAY */
#if JERRY_BUILTIN_NUMBER
ECMA_ERROR_DEF (ECMA_ERR_PRECISION_DIGITS_MUST_BE_BETWEEN_IN_RANGE, "Precision digits must be between 1 and 100")
#endif /* JERRY_BUILTIN_NUMBER */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_PRIVATE_FIELD_WAS_DEFINED_WITHOUT_A_GETTER, "Private field was defined without a getter")
ECMA_ERROR_DEF (ECMA_ERR_PRIVATE_FIELD_WAS_DEFINED_WITHOUT_A_SETTER, "Private field was defined without a setter")
ECMA_ERROR_DEF (ECMA_ERR_PROPERTY_NAME_IS_NEITHER_SYMBOL_NOR_STRING, "Property name is neither Symbol nor string")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_STRING_CANNOT_BE_CONVERTED_TO_BIGINT_VALUE, "String cannot be converted to BigInt value")
#endif /* JERRY_BUILTIN_BIGINT */
@@ -634,16 +541,16 @@ ECMA_ERROR_DEF (ECMA_ERR_INCORRECT_TYPE_CALL, "Operator called on incorrect cont
#if JERRY_BUILTIN_ARRAY
ECMA_ERROR_DEF (ECMA_ERR_REDUCE_OF_EMPTY_ARRAY_WITH_NO_INITIAL_VALUE, "Reduce of empty Array with no initial value")
#endif /* JERRY_BUILTIN_ARRAY */
-#if JERRY_BUILTIN_REGEXP && !(!JERRY_ESNEXT)
+#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_REG_EXP_OBJECT, "Argument 'this' is not a valid RegExp object")
-#endif /* JERRY_BUILTIN_REGEXP && !(!JERRY_ESNEXT) */
+#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_ARRAY_BUFFER_OBJECT, "Argument 'this' is not an ArrayBuffer object")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT
+#if JERRY_ERROR_MESSAGES
ECMA_ERROR_DEF (ECMA_ERR_ARROW_FUNCTIONS_INVOKE_WITH_NEW, "Arrow functions cannot be invoked with 'new'")
ECMA_ERROR_DEF (ECMA_ERR_ASYNC_FUNCTIONS_INVOKE_WITH_NEW, "Async functions cannot be invoked with 'new'")
-#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */
+#endif /* JERRY_ERROR_MESSAGES */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_SET_EXTENSIBLE_PROPERTY, "Cannot set [[Extensible]] property of object")
#endif /* JERRY_BUILTIN_PROXY */
@@ -653,23 +560,16 @@ ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_SHAREDARRAYBUFFER_REQUIRES_NEW, "Constructo
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_UINT8_CLAMPED_ARRAY_REQUIRES_NEW, "Constructor Uint8ClampedArray requires 'new'")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_BUILTIN_BIGINT && JERRY_ESNEXT
+#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_NEGATIVE_EXPONENT_IS_NOT_ALLOWED_FOR_BIGINTS, "Negative exponent is not allowed for BigInts")
-#endif /* JERRY_BUILTIN_BIGINT && JERRY_ESNEXT */
-#if JERRY_ESNEXT
+#endif /* JERRY_BUILTIN_BIGINT */
ECMA_ERROR_DEF (ECMA_ERR_PROMISE_ALL_REMAINING_ELEMENTS_LIMIT_REACHED, "Promise.all remaining elements limit reached")
ECMA_ERROR_DEF (ECMA_ERR_VALUE_RECEIVED_BY_FOR_ASYNC_OF_IS_NOT_OBJECT, "Value received by for-async-of is not object")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_INFINITY_OR_NAN_CANNOT_BE_CONVERTED_TO_BIGINT, "Infinity or NaN cannot be converted to BigInt")
#endif /* JERRY_BUILTIN_BIGINT */
-#if JERRY_BUILTIN_REGEXP && !(JERRY_ESNEXT)
-ECMA_ERROR_DEF (ECMA_ERR_INVALID_ARGUMENT_IS_PASSED_TO_REGEXP_FUNCTION, "Invalid argument is passed to RegExp function")
-#endif /* JERRY_BUILTIN_REGEXP && !(JERRY_ESNEXT) */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_OPERATOR_DELETE_RETURNED_FALSE_IN_STRICT_MODE, "Operator delete returned false in strict mode")
ECMA_ERROR_DEF (ECMA_ERR_PROPERTY_PROTOTYPE_IS_NOT_AN_OBJECT, "Property 'prototype' is not an object or null")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_PROXY_HANDLER_IS_NULL_FOR_ISARRAY_OPERATION, "Proxy handler is null for 'isArray' operation")
#endif /* JERRY_BUILTIN_PROXY */
@@ -680,23 +580,19 @@ ECMA_ERROR_DEF (ECMA_ERR_RIGHT_VALUE_OF_INSTANCEOF_MUST_BE_AN_OBJECT, "Right val
#if JERRY_SNAPSHOT_EXEC
ECMA_ERROR_DEF (ECMA_ERR_STATIC_SNAPSHOTS_CANNOT_BE_COPIED_INTO_MEMORY, "Static snapshots cannot be copied into memory")
#endif /* JERRY_SNAPSHOT_EXEC */
-#if JERRY_ESNEXT && JERRY_SNAPSHOT_SAVE
-ECMA_ERROR_DEF (ECMA_ERR_TAGGED_TEMPLATE_LITERALS, "Unsupported feature: tagged template literals")
-#endif /* JERRY_ESNEXT && JERRY_SNAPSHOT_SAVE */
#if JERRY_SNAPSHOT_SAVE
+ECMA_ERROR_DEF (ECMA_ERR_TAGGED_TEMPLATE_LITERALS, "Unsupported feature: tagged template literals")
ECMA_ERROR_DEF (ECMA_ERR_SNAPSHOT_FLAG_NOT_SUPPORTED, "Unsupported generate snapshot flags specified")
#endif /* JERRY_SNAPSHOT_SAVE */
#if JERRY_SNAPSHOT_EXEC
ECMA_ERROR_DEF (ECMA_ERR_UNSUPPORTED_SNAPSHOT_EXEC_FLAGS_ARE_SPECIFIED, "Unsupported snapshot exec flags are specified")
#endif /* JERRY_SNAPSHOT_EXEC */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_VALUE_FOR_CLASS_HERITAGE_IS_NOT_A_CONSTRUCTOR, "Value for class heritage is not a constructor")
-#endif /* JERRY_ESNEXT */
ECMA_ERROR_DEF (ECMA_ERR_TOO_MANY_ARGUMENTS_DECLARED_FOR_FUNCTION_APPLY,
"Too many arguments declared for Function.apply")
-#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT
+#if JERRY_ERROR_MESSAGES
ECMA_ERROR_DEF (ECMA_ERR_ACCESSOR_FUNCTIONS_INVOKE_WITH_NEW, "Accessor functions cannot be invoked with 'new'")
-#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */
+#endif /* JERRY_ERROR_MESSAGES */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_LINK_TO_MODULE_IN_ERROR_STATE, "Cannot link to a module which is in error state")
#endif /* JERRY_MODULE_SYSTEM */
@@ -711,18 +607,15 @@ ECMA_ERROR_DEF (ECMA_ERR_TYPEDARRAY_INTRINSTIC_DIRECTLY_CALLED, "TypedArray intr
ECMA_ERROR_DEF (ECMA_ERR_UNSIGNED_RIGHT_SHIFT_IS_NOT_ALLOWED_FOR_BIGINTS,
"Unsigned right shift is not allowed for BigInts")
#endif /* JERRY_BUILTIN_BIGINT */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_ASYNC_GENERATOR, "Argument 'this' is not an async generator object")
ECMA_ERROR_DEF (ECMA_ERR_CLASS_EXTENDS_NOT_CONSTRUCTOR, "Class extends value is not a constructor or null")
-#endif /* JERRY_ESNEXT */
-#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT
+#if JERRY_ERROR_MESSAGES
ECMA_ERROR_DEF (ECMA_ERR_GENERATOR_FUNCTIONS_INVOKE_WITH_NEW, "Generator functions cannot be invoked with 'new'")
-#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */
-#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT || JERRY_BUILTIN_REGEXP && !(!JERRY_ESNEXT)
+#endif /* JERRY_ERROR_MESSAGES */
+#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_RETURN_VALUE_OF_EXEC_MUST_BE_AN_OBJECT_OR_NULL,
"Return value of 'exec' must be an object or null")
-#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT \
-|| JERRY_BUILTIN_REGEXP && !(!JERRY_ESNEXT) */
+#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_BUILTIN_DATAVIEW
ECMA_ERROR_DEF (ECMA_ERR_START_OFFSET_IS_OUTSIDE_THE_BOUNDS_OF_THE_BUFFER,
"Start offset is outside the bounds of the buffer")
@@ -730,19 +623,15 @@ ECMA_ERROR_DEF (ECMA_ERR_START_OFFSET_IS_OUTSIDE_THE_BOUNDS_OF_THE_BUFFER,
#if JERRY_BUILTIN_SHAREDARRAYBUFFER
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_SHARED_ARRAY_BUFFER, "Argument 'this' is not a SharedArrayBuffer object")
#endif /* JERRY_BUILTIN_SHAREDARRAYBUFFER */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CLASS_CONSTRUCTOR_NEW, "Class constructor cannot be invoked without 'new'")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_INCORRECT_RETURN_PROXY_GET_TRAP, "Incorrect value is returned by a Proxy 'get' trap")
ECMA_ERROR_DEF (ECMA_ERR_INCORRECT_RETURN_PROXY_SET_TRAP, "Incorrect value is returned by a Proxy 'set' trap")
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CLASS_IS_NON_CONFIGURABLE, "Prototype property of a class is non-configurable")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_ARRAY && JERRY_ESNEXT
+#if JERRY_BUILTIN_ARRAY
ECMA_ERROR_DEF (ECMA_ERR_PUSHING_TOO_HIGH_ELEMENT, "Pushing element over 2**53-1 length is disallowed")
-#endif /* JERRY_BUILTIN_ARRAY && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_ARRAY */
ECMA_ERROR_DEF (ECMA_ERR_THE_REQUESTED_PROPERTY_UPDATE_CANNOT_BE_PERFORMED,
"The requested property update cannot be performed")
#if JERRY_BUILTIN_PROXY
@@ -760,35 +649,33 @@ ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_STRING_OBJECT, "Argument 'this' is no
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_SHARED_ARRAY_BUFFER_OBJECT,
"Argument 'this' is not an SharedArrayBuffer object")
#endif /* JERRY_BUILTIN_SHAREDARRAYBUFFER */
-#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT
+#if JERRY_ERROR_MESSAGES
ECMA_ERROR_DEF (ECMA_ERR_ASYNC_ARROW_FUNCTIONS_INVOKE_WITH_NEW, "Async arrow functions cannot be invoked with 'new'")
-#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */
-#if JERRY_BUILTIN_ARRAY && JERRY_ESNEXT
+#endif /* JERRY_ERROR_MESSAGES */
+#if JERRY_BUILTIN_ARRAY
ECMA_ERROR_DEF (ECMA_ERR_UNSHIFT_TOO_HIGH, "Unshift elements over 2**53-1 length is disallowed")
-#endif /* JERRY_BUILTIN_ARRAY && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_ARRAY */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TRAP_RESULT_NOT_INCLUDE_ALL_NON_CONFIGURABLE_KEYS,
"Trap result did not include all non-configurable keys")
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT
+#if JERRY_ERROR_MESSAGES
ECMA_ERROR_DEF (ECMA_ERR_ASYNC_GENERATOR_FUNCTIONS_INVOKE_WITH_NEW,
"Async generator functions cannot be invoked with 'new'")
-#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */
+#endif /* JERRY_ERROR_MESSAGES */
#if JERRY_BUILTIN_REFLECT
ECMA_ERROR_DEF (ECMA_ERR_REFLECT_EXPECTS_AN_OBJECT_AS_SECOND_ARGUMENT,
"Reflect.construct expects an object as second argument")
#endif /* JERRY_BUILTIN_REFLECT */
-#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT
+#if JERRY_ERROR_MESSAGES
ECMA_ERROR_DEF (ECMA_ERR_SCRIPT_GLOBAL_FUNCTIONS_INVOKE_WITH_NEW,
"Script (global) functions cannot be invoked with 'new'")
-#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */
+#endif /* JERRY_ERROR_MESSAGES */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_CANNOT_CREATE_PROXY, "Cannot create Proxy with a non-object target or handler")
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_DERIVED_CTOR_RETURN_NOR_OBJECT_OR_UNDEFINED,
"Derived constructors may only return object or undefined")
-#endif /* JERRY_ESNEXT */
#if JERRY_SNAPSHOT_EXEC
ECMA_ERROR_DEF (ECMA_ERR_INVALID_SNAPSHOT_VERSION_OR_FEATURES,
"Invalid snapshot version or unsupported features present")
@@ -834,18 +721,14 @@ ECMA_ERROR_DEF (ECMA_ERR_TARGET_NOT_EXTENSIBLE_DIFFERENT_PROTOTYPE_RETURNED,
ECMA_ERROR_DEF (ECMA_ERR_TRAP_TRUISH_ADDING_PROPERTY_NON_EXTENSIBLE_TARGET,
"Trap returned truish for adding property to the non-extensible target")
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CANNOT_READ_PRIVATE_MEMBER_TO_AN_OBJECT_WHOSE_CLASS_DID_NOT_DECLARE_IT,
"Cannot read private member to an object whose class did not declare it")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_GIVEN_PROPERTY_IS_A_NON_CONFIGURABLE,
"Given property is a non-configurable data property on the proxy target")
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CANNOT_WRITE_PRIVATE_MEMBER_TO_AN_OBJECT_WHOSE_CLASS_DID_NOT_DECLARE_IT,
"Cannot write private member to an object whose class did not declare it")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TRAP_FALSISH_PROPERTY_TARGET_NOT_EXTENSIBLE,
"Trap returned falsish for property but the proxy target is not extensible")
@@ -854,11 +737,8 @@ ECMA_ERROR_DEF (ECMA_ERR_PROXY_PROPERTY_NOT_CONFIGURABLE_NOT_HAVE_GETTER,
ECMA_ERROR_DEF (ECMA_ERR_TARGET_PROPERTY_CONFIGURE_ACCESSOR_WITHOUT_SETTER,
"The property of a Proxy target is a non configurable accessor without a setter")
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_ESNEXT || JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_LET_CONST_NOT_INITIALIZED,
"Variables declared by let/const must be initialized before reading their value")
-#endif /* JERRY_ESNEXT \
-|| JERRY_MODULE_SYSTEM */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TRAP_TRUISH_PROPERTY_NON_CONFIGURABLE,
"Trap returned truish for property which is non-configurable in the proxy target")
@@ -867,10 +747,8 @@ ECMA_ERROR_DEF (ECMA_ERR_TARGET_NOT_EXTENSIBLE_NOT_RETURNED_ITS_PROTOTYPE,
ECMA_ERROR_DEF (ECMA_ERR_TRAP_FALSISH_PROPERTY_NON_CONFIGURABLE,
"Trap returned falsish for property which exists in the proxy target as non-configurable")
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CALL_SUPER_CONSTRUCTOR_DERIVED_CLASS_BEFORE_THIS,
"Must call super constructor in derived class before accessing 'this' or returning from it")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TRAP_TRUISH_DEFINING_NON_EXISTENT_PROPERTY,
"Trap returned truish for defining non-configurable property which is non-existent in the target")
diff --git a/jerry-core/ecma/base/ecma-error-messages.ini b/jerry-core/ecma/base/ecma-error-messages.ini
index d368ad9b..c2d7031a 100644
--- a/jerry-core/ecma/base/ecma-error-messages.ini
+++ b/jerry-core/ecma/base/ecma-error-messages.ini
@@ -130,7 +130,6 @@ ECMA_ERR_INVALID_UTF8_CODEPOINT = "Invalid UTF8 codepoint"
ECMA_ERR_INVALID_UTF8_STRING = "Invalid UTF8 string"
ECMA_ERR_INVALID_ENCODING = "Invalid encoding"
ECMA_ERR_INVALID_ARGUMENT = "Invalid argument"
-ECMA_ERR_INVALID_ARGUMENT_IS_PASSED_TO_REGEXP_FUNCTION = "Invalid argument is passed to RegExp function"
ECMA_ERR_INVALID_ARGUMENT_TYPE_IN_TOPRIMITIVE = "Invalid argument type in toPrimitive"
ECMA_ERR_INVALID_CAPABILITY = "Invalid capability"
ECMA_ERR_INVALID_CHARACTER_CLASS = "Invalid character class"
@@ -213,7 +212,6 @@ ECMA_ERR_RESOLVE_MUST_BE_UNDEFINED = "Resolve must be undefined"
ECMA_ERR_RESULT_OF_DEFAULTVALUE_IS_INVALID = "Result of [[DefaultValue]] is invalid"
ECMA_ERR_RETURN_VALUE_IS_NOT_AN_ARRAYBUFFER_OBJECT = "Return value is not an ArrayBuffer object"
ECMA_ERR_RETURN_VALUE_OF_EXEC_MUST_BE_AN_OBJECT_OR_NULL = "Return value of 'exec' must be an object or null"
-ECMA_ERR_RETURNED_ARRAYBUFFER_HAS_BEEN_DETACHED = "Returned ArrayBuffer has been detached"
ECMA_ERR_RIGHT_VALUE_OF_IN_MUST_BE_AN_OBJECT = "Right value of 'in' must be an object"
ECMA_ERR_RIGHT_VALUE_OF_INSTANCEOF_MUST_BE_AN_OBJECT = "Right value of 'instanceof' must be an object"
ECMA_ERR_SEARCH_STRING_CANNOT_BE_OF_TYPE_REGEXP = "Search string can't be of type: RegExp"
@@ -279,8 +277,6 @@ ECMA_ERR_VALUE_MSG = "Argument cannot be marked as error"
ECMA_ERR_WRONG_ARGS_MSG = "This type of argument is not allowed"
ECMA_ERR_PARSER_NOT_SUPPORTED = "Source code parsing is disabled"
ECMA_ERR_JSON_NOT_SUPPORTED = "JSON support is disabled"
-ECMA_ERR_SYMBOL_NOT_SUPPORTED = "Symbol support is disabled"
-ECMA_ERR_PROMISE_NOT_SUPPORTED = "Promise support is disabled"
ECMA_ERR_TYPED_ARRAY_NOT_SUPPORTED = "TypedArray support is disabled"
ECMA_ERR_SHARED_ARRAYBUFFER_NOT_SUPPORTED = "SharedArrayBuffer support is disabled"
ECMA_ERR_DATA_VIEW_NOT_SUPPORTED = "DataView support is disabled"
diff --git a/jerry-core/ecma/base/ecma-extended-info.c b/jerry-core/ecma/base/ecma-extended-info.c
index 75181612..1dcf3d34 100644
--- a/jerry-core/ecma/base/ecma-extended-info.c
+++ b/jerry-core/ecma/base/ecma-extended-info.c
@@ -19,8 +19,6 @@
#include "byte-code.h"
-#if JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING
-
/** \addtogroup ecma ECMA
* @{
*
@@ -118,7 +116,6 @@ ecma_compiled_code_resolve_extended_info (const ecma_compiled_code_t *bytecode_h
ecma_value_t *base_p = ecma_compiled_code_resolve_arguments_start (bytecode_header_p);
-#if JERRY_ESNEXT
if (CBC_FUNCTION_GET_TYPE (bytecode_header_p->status_flags) != CBC_FUNCTION_CONSTRUCTOR)
{
base_p--;
@@ -128,7 +125,6 @@ ecma_compiled_code_resolve_extended_info (const ecma_compiled_code_t *bytecode_h
{
base_p--;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_LINE_INFO
if (bytecode_header_p->status_flags & CBC_CODE_FLAGS_HAS_LINE_INFO)
@@ -142,8 +138,6 @@ ecma_compiled_code_resolve_extended_info (const ecma_compiled_code_t *bytecode_h
return ((uint8_t *) base_p) - 1;
} /* ecma_compiled_code_resolve_extended_info */
-#endif /* JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING */
-
/**
* @}
* @}
diff --git a/jerry-core/ecma/base/ecma-extended-info.h b/jerry-core/ecma/base/ecma-extended-info.h
index 95fbcab4..57046bd2 100644
--- a/jerry-core/ecma/base/ecma-extended-info.h
+++ b/jerry-core/ecma/base/ecma-extended-info.h
@@ -25,8 +25,6 @@
#include "ecma-globals.h"
-#if JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING
-
/**
* Vlq encoding: flag which is set for all bytes except the last one.
*/
@@ -48,8 +46,6 @@ uint32_t ecma_extended_info_get_encoded_length (uint32_t value);
uint8_t *ecma_compiled_code_resolve_extended_info (const ecma_compiled_code_t *bytecode_header_p);
-#endif /* JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING */
-
/**
* @}
* @}
diff --git a/jerry-core/ecma/base/ecma-gc.c b/jerry-core/ecma/base/ecma-gc.c
index 38b48f81..fa8b1cdc 100644
--- a/jerry-core/ecma/base/ecma-gc.c
+++ b/jerry-core/ecma/base/ecma-gc.c
@@ -43,9 +43,8 @@
#if JERRY_BUILTIN_TYPEDARRAY
#include "ecma-typedarray-object.h"
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
+
#include "ecma-promise-object.h"
-#endif /* JERRY_ESNEXT */
/* TODO: Extract GC to a separate component */
@@ -176,12 +175,10 @@ ecma_gc_mark_global_object (ecma_global_object_t *global_object_p) /**< global o
ecma_gc_set_object_visited (ecma_get_object_from_value (global_object_p->this_binding));
#endif /* JERRY_BUILTIN_REALMS */
-#if JERRY_ESNEXT
if (global_object_p->global_scope_cp != global_object_p->global_env_cp)
{
ecma_gc_set_object_visited (ECMA_GET_NON_NULL_POINTER (ecma_object_t, global_object_p->global_scope_cp));
}
-#endif /* JERRY_ESNEXT */
jmem_cpointer_t *builtin_objects_p = global_object_p->builtin_objects;
@@ -311,7 +308,6 @@ ecma_gc_mark_properties (ecma_object_t *object_p, /**< object */
switch (property_pair_p->names_cp[index])
{
-#if JERRY_ESNEXT
case LIT_INTERNAL_MAGIC_STRING_ENVIRONMENT_RECORD:
{
ecma_environment_record_t *environment_record_p;
@@ -349,7 +345,6 @@ ecma_gc_mark_properties (ecma_object_t *object_p, /**< object */
}
break;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_CONTAINER
case LIT_INTERNAL_MAGIC_STRING_WEAK_REFS:
{
@@ -511,7 +506,6 @@ ecma_gc_mark_bound_function_object (ecma_object_t *object_p) /**< bound function
}
} /* ecma_gc_mark_bound_function_object */
-#if JERRY_ESNEXT
/**
* Mark objects referenced by Promise built-in.
*/
@@ -555,8 +549,6 @@ ecma_gc_mark_promise_object (ecma_extended_object_t *ext_object_p) /**< extended
}
} /* ecma_gc_mark_promise_object */
-#endif /* JERRY_ESNEXT */
-
#if JERRY_BUILTIN_CONTAINER
/**
* Mark objects referenced by Map built-in.
@@ -653,7 +645,6 @@ ecma_gc_mark_set_object (ecma_object_t *object_p) /**< object */
} /* ecma_gc_mark_set_object */
#endif /* JERRY_BUILTIN_CONTAINER */
-#if JERRY_ESNEXT
/**
* Mark objects referenced by inactive generator functions, async functions, etc.
*/
@@ -786,8 +777,6 @@ ecma_gc_mark_executable_object (ecma_object_t *object_p) /**< object */
}
} /* ecma_gc_mark_executable_object */
-#endif /* JERRY_ESNEXT */
-
#if JERRY_BUILTIN_PROXY
/**
* Mark the objects referenced by a proxy object
@@ -831,7 +820,6 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
switch (ecma_get_lex_env_type (object_p))
{
-#if JERRY_ESNEXT
case ECMA_LEXICAL_ENVIRONMENT_CLASS:
{
#if JERRY_MODULE_SYSTEM
@@ -848,7 +836,6 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
#endif /* JERRY_MODULE_SYSTEM */
/* FALLTHRU */
}
-#endif /* JERRY_ESNEXT */
case ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND:
{
ecma_object_t *binding_object_p = ecma_get_lex_env_binding_object (object_p);
@@ -1000,7 +987,6 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
break;
}
#endif /* JERRY_BUILTIN_CONTAINER */
-#if JERRY_ESNEXT
case ECMA_OBJECT_CLASS_GENERATOR:
case ECMA_OBJECT_CLASS_ASYNC_GENERATOR:
{
@@ -1063,7 +1049,6 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
break;
}
#endif /* JERRY_BUILTIN_REGEXP */
-#endif /* JERRY_ESNEXT */
default:
{
/* The ECMA_OBJECT_CLASS__MAX type represents an uninitialized class. */
@@ -1086,14 +1071,12 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
{
ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (ext_object_p->u.array.length_prop_and_hole_count & ECMA_ARRAY_TEMPLATE_LITERAL))
{
/* Template objects are never marked. */
JERRY_ASSERT (object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE);
return;
}
-#endif /* JERRY_ESNEXT */
if (ecma_op_array_is_fast_array (ext_object_p))
{
@@ -1135,7 +1118,6 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
const ecma_compiled_code_t *compiled_code_p = ecma_op_function_get_compiled_code (ext_func_p);
-#if JERRY_ESNEXT
if (CBC_FUNCTION_IS_ARROW (compiled_code_p->status_flags))
{
ecma_arrow_function_t *arrow_func_p = (ecma_arrow_function_t *) object_p;
@@ -1150,7 +1132,6 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
ecma_gc_set_object_visited (ecma_get_object_from_value (arrow_func_p->new_target));
}
}
-#endif /* JERRY_ESNEXT */
#if JERRY_SNAPSHOT_EXEC
if (JERRY_UNLIKELY (compiled_code_p->status_flags & CBC_CODE_FLAGS_STATIC_FUNCTION))
@@ -1169,18 +1150,15 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
ecma_gc_mark_bound_function_object (object_p);
break;
}
-#if JERRY_ESNEXT || JERRY_BUILTIN_REALMS
case ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION:
{
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
-#endif /* JERRY_ESNEXT || JERRY_BUILTIN_REALMS */
#if JERRY_BUILTIN_REALMS
ecma_value_t realm_value = ext_func_p->u.built_in.realm_value;
ecma_gc_set_object_visited (ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t, realm_value));
#endif /* JERRY_BUILTIN_REALMS */
-#if JERRY_ESNEXT
if (ext_func_p->u.built_in.id == ECMA_BUILTIN_ID_HANDLER)
{
switch (ext_func_p->u.built_in.routine_id)
@@ -1248,19 +1226,13 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
}
}
}
-#endif /* JERRY_ESNEXT */
-
-#if JERRY_ESNEXT || JERRY_BUILTIN_REALMS
break;
}
-#endif /* JERRY_ESNEXT || JERRY_BUILTIN_REALMS */
-#if JERRY_ESNEXT
case ECMA_OBJECT_TYPE_CONSTRUCTOR_FUNCTION:
{
ecma_gc_mark_compiled_code (((ecma_extended_object_t *) object_p)->u.constructor_function.script_value);
break;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_REALMS
case ECMA_OBJECT_TYPE_NATIVE_FUNCTION:
{
@@ -1408,8 +1380,6 @@ ecma_free_fast_access_array (ecma_object_t *object_p) /**< fast access mode arra
ecma_dealloc_extended_object (object_p, sizeof (ecma_extended_object_t));
} /* ecma_free_fast_access_array */
-#if JERRY_ESNEXT
-
/**
* Free non-objects referenced by inactive generator functions, async functions, etc.
*
@@ -1531,8 +1501,6 @@ ecma_gc_free_executable_object (ecma_object_t *object_p) /**< object */
return size;
} /* ecma_gc_free_executable_object */
-#endif /* JERRY_ESNEXT */
-
JERRY_STATIC_ASSERT (!ECMA_PROPERTY_IS_RAW (ECMA_PROPERTY_TYPE_DELETED),
ecma_property_type_deleted_must_not_be_raw_property);
JERRY_STATIC_ASSERT ((ECMA_PROPERTY_TYPE_DELETED & ECMA_PROPERTY_FLAG_LCACHED) == 0,
@@ -1601,7 +1569,6 @@ ecma_gc_free_property (ecma_object_t *object_p, /**< object */
switch (name_cp)
{
-#if JERRY_ESNEXT
case LIT_INTERNAL_MAGIC_STRING_ENVIRONMENT_RECORD:
{
ecma_environment_record_t *environment_record_p;
@@ -1636,7 +1603,6 @@ ecma_gc_free_property (ecma_object_t *object_p, /**< object */
ecma_compact_collection_destroy (compact_collection_p);
break;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_WEAKREF || JERRY_BUILTIN_CONTAINER
case LIT_INTERNAL_MAGIC_STRING_WEAK_REFS:
{
@@ -1787,9 +1753,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
{
case ECMA_OBJECT_CLASS_STRING:
case ECMA_OBJECT_CLASS_NUMBER:
-#if JERRY_ESNEXT
case ECMA_OBJECT_CLASS_SYMBOL:
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT
case ECMA_OBJECT_CLASS_BIGINT:
#endif /* JERRY_BUILTIN_BIGINT */
@@ -1833,12 +1797,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
#if JERRY_BUILTIN_DATE
case ECMA_OBJECT_CLASS_DATE:
{
-#if JERRY_ESNEXT
ext_object_size = sizeof (ecma_date_object_t);
-#else /* !JERRY_ESNEXT */
- ecma_number_t *num_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t, ext_object_p->u.cls.u3.date);
- ecma_dealloc_number (num_p);
-#endif /* JERRY_ESNEXT */
break;
}
#endif /* JERRY_BUILTIN_DATE */
@@ -1853,7 +1812,6 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
break;
}
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_ESNEXT
case ECMA_OBJECT_CLASS_STRING_ITERATOR:
{
ecma_value_t iterated_value = ext_object_p->u.cls.u3.iterated_value;
@@ -1880,7 +1838,6 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
break;
}
#endif /* JERRY_BUILTIN_REGEXP */
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
case ECMA_OBJECT_CLASS_ARRAY_BUFFER:
#if JERRY_BUILTIN_SHAREDARRAYBUFFER
@@ -1932,7 +1889,6 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
break;
}
#endif /* JERRY_BUILTIN_DATAVIEW */
-#if JERRY_ESNEXT
case ECMA_OBJECT_CLASS_GENERATOR:
case ECMA_OBJECT_CLASS_ASYNC_GENERATOR:
{
@@ -1959,7 +1915,6 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
ext_object_size = sizeof (ecma_async_from_sync_iterator_object_t);
break;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
case ECMA_OBJECT_CLASS_MODULE:
{
@@ -2013,14 +1968,12 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
ecma_compiled_code_t *byte_code_p =
(ECMA_GET_INTERNAL_VALUE_POINTER (ecma_compiled_code_t, ext_func_p->u.function.bytecode_cp));
-#if JERRY_ESNEXT
if (CBC_FUNCTION_IS_ARROW (byte_code_p->status_flags))
{
ecma_free_value_if_not_object (((ecma_arrow_function_t *) object_p)->this_binding);
ecma_free_value_if_not_object (((ecma_arrow_function_t *) object_p)->new_target);
ext_object_size = sizeof (ecma_arrow_function_t);
}
-#endif /* JERRY_ESNEXT */
ecma_bytecode_deref (byte_code_p);
#if JERRY_SNAPSHOT_EXEC
@@ -2043,7 +1996,6 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
break;
}
-#if JERRY_ESNEXT
if (extended_func_p->u.built_in.id != ECMA_BUILTIN_ID_HANDLER)
{
break;
@@ -2096,7 +2048,6 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
JERRY_UNREACHABLE ();
}
}
-#endif /* JERRY_ESNEXT */
break;
}
case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
@@ -2106,9 +2057,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
ecma_value_t args_len_or_this = bound_func_p->header.u.bound_function.args_len_or_this;
-#if JERRY_ESNEXT
ecma_free_value (bound_func_p->target_length);
-#endif /* JERRY_ESNEXT */
if (!ecma_is_value_integer_number (args_len_or_this))
{
@@ -2128,13 +2077,11 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
ext_object_size += args_size;
break;
}
-#if JERRY_ESNEXT
case ECMA_OBJECT_TYPE_CONSTRUCTOR_FUNCTION:
{
ecma_script_deref (((ecma_extended_object_t *) object_p)->u.constructor_function.script_value);
break;
}
-#endif /* JERRY_ESNEXT */
case ECMA_OBJECT_TYPE_NATIVE_FUNCTION:
{
ext_object_size = sizeof (ecma_native_function_t);
diff --git a/jerry-core/ecma/base/ecma-globals.h b/jerry-core/ecma/base/ecma-globals.h
index 91bb9c54..75c70e19 100644
--- a/jerry-core/ecma/base/ecma-globals.h
+++ b/jerry-core/ecma/base/ecma-globals.h
@@ -111,17 +111,13 @@ typedef enum
* and the first value is the source code */
ECMA_PARSE_HAS_ARGUMENT_LIST_VALUE = (1u << 12), /**< source_p points to a value list
* and the second value is the argument list */
-#if JERRY_ESNEXT
ECMA_PARSE_GENERATOR_FUNCTION = (1u << 13), /**< generator function is parsed */
ECMA_PARSE_ASYNC_FUNCTION = (1u << 14), /**< async function is parsed */
-#endif /* JERRY_ESNEXT */
/* These flags are internally used by the parser. */
ECMA_PARSE_INTERNAL_FREE_SOURCE = (1u << 15), /**< free source_p data */
ECMA_PARSE_INTERNAL_FREE_ARG_LIST = (1u << 16), /**< free arg_list_p data */
-#if JERRY_ESNEXT
ECMA_PARSE_INTERNAL_PRE_SCANNING = (1u << 17), /**< the parser is in pre-scanning mode */
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
ECMA_PARSE_INTERNAL_HAS_IMPORT_META = (1u << 18), /**< module has import.meta expression */
#endif /* JERRY_MODULE_SYSTEM */
@@ -215,10 +211,8 @@ enum
* or function call argument list */
/* Other values */
ECMA_VALUE_ARGUMENT_NO_TRACK = ECMA_MAKE_VALUE (12), /**< represents not-tracked arguments formal parameter */
-#if JERRY_ESNEXT
ECMA_VALUE_SYNC_ITERATOR = ECMA_MAKE_VALUE (13), /**< option for ecma_op_get_iterator: sync iterator is requested */
ECMA_VALUE_ASYNC_ITERATOR = ECMA_MAKE_VALUE (14), /**< option for ecma_op_get_iterator: async iterator is requested */
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_GLOBAL_THIS
ECMA_VALUE_GLOBAL_THIS = ECMA_MAKE_VALUE (15), /**< globalThis built-in */
#endif /* JERRY_BUILTIN_GLOBAL_THIS */
@@ -322,8 +316,6 @@ typedef struct ecma_native_pointer_chain_t
struct ecma_native_pointer_chain_t *next_p; /**< next in the list */
} ecma_native_pointer_chain_t;
-#if JERRY_ESNEXT
-
/**
* Representation for class constructor environment record.
*/
@@ -333,8 +325,6 @@ typedef struct
ecma_value_t function_object; /**< function object */
} ecma_environment_record_t;
-#endif /* JERRY_ESNEXT */
-
/**
* Property list:
* The property list of an object is a chain list of various items.
@@ -357,10 +347,8 @@ typedef enum
* that are not indices */
ECMA_LIST_ENUMERABLE = (1 << 1), /**< exclude non-enumerable properties */
ECMA_LIST_PROTOTYPE = (1 << 2), /**< list properties from prototype chain */
-#if JERRY_ESNEXT
ECMA_LIST_SYMBOLS = (1 << 3), /**< list symbol properties */
ECMA_LIST_SYMBOLS_ONLY = (1 << 4), /**< list symbol properties only */
-#endif /* JERRY_ESNEXT */
ECMA_LIST_CONVERT_FAST_ARRAYS = (1 << 5), /**< after listing the properties convert
* the fast access mode array back to normal array */
} ecma_list_properties_options_t;
@@ -395,9 +383,7 @@ typedef enum
ECMA_PROPERTY_FLAG_BUILT_IN = (1u << 3), /**< property is defined by the ECMAScript standard */
ECMA_FAST_ARRAY_FLAG = (1u << 3), /**< array is fast array */
ECMA_PROPERTY_FLAG_LCACHED = (1u << 4), /**< property is lcached */
-#if JERRY_ESNEXT
ECMA_ARRAY_TEMPLATE_LITERAL = (1u << 4), /**< array is a template literal constructed by the parser */
-#endif /* JERRY_ESNEXT */
ECMA_PROPERTY_FLAG_DATA = (1u << 5), /**< property contains data */
/* The last two bits contains an ECMA_DIRECT_STRING value. */
} ecma_property_flags_t;
@@ -463,11 +449,7 @@ typedef enum
/**
* Default flag of length property.
*/
-#if JERRY_ESNEXT
#define ECMA_PROPERTY_FLAG_DEFAULT_LENGTH ECMA_PROPERTY_FLAG_CONFIGURABLE
-#else /* !JERRY_ESNEXT */
-#define ECMA_PROPERTY_FLAG_DEFAULT_LENGTH ECMA_PROPERTY_FIXED
-#endif /* JERRY_ESNEXT */
/**
* Shift for property name part.
@@ -743,8 +725,7 @@ typedef enum
ECMA_OBJECT_CLASS_MODULE_NAMESPACE, /**< Module Namespace (ECMAScript v11, 9.4.6) */
#endif /* JERRY_MODULE_SYSTEM */
-/* These objects are marked by Garbage Collector. */
-#if JERRY_ESNEXT
+ /* These objects are marked by Garbage Collector. */
ECMA_OBJECT_CLASS_GENERATOR, /**< Generator object (ECMAScript v6, 25.2) */
ECMA_OBJECT_CLASS_ASYNC_GENERATOR, /**< Async generator object (ECMAScript v11, 25.3) */
ECMA_OBJECT_CLASS_ARRAY_ITERATOR, /**< Array iterator object (ECMAScript v6, 22.1.5.1) */
@@ -753,15 +734,12 @@ typedef enum
#if JERRY_BUILTIN_REGEXP
ECMA_OBJECT_CLASS_REGEXP_STRING_ITERATOR, /** RegExp string iterator object (ECMAScript v11, 21.2.7) */
#endif /* JERRY_BUILTIN_REGEXP */
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
ECMA_OBJECT_CLASS_MODULE, /**< Module (ECMAScript v6, 15.2) */
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_ESNEXT
ECMA_OBJECT_CLASS_PROMISE, /**< Promise (ECMAScript v6, 25.4) */
ECMA_OBJECT_CLASS_PROMISE_CAPABILITY, /**< Promise capability (ECMAScript v6, 25.4.1.1) */
ECMA_OBJECT_CLASS_ASYNC_FROM_SYNC_ITERATOR, /**< AsyncFromSyncIterator (ECMAScript v11, 25.1.4) */
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_DATAVIEW
ECMA_OBJECT_CLASS_DATAVIEW, /**< DataView (ECMAScript v6, 24.2) */
#endif /* JERRY_BUILTIN_DATAVIEW */
@@ -783,10 +761,8 @@ typedef enum
#if JERRY_BUILTIN_REGEXP
ECMA_OBJECT_CLASS_REGEXP, /**< RegExp Object (ECMAScript v5.1, 15.10) */
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_ESNEXT
ECMA_OBJECT_CLASS_SYMBOL, /**< Symbol object (ECMAScript v6, 4.3.27) */
ECMA_OBJECT_CLASS_STRING_ITERATOR, /**< String iterator object (ECMAScript v6, 22.1.5.1) */
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_OBJECT_CLASS_ARRAY_BUFFER, /**< Array Buffer (ECMAScript v6, 24.1) */
#endif /* JERRY_BUILTIN_TYPEDARRAY */
@@ -810,9 +786,7 @@ typedef enum
{
/* Types between 0 - 12 are ecma_object_type_t. */
ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE = 13, /**< declarative lexical environment */
-#if JERRY_ESNEXT
ECMA_LEXICAL_ENVIRONMENT_CLASS = 14, /**< lexical environment with class */
-#endif /* JERRY_ESNEXT */
ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND = 15, /**< object-bound lexical environment */
ECMA_LEXICAL_ENVIRONMENT_TYPE_START = ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE, /**< first lexical
@@ -820,8 +794,6 @@ typedef enum
ECMA_LEXICAL_ENVIRONMENT_TYPE__MAX = ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND /**< maximum value */
} ecma_lexical_environment_type_t;
-#if JERRY_ESNEXT
-
/**
* Types of array iterators.
*/
@@ -833,8 +805,6 @@ typedef enum
ECMA_ITERATOR__COUNT, /**< number of iterator kinds */
} ecma_iterator_kind_t;
-#endif /* JERRY_ESNEXT */
-
/**
* Offset for JERRY_CONTEXT (status_flags) top 8 bits.
*/
@@ -1063,11 +1033,9 @@ typedef struct
#if JERRY_MODULE_SYSTEM
uint8_t module_state; /**< Module state */
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_ESNEXT
uint8_t iterator_kind; /**< type of iterator */
uint8_t regexp_string_iterator_flags; /**< flags for RegExp string iterator */
uint8_t promise_flags; /**< Promise object flags */
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_CONTAINER
uint8_t container_flags; /**< container object flags */
#endif /* JERRY_BUILTIN_CONTAINER */
@@ -1085,10 +1053,8 @@ typedef struct
#if JERRY_MODULE_SYSTEM
uint16_t module_flags; /**< Module flags */
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_ESNEXT
uint16_t iterator_index; /**< for %Iterator%: [[%Iterator%NextIndex]] property */
uint16_t executable_obj_flags; /**< executable object flags */
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_CONTAINER
uint16_t container_id; /**< magic string id of a container */
#endif /* JERRY_BUILTIN_CONTAINER */
@@ -1102,21 +1068,16 @@ typedef struct
union
{
ecma_value_t value; /**< value of the object (e.g. boolean, number, string, etc.) */
-#if !JERRY_ESNEXT
- ecma_value_t date; /**< Date object [[DateValue]] internal property */
-#endif /* !JERRY_ESNEXT */
ecma_value_t target; /**< [[ProxyTarget]] or [[WeakRefTarget]] internal property */
#if JERRY_BUILTIN_TYPEDARRAY
ecma_value_t arraybuffer; /**< for typedarray: ArrayBuffer reference */
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
ecma_value_t head; /**< points to the async generator task queue head item */
ecma_value_t iterated_value; /**< for %Iterator%: [[IteratedObject]] property */
ecma_value_t promise; /**< PromiseCapability[[Promise]] internal slot */
ecma_value_t sync_iterator; /**< IteratorRecord [[Iterator]] internal slot for AsyncFromSyncIterator */
ecma_value_t spread_value; /**< for spread object: spreaded element */
int32_t tza; /**< TimeZone adjustment for date objects */
-#endif /* JERRY_ESNEXT */
uint32_t length; /**< length related property (e.g. length of ArrayBuffer) */
uint32_t arguments_number; /**< for arguments: arguments number */
#if JERRY_MODULE_SYSTEM
@@ -1153,7 +1114,6 @@ typedef struct
ecma_value_t args_len_or_this; /**< length of arguments or this value */
} bound_function;
-#if JERRY_ESNEXT
/**
* Description of implicit class constructor function.
*/
@@ -1162,7 +1122,6 @@ typedef struct
ecma_value_t script_value; /**< script value */
uint8_t flags; /**< constructor flags */
} constructor_function;
-#endif /* JERRY_ESNEXT */
} u;
} ecma_extended_object_t;
@@ -1245,9 +1204,7 @@ typedef struct
typedef struct
{
ecma_extended_object_t header; /**< extended object header */
-#if JERRY_ESNEXT
ecma_value_t target_length; /**< length of target function */
-#endif /* JERRY_ESNEXT */
} ecma_bound_function_t;
#if JERRY_SNAPSHOT_EXEC
@@ -1263,8 +1220,6 @@ typedef struct
#endif /* JERRY_SNAPSHOT_EXEC */
-#if JERRY_ESNEXT
-
/**
* Description of arrow function objects.
*/
@@ -1288,8 +1243,6 @@ typedef struct
#endif /* JERRY_SNAPSHOT_EXEC */
-#endif /* JERRY_ESNEXT */
-
#if JERRY_BUILTIN_CONTAINER
/**
* Flags for container objects
@@ -1711,12 +1664,10 @@ typedef struct
} u;
} ecma_extended_string_t;
-#if JERRY_ESNEXT
/**
* Required number of ecma values in a compact collection to represent PrivateElement
*/
#define ECMA_PRIVATE_ELEMENT_LIST_SIZE 3
-#endif /* JERRY_ESNEXT */
/**
* String builder header
@@ -1943,8 +1894,6 @@ typedef struct
#endif /* JERRY_BUILTIN_BIGINT */
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
-
/**
* Executable (e.g. generator, async) object flags.
*/
@@ -2060,8 +2009,6 @@ typedef enum
ECMA_PROMISE_ANY_REJECT, /**< promise.any reject */
} ecma_promise_executor_type_t;
-#endif /* JERRY_ESNEXT */
-
#if JERRY_BUILTIN_DATAVIEW
/**
* Description of DataView objects.
@@ -2174,21 +2121,12 @@ typedef struct
} ecma_revocable_proxy_object_t;
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_ESNEXT
/**
* Type to repesent the maximum property index
*
* For ES6+ the maximum valid property index is 2**53 - 1
*/
typedef uint64_t ecma_length_t;
-#else /* !JERRY_ESNEXT */
-/**
- * Type to repesent the maximum property index
- *
- * For ES5+ the maximum valid property index is 2**32 - 1
- */
-typedef uint32_t ecma_length_t;
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT
@@ -2270,8 +2208,6 @@ typedef struct
} u;
} ecma_mapped_arguments_t;
-#if JERRY_ESNEXT
-
/**
* Date object descriptor flags
*/
@@ -2328,8 +2264,6 @@ typedef enum
*/
#define ECMA_PRIVATE_PROPERTY_KIND(prop) ((prop) & ((ECMA_PRIVATE_PROPERTY_STATIC_FLAG - 1)))
-#endif /* JERRY_ESNEXT */
-
/**
* @}
* @}
diff --git a/jerry-core/ecma/base/ecma-helpers-collection.c b/jerry-core/ecma/base/ecma-helpers-collection.c
index cecb3cdb..50afc5c5 100644
--- a/jerry-core/ecma/base/ecma-helpers-collection.c
+++ b/jerry-core/ecma/base/ecma-helpers-collection.c
@@ -80,8 +80,6 @@ ecma_collection_free_objects (ecma_collection_t *collection_p) /**< value collec
ecma_collection_destroy (collection_p);
} /* ecma_collection_free_objects */
-#if JERRY_ESNEXT
-
/**
* Free the template literal objects and deallocate the collection
*/
@@ -118,8 +116,6 @@ ecma_collection_free_template_literal (ecma_collection_t *collection_p) /**< val
ecma_collection_destroy (collection_p);
} /* ecma_collection_free_template_literal */
-#endif /* JERRY_ESNEXT */
-
/**
* Free the non-object collection elements and deallocate the collection
*/
diff --git a/jerry-core/ecma/base/ecma-helpers-conversion.c b/jerry-core/ecma/base/ecma-helpers-conversion.c
index 66879bfd..db22503a 100644
--- a/jerry-core/ecma/base/ecma-helpers-conversion.c
+++ b/jerry-core/ecma/base/ecma-helpers-conversion.c
@@ -293,12 +293,6 @@ ecma_utf8_string_to_number_by_radix (const lit_utf8_byte_t *str_p, /**< utf-8 st
uint32_t radix, /**< radix */
uint32_t options) /**< option flags */
{
-#if JERRY_ESNEXT
- bool allow_underscore = (options & ECMA_CONVERSION_ALLOW_UNDERSCORE);
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (options);
-#endif /* !JERRY_ESNEXT */
-
JERRY_ASSERT (radix == 2 || radix == 8 || radix == 16);
JERRY_ASSERT (*str_p == LIT_CHAR_0);
@@ -319,12 +313,10 @@ ecma_utf8_string_to_number_by_radix (const lit_utf8_byte_t *str_p, /**< utf-8 st
{
lit_utf8_byte_t digit = *str_p++;
-#if JERRY_ESNEXT
- if (digit == LIT_CHAR_UNDERSCORE && allow_underscore)
+ if (digit == LIT_CHAR_UNDERSCORE && (options & ECMA_CONVERSION_ALLOW_UNDERSCORE))
{
continue;
}
-#endif /* JERRY_ESNEXT */
if (!lit_char_is_hex_digit (digit))
{
@@ -405,13 +397,11 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */
/* Parsing integer part */
while (str_p < end_p)
{
-#if JERRY_ESNEXT
if (*str_p == LIT_CHAR_UNDERSCORE && (options & ECMA_CONVERSION_ALLOW_UNDERSCORE))
{
str_p++;
continue;
}
-#endif /* JERRY_ESNEXT */
if (!lit_char_is_decimal_digit (*str_p))
{
@@ -444,13 +434,11 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */
while (str_p < end_p)
{
-#if JERRY_ESNEXT
if (*str_p == LIT_CHAR_UNDERSCORE && (options & ECMA_CONVERSION_ALLOW_UNDERSCORE))
{
str_p++;
continue;
}
-#endif /* JERRY_ESNEXT */
if (!lit_char_is_decimal_digit (*str_p))
{
@@ -506,13 +494,11 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */
while (str_p < end_p)
{
-#if JERRY_ESNEXT
if (*str_p == LIT_CHAR_UNDERSCORE && (options & ECMA_CONVERSION_ALLOW_UNDERSCORE))
{
str_p++;
continue;
}
-#endif /* JERRY_ESNEXT */
if (!lit_char_is_decimal_digit (*str_p))
{
diff --git a/jerry-core/ecma/base/ecma-helpers-string.c b/jerry-core/ecma/base/ecma-helpers-string.c
index bc4b4347..294bbaa8 100644
--- a/jerry-core/ecma/base/ecma-helpers-string.c
+++ b/jerry-core/ecma/base/ecma-helpers-string.c
@@ -205,7 +205,6 @@ ecma_new_ecma_string_from_magic_string_ex_id (lit_magic_string_ex_id_t id) /**<
return string_desc_p;
} /* ecma_new_ecma_string_from_magic_string_ex_id */
-#if JERRY_ESNEXT
/**
* Allocate new ecma-string and fill it with reference to the symbol descriptor
*
@@ -240,7 +239,6 @@ ecma_prop_name_is_symbol (ecma_string_t *string_p) /**< ecma-string */
return (!ECMA_IS_DIRECT_STRING (string_p) && ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_SYMBOL);
} /* ecma_prop_name_is_symbol */
-#endif /* JERRY_ESNEXT */
/**
* Allocate new UTF8 ecma-string and fill it with characters from the given utf8 buffer
@@ -537,8 +535,6 @@ ecma_new_ecma_string_from_code_unit (ecma_char_t code_unit) /**< code unit */
return ecma_new_ecma_string_from_utf8 (lit_utf8_bytes, bytes_size);
} /* ecma_new_ecma_string_from_code_unit */
-#if JERRY_ESNEXT
-
/**
* Allocate new ecma-string and fill it with cesu-8 character which represents specified code units
*
@@ -555,8 +551,6 @@ ecma_new_ecma_string_from_code_units (ecma_char_t first_code_unit, /**< code uni
return ecma_new_ecma_string_from_utf8 (lit_utf8_bytes, bytes_size);
} /* ecma_new_ecma_string_from_code_units */
-#endif /* JERRY_ESNEXT */
-
/**
* Allocate new ecma-string and fill it with ecma-number
*
@@ -590,14 +584,12 @@ ecma_new_ecma_string_from_length (ecma_length_t number) /**< property length */
return (ecma_string_t *) ECMA_CREATE_DIRECT_STRING (ECMA_DIRECT_STRING_UINT, (uintptr_t) number);
}
-#if JERRY_ESNEXT
JERRY_ASSERT ((ecma_number_t) number <= ECMA_NUMBER_MAX_SAFE_INTEGER);
if (JERRY_UNLIKELY (number > UINT32_MAX))
{
return ecma_new_ecma_string_from_number ((ecma_number_t) number);
}
-#endif /* JERRY_ESNEXT */
return ecma_new_non_direct_string_from_uint32 ((uint32_t) number);
} /* ecma_new_ecma_string_from_length */
@@ -991,7 +983,6 @@ ecma_destroy_ecma_string (ecma_string_t *string_p) /**< ecma-string */
ecma_dealloc_string_buffer (string_p, ECMA_ASCII_STRING_GET_SIZE (string_p) + ECMA_ASCII_STRING_HEADER_SIZE);
return;
}
-#if JERRY_ESNEXT
case ECMA_STRING_CONTAINER_SYMBOL:
{
ecma_extended_string_t *symbol_p = (ecma_extended_string_t *) string_p;
@@ -999,7 +990,6 @@ ecma_destroy_ecma_string (ecma_string_t *string_p) /**< ecma-string */
ecma_dealloc_extended_string (symbol_p);
return;
}
-#endif /* JERRY_ESNEXT */
default:
{
JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_UINT32_IN_DESC
@@ -2349,8 +2339,6 @@ ecma_string_trim (const ecma_string_t *string_p) /**< pointer to an ecma string
return ret_string_p;
} /* ecma_string_trim */
-#if JERRY_ESNEXT
-
/**
* Pad the beginning or the end of string with parameter given in fill_string to the length of max_length.
*
@@ -2442,7 +2430,6 @@ ecma_string_pad (ecma_value_t original_string_p, /**< Input ecma string */
return ecma_make_string_value (ecma_stringbuilder_finalize (&builder));
} /* ecma_string_pad */
-#endif /* JERRY_ESNEXT */
/**
* Create an empty string builder
@@ -2756,7 +2743,6 @@ ecma_stringbuilder_destroy (ecma_stringbuilder_t *builder_p) /**< string builder
#endif /* JERRY_MEM_STATS */
} /* ecma_stringbuilder_destroy */
-#if JERRY_ESNEXT
/**
* AdvanceStringIndex operation
*
@@ -2803,7 +2789,6 @@ ecma_op_advance_string_index (ecma_string_t *str_p, /**< input string */
return next_index + 1;
} /* ecma_op_advance_string_index */
-#endif /* JERRY_ESNEXT */
/**
* @}
diff --git a/jerry-core/ecma/base/ecma-helpers-value.c b/jerry-core/ecma/base/ecma-helpers-value.c
index b6fa4456..cc79baa9 100644
--- a/jerry-core/ecma/base/ecma-helpers-value.c
+++ b/jerry-core/ecma/base/ecma-helpers-value.c
@@ -327,12 +327,7 @@ ecma_is_value_string (ecma_value_t value) /**< ecma value */
extern inline bool JERRY_ATTR_CONST JERRY_ATTR_ALWAYS_INLINE
ecma_is_value_symbol (ecma_value_t value) /**< ecma value */
{
-#if JERRY_ESNEXT
return (ecma_get_value_type_field (value) == ECMA_TYPE_SYMBOL);
-#else /* JERRY_ESNEXT */
- JERRY_UNUSED (value);
- return false;
-#endif /* JERRY_ESNEXT */
} /* ecma_is_value_symbol */
/**
@@ -374,11 +369,7 @@ ecma_is_value_bigint (ecma_value_t value) /**< ecma value */
extern inline bool JERRY_ATTR_CONST JERRY_ATTR_ALWAYS_INLINE
ecma_is_value_prop_name (ecma_value_t value) /**< ecma value */
{
-#if JERRY_ESNEXT
return ecma_is_value_string (value) || ecma_is_value_symbol (value);
-#else /* !JERRY_ESNEXT */
- return ecma_is_value_string (value);
-#endif /* JERRY_ESNEXT */
} /* ecma_is_value_prop_name */
/**
@@ -631,9 +622,7 @@ extern inline ecma_value_t JERRY_ATTR_PURE JERRY_ATTR_ALWAYS_INLINE
ecma_make_string_value (const ecma_string_t *ecma_string_p) /**< string to reference in value */
{
JERRY_ASSERT (ecma_string_p != NULL);
-#if JERRY_ESNEXT
JERRY_ASSERT (!ecma_prop_name_is_symbol ((ecma_string_t *) ecma_string_p));
-#endif /* JERRY_ESNEXT */
if ((((uintptr_t) ecma_string_p) & ECMA_VALUE_TYPE_MASK) != 0)
{
@@ -643,7 +632,6 @@ ecma_make_string_value (const ecma_string_t *ecma_string_p) /**< string to refer
return ecma_pointer_to_ecma_value (ecma_string_p) | ECMA_TYPE_STRING;
} /* ecma_make_string_value */
-#if JERRY_ESNEXT
/**
* Symbol value constructor
*
@@ -657,7 +645,6 @@ ecma_make_symbol_value (const ecma_string_t *ecma_symbol_p) /**< symbol to refer
return ecma_pointer_to_ecma_value (ecma_symbol_p) | ECMA_TYPE_SYMBOL;
} /* ecma_make_symbol_value */
-#endif /* JERRY_ESNEXT */
/**
* Property-name value constructor
@@ -669,12 +656,10 @@ ecma_make_prop_name_value (const ecma_string_t *ecma_prop_name_p) /**< property
{
JERRY_ASSERT (ecma_prop_name_p != NULL);
-#if JERRY_ESNEXT
if (ecma_prop_name_is_symbol ((ecma_string_t *) ecma_prop_name_p))
{
return ecma_make_symbol_value (ecma_prop_name_p);
}
-#endif /* JERRY_ESNEXT */
return ecma_make_string_value (ecma_prop_name_p);
} /* ecma_make_prop_name_value */
@@ -794,7 +779,6 @@ ecma_get_string_from_value (ecma_value_t value) /**< ecma value */
return (ecma_string_t *) ecma_get_pointer_from_ecma_value (value);
} /* ecma_get_string_from_value */
-#if JERRY_ESNEXT
/**
* Get pointer to ecma-string from ecma value
*
@@ -807,7 +791,6 @@ ecma_get_symbol_from_value (ecma_value_t value) /**< ecma value */
return (ecma_string_t *) ecma_get_pointer_from_ecma_value (value);
} /* ecma_get_symbol_from_value */
-#endif /* JERRY_ESNEXT */
/**
* Get pointer to a property name from ecma value
@@ -889,9 +872,7 @@ ecma_copy_value (ecma_value_t value) /**< value description */
return ecma_make_float_value (new_num_p);
}
-#if JERRY_ESNEXT
case ECMA_TYPE_SYMBOL:
-#endif /* JERRY_ESNEXT */
case ECMA_TYPE_STRING:
{
ecma_string_t *string_p = (ecma_string_t *) ecma_get_pointer_from_ecma_value (value);
@@ -1113,9 +1094,7 @@ ecma_free_value (ecma_value_t value) /**< value description */
ecma_dealloc_number (number_p);
break;
}
-#if JERRY_ESNEXT
case ECMA_TYPE_SYMBOL:
-#endif /* JERRY_ESNEXT */
case ECMA_TYPE_STRING:
{
ecma_string_t *string_p = (ecma_string_t *) ecma_get_pointer_from_ecma_value (value);
@@ -1240,12 +1219,10 @@ ecma_get_typeof_lit_id (ecma_value_t value) /**< input ecma value */
{
ret_value = LIT_MAGIC_STRING_STRING;
}
-#if JERRY_ESNEXT
else if (ecma_is_value_symbol (value))
{
ret_value = LIT_MAGIC_STRING_SYMBOL;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT
else if (ecma_is_value_bigint (value))
{
diff --git a/jerry-core/ecma/base/ecma-helpers.c b/jerry-core/ecma/base/ecma-helpers.c
index 908c8388..c51be10d 100644
--- a/jerry-core/ecma/base/ecma-helpers.c
+++ b/jerry-core/ecma/base/ecma-helpers.c
@@ -164,8 +164,6 @@ ecma_create_object_lex_env (ecma_object_t *outer_lexical_environment_p, /**< out
return new_lexical_environment_p;
} /* ecma_create_object_lex_env */
-#if JERRY_ESNEXT
-
/**
* Create a lexical environment with a specified size.
*
@@ -200,8 +198,6 @@ ecma_create_lex_env_class (ecma_object_t *outer_lexical_environment_p, /**< oute
return new_lexical_environment_p;
} /* ecma_create_lex_env_class */
-#endif /* JERRY_ESNEXT */
-
/**
* Check if the object is lexical environment.
*
@@ -303,13 +299,9 @@ ecma_get_lex_env_binding_object (const ecma_object_t *object_p) /**< object-boun
{
JERRY_ASSERT (object_p != NULL);
JERRY_ASSERT (ecma_is_lexical_environment (object_p));
-#if JERRY_ESNEXT
JERRY_ASSERT (ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND
|| (ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_CLASS
&& !ECMA_LEX_ENV_CLASS_IS_MODULE (object_p)));
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
-#endif /* JERRY_ESNEXT */
return ECMA_GET_NON_NULL_POINTER (ecma_object_t, object_p->u1.bound_object_cp);
} /* ecma_get_lex_env_binding_object */
@@ -1534,7 +1526,6 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
ecma_script_deref (((cbc_uint8_arguments_t *) bytecode_p)->script_value);
-#if JERRY_ESNEXT
if (bytecode_p->status_flags & CBC_CODE_FLAGS_HAS_TAGGED_LITERALS)
{
ecma_collection_t *collection_p = ecma_compiled_code_get_tagged_template_collection (bytecode_p);
@@ -1544,7 +1535,6 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
JERRY_CONTEXT (ecma_gc_new_objects) += collection_p->item_count * 2;
ecma_collection_free_template_literal (collection_p);
}
-#endif /* JERRY_ESNEXT */
#if JERRY_LINE_INFO
if (bytecode_p->status_flags & CBC_CODE_FLAGS_HAS_LINE_INFO)
@@ -1659,12 +1649,10 @@ ecma_script_get_from_value (ecma_value_t value) /**< compiled code */
ECMA_GET_NON_NULL_POINTER_FROM_POINTER_TAG (ecma_object_t, ext_object_p->u.bound_function.target_function);
continue;
}
-#if JERRY_ESNEXT
case ECMA_OBJECT_TYPE_CONSTRUCTOR_FUNCTION:
{
return ((ecma_extended_object_t *) object_p)->u.constructor_function.script_value;
}
-#endif /* JERRY_ESNEXT */
default:
{
return JMEM_CP_NULL;
@@ -1702,8 +1690,6 @@ ecma_compiled_code_resolve_arguments_start (const ecma_compiled_code_t *bytecode
return ((ecma_value_t *) byte_p) - ((cbc_uint16_arguments_t *) bytecode_header_p)->argument_end;
} /* ecma_compiled_code_resolve_arguments_start */
-#if JERRY_ESNEXT
-
/**
* Resolve the position of the function name of the compiled code
*
@@ -1738,8 +1724,6 @@ ecma_compiled_code_get_tagged_template_collection (const ecma_compiled_code_t *b
return ECMA_GET_INTERNAL_VALUE_POINTER (ecma_collection_t, base_p[-1]);
} /* ecma_compiled_code_get_tagged_template_collection */
-#endif /* JERRY_ESNEXT */
-
#if JERRY_LINE_INFO
/**
@@ -1755,7 +1739,6 @@ ecma_compiled_code_get_line_info (const ecma_compiled_code_t *bytecode_header_p)
ecma_value_t *base_p = ecma_compiled_code_resolve_arguments_start (bytecode_header_p);
-#if JERRY_ESNEXT
if (CBC_FUNCTION_GET_TYPE (bytecode_header_p->status_flags) != CBC_FUNCTION_CONSTRUCTOR)
{
base_p--;
@@ -1765,7 +1748,6 @@ ecma_compiled_code_get_line_info (const ecma_compiled_code_t *bytecode_header_p)
{
base_p--;
}
-#endif /* JERRY_ESNEXT */
return ECMA_GET_INTERNAL_VALUE_POINTER (uint8_t, base_p[-1]);
} /* ecma_compiled_code_get_line_info */
diff --git a/jerry-core/ecma/base/ecma-helpers.h b/jerry-core/ecma/base/ecma-helpers.h
index 9a87c58e..0e98ea24 100644
--- a/jerry-core/ecma/base/ecma-helpers.h
+++ b/jerry-core/ecma/base/ecma-helpers.h
@@ -241,9 +241,7 @@ ecma_value_t ecma_make_number_value (ecma_number_t ecma_number);
ecma_value_t ecma_make_int32_value (int32_t int32_number);
ecma_value_t ecma_make_uint32_value (uint32_t uint32_number);
ecma_value_t JERRY_ATTR_PURE ecma_make_string_value (const ecma_string_t *ecma_string_p);
-#if JERRY_ESNEXT
ecma_value_t JERRY_ATTR_PURE ecma_make_symbol_value (const ecma_string_t *ecma_symbol_p);
-#endif /* JERRY_ESNEXT */
ecma_value_t JERRY_ATTR_PURE ecma_make_prop_name_value (const ecma_string_t *ecma_prop_name_p);
ecma_value_t JERRY_ATTR_PURE ecma_make_magic_string_value (lit_magic_string_id_t id);
ecma_value_t JERRY_ATTR_PURE ecma_make_object_value (const ecma_object_t *object_p);
@@ -254,9 +252,7 @@ ecma_number_t JERRY_ATTR_PURE ecma_get_float_from_value (ecma_value_t value);
ecma_number_t *ecma_get_pointer_from_float_value (ecma_value_t value);
ecma_number_t JERRY_ATTR_PURE ecma_get_number_from_value (ecma_value_t value);
ecma_string_t JERRY_ATTR_PURE *ecma_get_string_from_value (ecma_value_t value);
-#if JERRY_ESNEXT
ecma_string_t JERRY_ATTR_PURE *ecma_get_symbol_from_value (ecma_value_t value);
-#endif /* JERRY_ESNEXT */
ecma_string_t JERRY_ATTR_PURE *ecma_get_prop_name_from_value (ecma_value_t value);
ecma_object_t JERRY_ATTR_PURE *ecma_get_object_from_value (ecma_value_t value);
ecma_extended_primitive_t JERRY_ATTR_PURE *ecma_get_extended_primitive_from_value (ecma_value_t value);
@@ -277,11 +273,9 @@ void ecma_free_number (ecma_value_t value);
lit_magic_string_id_t ecma_get_typeof_lit_id (ecma_value_t value);
/* ecma-helpers-string.c */
-#if JERRY_ESNEXT
ecma_string_t *ecma_new_symbol_from_descriptor_string (ecma_value_t string_desc);
bool ecma_prop_name_is_symbol (ecma_string_t *string_p);
ecma_length_t ecma_op_advance_string_index (ecma_string_t *str_p, ecma_length_t index_num, bool is_unicode);
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_CONTAINER
ecma_string_t *ecma_new_map_key_string (ecma_value_t value);
bool ecma_prop_name_is_map_key (ecma_string_t *string_p);
@@ -293,9 +287,7 @@ ecma_string_t *ecma_new_ecma_string_from_utf8_converted_to_cesu8 (const lit_utf8
ecma_string_t *
ecma_new_ecma_external_string_from_cesu8 (const lit_utf8_byte_t *string_p, lit_utf8_size_t string_size, void *user_p);
ecma_string_t *ecma_new_ecma_string_from_code_unit (ecma_char_t code_unit);
-#if JERRY_ESNEXT
ecma_string_t *ecma_new_ecma_string_from_code_units (ecma_char_t first_code_unit, ecma_char_t second_code_unit);
-#endif /* JERRY_ESNEXT */
ecma_string_t *ecma_new_ecma_string_from_length (ecma_length_t index);
ecma_string_t *ecma_new_ecma_string_from_uint32 (uint32_t uint32_number);
ecma_string_t *ecma_new_non_direct_string_from_uint32 (uint32_t uint32_number);
@@ -330,9 +322,6 @@ const lit_utf8_byte_t *ecma_string_get_chars (const ecma_string_t *string_p,
bool ecma_compare_ecma_string_to_magic_id (const ecma_string_t *string_p, lit_magic_string_id_t id);
bool ecma_string_is_empty (const ecma_string_t *string_p);
bool ecma_string_is_length (const ecma_string_t *string_p);
-#if JERRY_ESNEXT
-bool ecma_compare_ecma_string_to_global_symbol (ecma_string_t *string_p, lit_magic_string_id_t property_id);
-#endif /* JERRY_ESNEXT */
jmem_cpointer_t ecma_string_to_property_name (ecma_string_t *prop_name_p, ecma_property_t *name_type_p);
ecma_string_t *ecma_string_from_property_name (ecma_property_t property, jmem_cpointer_t prop_name_cp);
@@ -359,10 +348,8 @@ const lit_utf8_byte_t *ecma_string_trim_front (const lit_utf8_byte_t *start_p, c
const lit_utf8_byte_t *ecma_string_trim_back (const lit_utf8_byte_t *start_p, const lit_utf8_byte_t *end_p);
void ecma_string_trim_helper (const lit_utf8_byte_t **utf8_str_p, lit_utf8_size_t *utf8_str_size);
ecma_string_t *ecma_string_trim (const ecma_string_t *string_p);
-#if JERRY_ESNEXT
ecma_value_t
ecma_string_pad (ecma_value_t original_string_p, ecma_value_t max_length, ecma_value_t fill_string, bool pad_on_start);
-#endif /* JERRY_ESNEXT */
ecma_stringbuilder_t ecma_stringbuilder_create (void);
ecma_stringbuilder_t ecma_stringbuilder_create_from (ecma_string_t *string_p);
@@ -409,9 +396,7 @@ void ecma_collection_destroy (ecma_collection_t *collection_p);
void ecma_collection_free (ecma_collection_t *collection_p);
void ecma_collection_free_if_not_object (ecma_collection_t *collection_p);
void ecma_collection_free_objects (ecma_collection_t *collection_p);
-#if JERRY_ESNEXT
void ecma_collection_free_template_literal (ecma_collection_t *collection_p);
-#endif /* JERRY_ESNEXT */
bool ecma_collection_check_duplicated_entries (ecma_collection_t *collection_p);
bool ecma_collection_has_string_value (ecma_collection_t *collection_p, ecma_string_t *string_p);
@@ -426,9 +411,7 @@ void ecma_compact_collection_destroy (ecma_value_t *compact_collection_p);
ecma_object_t *ecma_create_object (ecma_object_t *prototype_object_p, size_t ext_object_size, ecma_object_type_t type);
ecma_object_t *ecma_create_decl_lex_env (ecma_object_t *outer_lexical_environment_p);
ecma_object_t *ecma_create_object_lex_env (ecma_object_t *outer_lexical_environment_p, ecma_object_t *binding_obj_p);
-#if JERRY_ESNEXT
ecma_object_t *ecma_create_lex_env_class (ecma_object_t *outer_lexical_environment_p, size_t lexical_env_size);
-#endif /* JERRY_ESNEXT */
bool JERRY_ATTR_PURE ecma_is_lexical_environment (const ecma_object_t *object_p);
void ecma_op_ordinary_object_set_extensible (ecma_object_t *object_p);
ecma_object_type_t JERRY_ATTR_PURE ecma_get_object_type (const ecma_object_t *object_p);
@@ -501,10 +484,8 @@ void ecma_bytecode_ref (ecma_compiled_code_t *bytecode_p);
void ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p);
ecma_value_t ecma_script_get_from_value (ecma_value_t value);
ecma_value_t *ecma_compiled_code_resolve_arguments_start (const ecma_compiled_code_t *bytecode_header_p);
-#if JERRY_ESNEXT
ecma_value_t *ecma_compiled_code_resolve_function_name (const ecma_compiled_code_t *bytecode_header_p);
ecma_collection_t *ecma_compiled_code_get_tagged_template_collection (const ecma_compiled_code_t *bytecode_header_p);
-#endif /* JERRY_ESNEXT */
#if JERRY_LINE_INFO
uint8_t *ecma_compiled_code_get_line_info (const ecma_compiled_code_t *bytecode_header_p);
#endif /* JERRY_LINE_INFO */
diff --git a/jerry-core/ecma/base/ecma-init-finalize.c b/jerry-core/ecma/base/ecma-init-finalize.c
index 63801b3a..60a3b2e0 100644
--- a/jerry-core/ecma/base/ecma-init-finalize.c
+++ b/jerry-core/ecma/base/ecma-init-finalize.c
@@ -58,13 +58,9 @@ ecma_init (void)
JERRY_CONTEXT (stack_base) = (uintptr_t) &sp;
#endif /* (JERRY_STACK_LIMIT != 0) */
-#if JERRY_ESNEXT
ecma_job_queue_init ();
-#endif /* JERRY_ESNEXT */
-#if JERRY_ESNEXT
JERRY_CONTEXT (current_new_target_p) = NULL;
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
JERRY_CONTEXT (arraybuffer_compact_allocation_limit) = 256;
@@ -77,9 +73,7 @@ ecma_init (void)
void
ecma_finalize (void)
{
-#if JERRY_ESNEXT
JERRY_ASSERT (JERRY_CONTEXT (current_new_target_p) == NULL);
-#endif /* JERRY_ESNEXT */
ecma_finalize_global_environment ();
uint8_t runs = 0;
@@ -93,7 +87,6 @@ ecma_finalize (void)
}
} while (JERRY_CONTEXT (ecma_gc_new_objects) != 0);
-#if JERRY_ESNEXT
jmem_cpointer_t *global_symbols_cp = JERRY_CONTEXT (global_symbols_cp);
for (uint32_t i = 0; i < ECMA_BUILTIN_GLOBAL_SYMBOL_COUNT; i++)
@@ -103,7 +96,6 @@ ecma_finalize (void)
ecma_deref_ecma_string (ECMA_GET_NON_NULL_POINTER (ecma_string_t, global_symbols_cp[i]));
}
}
-#endif /* JERRY_ESNEXT */
ecma_finalize_lit_storage ();
} /* ecma_finalize */
diff --git a/jerry-core/ecma/base/ecma-literal-storage.c b/jerry-core/ecma/base/ecma-literal-storage.c
index 3b97afbd..429691ab 100644
--- a/jerry-core/ecma/base/ecma-literal-storage.c
+++ b/jerry-core/ecma/base/ecma-literal-storage.c
@@ -29,7 +29,6 @@
* @{
*/
-#if JERRY_ESNEXT
/**
* Free symbol list
*/
@@ -56,7 +55,6 @@ ecma_free_symbol_list (jmem_cpointer_t symbol_list_cp) /**< symbol list */
symbol_list_cp = next_item_cp;
}
} /* ecma_free_symbol_list */
-#endif /* JERRY_ESNEXT */
/**
* Free string list
@@ -146,9 +144,7 @@ ecma_free_bigint_list (jmem_cpointer_t bigint_list_cp) /**< bigint list */
void
ecma_finalize_lit_storage (void)
{
-#if JERRY_ESNEXT
ecma_free_symbol_list (JERRY_CONTEXT (symbol_list_first_cp));
-#endif /* JERRY_ESNEXT */
ecma_free_string_list (JERRY_CONTEXT (string_list_first_cp));
ecma_free_number_list (JERRY_CONTEXT (number_list_first_cp));
#if JERRY_BUILTIN_BIGINT
@@ -729,13 +725,11 @@ ecma_snapshot_resolve_serializable_values (const ecma_compiled_code_t *compiled_
base_p -= argument_end;
}
-#if JERRY_ESNEXT
/* function name */
if (CBC_FUNCTION_GET_TYPE (compiled_code_p->status_flags) != CBC_FUNCTION_CONSTRUCTOR)
{
base_p--;
}
-#endif /* JERRY_ESNEXT */
return base_p;
} /* ecma_snapshot_resolve_serializable_values */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.c
index 84956daf..771fca8e 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.c
@@ -25,13 +25,9 @@
#include "jrt.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-aggregateerror-prototype.inc.h"
#define BUILTIN_UNDERSCORED_ID aggregate_error_prototype
#include "ecma-builtin-internal-routines-template.inc.h"
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.inc.h
index f03cb638..b5b3a11a 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.inc.h
@@ -19,8 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* Object properties:
* (property name, object pointer getter) */
@@ -33,6 +31,4 @@ STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_AGGREGATE_ERROR_UL, ECMA_P
/* ECMA-262 v5, 15.11.7.10 */
STRING_VALUE (LIT_MAGIC_STRING_MESSAGE, LIT_MAGIC_STRING__EMPTY, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.c b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.c
index e1c25618..4313168b 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.c
@@ -29,8 +29,6 @@
#include "jcontext.h"
#include "jrt.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -109,5 +107,3 @@ ecma_builtin_aggregate_error_dispatch_construct (const ecma_value_t *arguments_l
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.inc.h
index c343b41d..c7f0f6fb 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.inc.h
@@ -19,8 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* Number properties:
* (property name, number value, writable, enumerable, configurable) */
@@ -34,6 +32,4 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_AGGREGATE_ERROR_PROTOT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_AGGREGATE_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c
index 308845ff..c295f7a0 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c
@@ -19,8 +19,6 @@
#include "ecma-iterator-object.h"
#include "ecma-typedarray-object.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -224,5 +222,3 @@ ecma_builtin_array_iterator_prototype_dispatch_routine (uint8_t builtin_routine_
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.inc.h
index 1338fb44..c74d68da 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.inc.h
@@ -19,14 +19,10 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_ARRAY_ITERATOR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
/* Routine properties:
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
ROUTINE (LIT_MAGIC_STRING_NEXT, ECMA_ARRAY_ITERATOR_PROTOTYPE_OBJECT_NEXT, 0, 0)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.c b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.c
index 2caad899..5f67573a 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.c
@@ -16,13 +16,9 @@
#include "ecma-builtin-helpers.h"
#include "ecma-builtins.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-array-prototype-unscopables.inc.h"
#define BUILTIN_UNDERSCORED_ID array_prototype_unscopables
#include "ecma-builtin-internal-routines-template.inc.h"
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.inc.h
index d4d79db8..2cc4bc50 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.inc.h
@@ -19,8 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
SIMPLE_VALUE (LIT_MAGIC_STRING_AT, ECMA_VALUE_TRUE, ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE)
SIMPLE_VALUE (LIT_MAGIC_STRING_COPY_WITHIN, ECMA_VALUE_TRUE, ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE)
@@ -43,6 +41,4 @@ SIMPLE_VALUE (LIT_MAGIC_STRING_KEYS, ECMA_VALUE_TRUE, ECMA_PROPERTY_CONFIGURABLE
SIMPLE_VALUE (LIT_MAGIC_STRING_VALUES, ECMA_VALUE_TRUE, ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c
index 7201a0c2..61b56127 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c
@@ -48,10 +48,7 @@
enum
{
ECMA_ARRAY_PROTOTYPE_ROUTINE_START = 0,
-/* Note: these 2 routine ids must be in this order */
-#if !JERRY_ESNEXT
- ECMA_ARRAY_PROTOTYPE_TO_STRING,
-#endif /* !JERRY_ESNEXT */
+ /* Note: these 2 routine ids must be in this order */
ECMA_ARRAY_PROTOTYPE_SORT,
ECMA_ARRAY_PROTOTYPE_CONCAT,
ECMA_ARRAY_PROTOTYPE_TO_LOCALE_STRING,
@@ -188,17 +185,14 @@ ecma_builtin_array_prototype_object_concat (const ecma_value_t args[], /**< argu
ecma_object_t *obj_p) /**< array object */
{
/* 2. */
-#if JERRY_ESNEXT
ecma_object_t *new_array_p = ecma_op_array_species_create (obj_p, 0);
if (JERRY_UNLIKELY (new_array_p == NULL))
{
return ECMA_VALUE_ERROR;
}
-#else /* !JERRY_ESNEXT */
- ecma_object_t *new_array_p = ecma_op_new_array_object (0);
-#endif /* JERRY_ESNEXT */
+ /* 3. */
ecma_length_t new_length = 0;
/* 5.b - 5.c for this_arg */
@@ -458,7 +452,6 @@ ecma_builtin_array_prototype_object_push (const ecma_value_t *argument_list_p, /
return ecma_make_uint32_value (new_length);
}
-#if JERRY_ESNEXT
/* 5. */
if ((ecma_number_t) (length + arguments_number) > ECMA_NUMBER_MAX_SAFE_INTEGER)
{
@@ -477,34 +470,15 @@ ecma_builtin_array_prototype_object_push (const ecma_value_t *argument_list_p, /
}
}
- ecma_number_t n = (ecma_number_t) length;
-#else /* JERRY_ESNEXT */
- ecma_number_t n = (ecma_number_t) length;
-
- /* 5. */
- for (ecma_length_t index = 0; index < arguments_number; index++, n++)
- {
- /* 5.b */
- ecma_string_t *index_str_p = ecma_new_ecma_string_from_number (n);
- ecma_value_t put_value = ecma_op_object_put (obj_p, index_str_p, argument_list_p[index], true);
- ecma_deref_ecma_string (index_str_p);
-
- if (ECMA_IS_VALUE_ERROR (put_value))
- {
- return put_value;
- }
- }
-
-#endif /* JERRY_ESNEXT */
/* 6 - 7. */
- ecma_value_t set_length_value = ecma_builtin_array_prototype_helper_set_length (obj_p, n);
+ ecma_value_t set_length_value = ecma_builtin_array_prototype_helper_set_length (obj_p, (ecma_number_t) length);
if (ECMA_IS_VALUE_ERROR (set_length_value))
{
return set_length_value;
}
- return ecma_make_number_value (n);
+ return ecma_make_length_value (length);
} /* ecma_builtin_array_prototype_object_push */
/**
@@ -550,7 +524,6 @@ ecma_builtin_array_prototype_object_reverse (ecma_value_t this_arg, /**< this ar
ecma_string_t *lower_str_p = ecma_new_ecma_string_from_length (lower);
ecma_string_t *upper_str_p = ecma_new_ecma_string_from_length (upper);
-#if JERRY_ESNEXT
ecma_value_t lower_value = ECMA_VALUE_EMPTY;
ecma_value_t upper_value = ECMA_VALUE_EMPTY;
@@ -595,29 +568,6 @@ ecma_builtin_array_prototype_object_reverse (ecma_value_t this_arg, /**< this ar
goto clean_up;
}
}
-#else /* !JERRY_ESNEXT */
- ecma_value_t lower_value = ecma_op_object_get (obj_p, lower_str_p);
-
- if (ECMA_IS_VALUE_ERROR (lower_value))
- {
- ecma_deref_ecma_string (lower_str_p);
- ecma_deref_ecma_string (upper_str_p);
- return ret_value;
- }
-
- ecma_value_t upper_value = ecma_op_object_get (obj_p, upper_str_p);
-
- if (ECMA_IS_VALUE_ERROR (upper_value))
- {
- goto clean_up;
- }
-
- ecma_value_t has_lower = ecma_op_object_has_property (obj_p, lower_str_p);
- ecma_value_t has_upper = ecma_op_object_has_property (obj_p, upper_str_p);
-
- bool lower_exist = ecma_is_value_true (has_lower);
- bool upper_exist = ecma_is_value_true (has_upper);
-#endif /* JERRY_ESNEXT */
if (lower_exist && upper_exist)
{
@@ -835,7 +785,7 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */
bool use_fast_path = ecma_op_object_is_fast_array (obj_p);
ecma_length_t copied_length = (end > start) ? end - start : 0;
-#if JERRY_ESNEXT
+
ecma_object_t *new_array_p = ecma_op_array_species_create (obj_p, copied_length);
if (JERRY_UNLIKELY (new_array_p == NULL))
@@ -844,9 +794,6 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */
}
use_fast_path &= ecma_op_object_is_fast_array (new_array_p);
-#else /* !JERRY_ESNEXT */
- ecma_object_t *new_array_p = ecma_op_new_array_object (0);
-#endif /* JERRY_ESNEXT */
if (use_fast_path && copied_length > 0)
{
@@ -872,7 +819,6 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */
ecma_extended_object_t *ext_to_obj_p = (ecma_extended_object_t *) new_array_p;
-#if JERRY_ESNEXT
uint32_t target_length = ext_to_obj_p->u.array.length;
ecma_value_t *to_buffer_p;
JERRY_ASSERT (copied_length <= UINT32_MAX);
@@ -890,9 +836,6 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */
ecma_delete_fast_array_properties (new_array_p, (uint32_t) copied_length);
to_buffer_p = ECMA_GET_NON_NULL_POINTER (ecma_value_t, new_array_p->u1.property_list_cp);
}
-#else /* !JERRY_ESNEXT */
- ecma_value_t *to_buffer_p = ecma_fast_array_extend (new_array_p, copied_length);
-#endif /* JERRY_ESNEXT */
ecma_value_t *from_buffer_p = ECMA_GET_NON_NULL_POINTER (ecma_value_t, obj_p->u1.property_list_cp);
@@ -901,9 +844,7 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */
for (uint32_t k = (uint32_t) start; k < (uint32_t) end; k++, n++)
{
-#if JERRY_ESNEXT
ecma_free_value_if_not_object (to_buffer_p[n]);
-#endif /* JERRY_ESNEXT */
to_buffer_p[n] = ecma_copy_value_if_not_object (from_buffer_p[k]);
}
@@ -932,27 +873,21 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */
{
/* 10.c.ii */
ecma_value_t put_comp;
-#if JERRY_ESNEXT
- const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE | JERRY_PROP_SHOULD_THROW;
-#else /* !JERRY_ESNEXT */
- const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE;
-#endif /* JERRY_ESNEXT */
- put_comp = ecma_builtin_helper_def_prop_by_index (new_array_p, n, get_value, prop_flags);
+ put_comp = ecma_builtin_helper_def_prop_by_index (new_array_p,
+ n,
+ get_value,
+ ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE
+ | JERRY_PROP_SHOULD_THROW);
ecma_free_value (get_value);
-#if JERRY_ESNEXT
if (ECMA_IS_VALUE_ERROR (put_comp))
{
ecma_deref_object (new_array_p);
return put_comp;
}
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (ecma_is_value_true (put_comp));
-#endif /* JERRY_ESNEXT */
}
}
-#if JERRY_ESNEXT
ecma_value_t set_length_value = ecma_builtin_array_prototype_helper_set_length (new_array_p, ((ecma_number_t) n));
if (ECMA_IS_VALUE_ERROR (set_length_value))
@@ -960,7 +895,6 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */
ecma_deref_object (new_array_p);
return set_length_value;
}
-#endif /* JERRY_ESNEXT */
return ecma_make_object_value (new_array_p);
} /* ecma_builtin_array_prototype_object_slice */
@@ -1282,7 +1216,6 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu
ecma_length_t new_length = len + insert_count - actual_delete_count;
-#if JERRY_ESNEXT
/* ES11: 8. */
if ((ecma_number_t) new_length > ECMA_NUMBER_MAX_SAFE_INTEGER)
{
@@ -1296,10 +1229,6 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu
{
return ECMA_VALUE_ERROR;
}
-#else /* !JERRY_ESNEXT */
- /* ES5.1: 2. */
- ecma_object_t *new_array_p = ecma_op_new_array_object (actual_delete_count);
-#endif /* JERRY_ESNEXT */
/* ES5.1: 8, ES11: 10. */
ecma_length_t k = 0;
@@ -1318,28 +1247,21 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu
if (ecma_is_value_found (from_present))
{
-#if JERRY_ESNEXT
- const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE | JERRY_PROP_SHOULD_THROW;
-#else /* !JERRY_ESNEXT */
- const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE;
-#endif /* JERRY_ESNEXT */
-
- ecma_value_t put_comp = ecma_builtin_helper_def_prop_by_index (new_array_p, k, from_present, prop_flags);
+ ecma_value_t put_comp = ecma_builtin_helper_def_prop_by_index (new_array_p,
+ k,
+ from_present,
+ ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE
+ | JERRY_PROP_SHOULD_THROW);
ecma_free_value (from_present);
-#if JERRY_ESNEXT
if (ECMA_IS_VALUE_ERROR (put_comp))
{
ecma_deref_object (new_array_p);
return put_comp;
}
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (ecma_is_value_true (put_comp));
-#endif /* JERRY_ESNEXT */
}
}
-#if JERRY_ESNEXT
/* ES11: 12. */
ecma_value_t set_length =
ecma_builtin_array_prototype_helper_set_length (new_array_p, ((ecma_number_t) actual_delete_count));
@@ -1349,7 +1271,6 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu
ecma_deref_object (new_array_p);
return set_length;
}
-#endif /* JERRY_ESNEXT */
/* ES5.1: 12, ES11: 15. */
if (insert_count < actual_delete_count)
@@ -1514,20 +1435,13 @@ ecma_builtin_array_prototype_object_unshift (const ecma_value_t args[], /**< arg
}
}
-#if JERRY_ESNEXT
- const bool should_iterate = args_number > 0;
-#else /* !JERRY_ESNEXT */
- const bool should_iterate = true;
-#endif /* JERRY_ESNEXT */
- if (should_iterate)
+ if (args_number > 0)
{
-#if JERRY_ESNEXT
/* ES11:4.a. */
if ((ecma_number_t) (len + args_number) > ECMA_NUMBER_MAX_SAFE_INTEGER)
{
return ecma_raise_type_error (ECMA_ERR_UNSHIFT_TOO_HIGH);
}
-#endif /* JERRY_ESNEXT */
/* ES5.1:5.,6. ES11: 4.b, 4.c */
for (ecma_length_t k = len; k > 0; k--)
@@ -1943,16 +1857,12 @@ ecma_builtin_array_prototype_object_map (ecma_value_t arg1, /**< callbackfn */
}
/* 6. */
-#if JERRY_ESNEXT
ecma_object_t *new_array_p = ecma_op_array_species_create (obj_p, len);
if (JERRY_UNLIKELY (new_array_p == NULL))
{
return ECMA_VALUE_ERROR;
}
-#else /* !JERRY_ESNEXT */
- ecma_object_t *new_array_p = ecma_op_new_array_object (len);
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (ecma_is_value_object (arg1));
ecma_object_t *func_object_p = ecma_get_object_from_value (arg1);
@@ -1988,24 +1898,20 @@ ecma_builtin_array_prototype_object_map (ecma_value_t arg1, /**< callbackfn */
/* 8.c.iii */
ecma_value_t put_comp;
-#if JERRY_ESNEXT
- const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE | JERRY_PROP_SHOULD_THROW;
-#else /* !JERRY_ESNEXT */
- const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE;
-#endif /* JERRY_ESNEXT */
- put_comp = ecma_builtin_helper_def_prop_by_index (new_array_p, index, mapped_value, prop_flags);
+ put_comp = ecma_builtin_helper_def_prop_by_index (new_array_p,
+ index,
+ mapped_value,
+ ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE
+ | JERRY_PROP_SHOULD_THROW);
ecma_free_value (mapped_value);
ecma_free_value (current_value);
-#if JERRY_ESNEXT
+
if (ECMA_IS_VALUE_ERROR (put_comp))
{
ecma_deref_object (new_array_p);
return put_comp;
}
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (ecma_is_value_true (put_comp));
-#endif /* JERRY_ESNEXT */
}
}
@@ -2034,7 +1940,6 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t arg1, /**< callbackfn *
}
/* 6. */
-#if JERRY_ESNEXT
ecma_object_t *new_array_p = ecma_op_array_species_create (obj_p, 0);
if (JERRY_UNLIKELY (new_array_p == NULL))
@@ -2044,12 +1949,6 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t arg1, /**< callbackfn *
/* ES11: 22.1.3.7. 7.c.iii.1 */
const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE | JERRY_PROP_SHOULD_THROW;
-#else /* !JERRY_ESNEXT */
- ecma_object_t *new_array_p = ecma_op_new_array_object (0);
-
- /* ES5.1: 15.4.4.20. 9.c.iii.1 */
- const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE;
-#endif /* JERRY_ESNEXT */
/* We already checked that arg1 is callable, so it will always be an object. */
JERRY_ASSERT (ecma_is_value_object (arg1));
@@ -2092,7 +1991,7 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t arg1, /**< callbackfn *
{
ecma_value_t put_comp;
put_comp = ecma_builtin_helper_def_prop_by_index (new_array_p, new_array_index, get_value, prop_flags);
-#if JERRY_ESNEXT
+
if (ECMA_IS_VALUE_ERROR (put_comp))
{
ecma_free_value (call_value);
@@ -2101,9 +2000,7 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t arg1, /**< callbackfn *
return put_comp;
}
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (ecma_is_value_true (put_comp));
-#endif /* JERRY_ESNEXT */
+
new_array_index++;
}
@@ -2235,8 +2132,6 @@ ecma_builtin_array_reduce_from (const ecma_value_t args_p[], /**< routine's argu
return accumulator;
} /* ecma_builtin_array_reduce_from */
-#if JERRY_ESNEXT
-
/**
* The Array.prototype object's 'fill' routine
*
@@ -2852,7 +2747,6 @@ ecma_builtin_array_prototype_object_flat_map (ecma_value_t callback, /**< callba
/* 6. */
return ecma_make_object_value (new_array_p);
} /* ecma_builtin_array_prototype_object_flat_map */
-#endif /* JERRY_ESNEXT */
/**
* Dispatcher of the built-in's routines
@@ -2880,12 +2774,6 @@ ecma_builtin_array_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
{
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
-#if !JERRY_ESNEXT
- if (builtin_routine_id == ECMA_ARRAY_PROTOTYPE_TO_STRING)
- {
- ret_value = ecma_array_object_to_string (obj_this);
- }
-#endif /* !JERRY_ESNEXT */
if (builtin_routine_id == ECMA_ARRAY_PROTOTYPE_SORT)
{
ret_value = ecma_builtin_array_prototype_object_sort (this_arg, arguments_list_p[0], obj_p);
@@ -2899,7 +2787,6 @@ ecma_builtin_array_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
return ret_value;
}
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (builtin_routine_id >= ECMA_ARRAY_PROTOTYPE_ENTRIES
&& builtin_routine_id <= ECMA_ARRAY_PROTOTYPE_KEYS))
{
@@ -2918,7 +2805,6 @@ ecma_builtin_array_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
ecma_deref_object (obj_p);
return ret_value;
}
-#endif /* JERRY_ESNEXT */
ecma_length_t length;
ecma_value_t len_value = ecma_op_object_get_length (obj_p, &length);
@@ -3019,7 +2905,6 @@ ecma_builtin_array_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
length);
break;
}
-#if JERRY_ESNEXT
case ECMA_ARRAY_PROTOTYPE_COPY_WITHIN:
{
ret_value = ecma_builtin_array_prototype_object_copy_within (arguments_list_p, arguments_number, obj_p, length);
@@ -3060,7 +2945,6 @@ ecma_builtin_array_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
ecma_builtin_array_prototype_object_flat_map (arguments_list_p[0], arguments_list_p[1], obj_p, length);
break;
}
-#endif /* JERRY_ESNEXT */
default:
{
JERRY_ASSERT (builtin_routine_id == ECMA_ARRAY_PROTOTYPE_FILTER);
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.inc.h
index 4ca296af..19110f78 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.inc.h
@@ -27,12 +27,10 @@
/* ECMA-262 v5, 15.4.4.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, ECMA_BUILTIN_ID_ARRAY, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
-#if JERRY_ESNEXT
/* ECMA-262 v6, 22.1.3.31 */
OBJECT_VALUE (LIT_GLOBAL_SYMBOL_UNSCOPABLES,
ECMA_BUILTIN_ID_ARRAY_PROTOTYPE_UNSCOPABLES,
ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
/* Number properties:
* (property name, object pointer getter) */
@@ -43,9 +41,6 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 0, ECMA_PROPERTY_FLAG_WRITABLE)
/* Routine properties:
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_STRING_UL, ECMA_ARRAY_PROTOTYPE_TO_LOCALE_STRING, 0, 0)
-#if !JERRY_ESNEXT
-ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ECMA_ARRAY_PROTOTYPE_TO_STRING, 0, 0)
-#endif /* !JERRY_ESNEXT */
ROUTINE (LIT_MAGIC_STRING_CONCAT, ECMA_ARRAY_PROTOTYPE_CONCAT, NON_FIXED, 1)
ROUTINE (LIT_MAGIC_STRING_JOIN, ECMA_ARRAY_PROTOTYPE_JOIN, 1, 1)
ROUTINE (LIT_MAGIC_STRING_POP, ECMA_ARRAY_PROTOTYPE_POP, 0, 0)
@@ -68,7 +63,6 @@ ROUTINE (LIT_MAGIC_STRING_FILTER, ECMA_ARRAY_PROTOTYPE_FILTER, 2, 1)
/* Note these 2 routines must be in this order */
ROUTINE (LIT_MAGIC_STRING_REDUCE, ECMA_ARRAY_PROTOTYPE_REDUCE, 2, 1)
ROUTINE (LIT_MAGIC_STRING_REDUCE_RIGHT_UL, ECMA_ARRAY_PROTOTYPE_REDUCE_RIGHT, 2, 1)
-#if JERRY_ESNEXT
ROUTINE (LIT_MAGIC_STRING_FIND, ECMA_ARRAY_PROTOTYPE_FIND, 2, 1)
ROUTINE (LIT_MAGIC_STRING_FIND_INDEX, ECMA_ARRAY_PROTOTYPE_FIND_INDEX, 2, 1)
ROUTINE (LIT_MAGIC_STRING_FILL, ECMA_ARRAY_PROTOTYPE_FILL, 3, 1)
@@ -85,7 +79,6 @@ INTRINSIC_PROPERTY (LIT_MAGIC_STRING_VALUES,
INTRINSIC_PROPERTY (LIT_GLOBAL_SYMBOL_ITERATOR,
LIT_INTERNAL_MAGIC_STRING_ARRAY_PROTOTYPE_VALUES,
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_ARRAY */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array.c b/jerry-core/ecma/builtin-objects/ecma-builtin-array.c
index bfd782e8..2bf7c7b0 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-array.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array.c
@@ -46,11 +46,9 @@ enum
{
ECMA_ARRAY_ROUTINE_START = 0,
ECMA_ARRAY_ROUTINE_IS_ARRAY,
-#if JERRY_ESNEXT
ECMA_ARRAY_ROUTINE_FROM,
ECMA_ARRAY_ROUTINE_OF,
ECMA_ARRAY_ROUTINE_SPECIES_GET
-#endif /* JERRY_ESNEXT */
};
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-array.inc.h"
@@ -67,7 +65,6 @@ enum
* @{
*/
-#if JERRY_ESNEXT
/**
* The Array object's 'from' routine
*
@@ -458,8 +455,6 @@ ecma_builtin_array_object_of (ecma_value_t this_arg, /**< 'this' argument */
return ecma_make_object_value (obj_p);
} /* ecma_builtin_array_object_of */
-#endif /* JERRY_ESNEXT */
-
/**
* Handle calling [[Call]] of built-in Array object
*
@@ -500,9 +495,6 @@ ecma_builtin_array_dispatch_construct (const ecma_value_t *arguments_list_p, /**
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
-#if !JERRY_ESNEXT
- return ecma_builtin_array_dispatch_call (arguments_list_p, arguments_list_len);
-#else /* JERRY_ESNEXT */
ecma_object_t *proto_p =
ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p), ECMA_BUILTIN_ID_ARRAY_PROTOTYPE);
@@ -523,7 +515,6 @@ ecma_builtin_array_dispatch_construct (const ecma_value_t *arguments_list_p, /**
ECMA_SET_NON_NULL_POINTER (object_p->u2.prototype_cp, proto_p);
ecma_deref_object (proto_p);
return result;
-#endif /* JERRY_ESNEXT */
} /* ecma_builtin_array_dispatch_construct */
/**
@@ -549,7 +540,6 @@ ecma_builtin_array_dispatch_routine (uint8_t builtin_routine_id, /**< built-in w
return ecma_is_value_array (arguments_list_p[0]);
}
-#if JERRY_ESNEXT
case ECMA_ARRAY_ROUTINE_FROM:
{
return ecma_builtin_array_object_from (this_arg, arguments_list_p, arguments_number);
@@ -562,7 +552,6 @@ ecma_builtin_array_dispatch_routine (uint8_t builtin_routine_id, /**< built-in w
{
return ecma_copy_value (this_arg);
}
-#endif /* JERRY_ESNEXT */
default:
{
JERRY_UNREACHABLE ();
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-array.inc.h
index 19f8b731..bf43da90 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-array.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array.inc.h
@@ -31,21 +31,16 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_ARRAY_PROTOTYPE, ECMA_
* (property name, object pointer getter) */
NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
-
-#if JERRY_ESNEXT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_ARRAY_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
/* Routine properties:
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
ROUTINE (LIT_MAGIC_STRING_IS_ARRAY_UL, ECMA_ARRAY_ROUTINE_IS_ARRAY, 1, 1)
-#if JERRY_ESNEXT
ROUTINE (LIT_MAGIC_STRING_FROM, ECMA_ARRAY_ROUTINE_FROM, NON_FIXED, 1)
ROUTINE (LIT_MAGIC_STRING_OF, ECMA_ARRAY_ROUTINE_OF, NON_FIXED, 0)
/* ECMA-262 v6, 22.1.2.5 */
ACCESSOR_READ_ONLY (LIT_GLOBAL_SYMBOL_SPECIES, ECMA_ARRAY_ROUTINE_SPECIES_GET, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
#endif /* !(JERRY_BUILTIN_ARRAY) */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.c
index 034df504..43308c86 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.c
@@ -33,8 +33,6 @@
#include "opcodes.h"
#include "vm-defines.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -64,7 +62,7 @@ enum
* \addtogroup ecmabuiltins
* @{
*
- * \addtogroup generator ECMA %AsyncFromSyncIteratorPrototype% object built-in
+ * \addtogroup asyncfromsynciteratorprototype ECMA %AsyncFromSyncIteratorPrototype% object built-in
* @{
*/
@@ -355,5 +353,3 @@ ecma_builtin_async_from_sync_iterator_prototype_dispatch_routine (uint8_t builti
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.inc.h
index c1413fcb..7c5e9c39 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.inc.h
@@ -19,14 +19,10 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* Routine properties:
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
ROUTINE (LIT_MAGIC_STRING_NEXT, ECMA_ASYNC_FROM_SYNC_ITERATOR_PROTOTYPE_ROUTINE_NEXT, 1, 1)
ROUTINE (LIT_MAGIC_STRING_RETURN, ECMA_ASYNC_FROM_SYNC_ITERATOR_PROTOTYPE_ROUTINE_RETURN, 1, 1)
ROUTINE (LIT_MAGIC_STRING_THROW, ECMA_ASYNC_FROM_SYNC_ITERATOR_PROTOTYPE_ROUTINE_THROW, 1, 1)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.c
index 150bb953..6be0c162 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.c
@@ -15,8 +15,6 @@
#include "ecma-globals.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -39,5 +37,3 @@
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.inc.h
index 32e3cfae..e4388d3c 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.inc.h
@@ -19,14 +19,10 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* ECMA-262 v11, 25.7.3.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, ECMA_BUILTIN_ID_ASYNC_FUNCTION, ECMA_PROPERTY_FLAG_CONFIGURABLE)
/* ECMA-262 v11, 25.7.3.2 */
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_ASYNC_FUNCTION_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.c b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.c
index 115af43c..de1a7dbc 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.c
@@ -15,8 +15,6 @@
#include "ecma-globals.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
#include "ecma-function-object.h"
@@ -68,5 +66,3 @@ ecma_builtin_async_function_dispatch_construct (const ecma_value_t *arguments_li
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.inc.h
index fb96a002..0fe50ae2 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.inc.h
@@ -19,8 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* ECMA-262 v11, 25.7.2 */
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_ASYNC_FUNCTION_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
@@ -33,6 +31,4 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_ASYNC_FUNCTION_PROTOTY
/* ECMA-262 v11, 25.7.3.2 */
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_ASYNC_FUNCTION_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.c b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.c
index ad2fcd67..34d442f7 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.c
@@ -15,8 +15,6 @@
#include "ecma-globals.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
#include "ecma-function-object.h"
@@ -31,7 +29,7 @@
* \addtogroup ecmabuiltins
* @{
*
- * \addtogroup asyncgenerator ECMA AsyncGeneratorFunction object built-in
+ * \addtogroup asyncgeneratorfunction ECMA AsyncGeneratorFunction object built-in
* @{
*/
@@ -70,5 +68,3 @@ ecma_builtin_async_generator_function_dispatch_construct (const ecma_value_t *ar
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.inc.h
index 40914c49..edc88c71 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.inc.h
@@ -19,8 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* ECMA-262 v10, 25.3.2 */
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_ASYNC_GENERATOR_FUNCTION_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
@@ -30,6 +28,4 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_CONFIGURABLE)
/* ECMA-262 v6, 25.3.2.2 */
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_ASYNC_GENERATOR, ECMA_PROPERTY_FIXED)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.c
index fb0d84c8..474bd877 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.c
@@ -26,8 +26,6 @@
#include "opcodes.h"
#include "vm-defines.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -57,12 +55,12 @@ enum
* \addtogroup ecmabuiltins
* @{
*
- * \addtogroup asyncgenerator ECMA AsyncGenerator.prototype object built-in
+ * \addtogroup asyncgeneratorprototype ECMA AsyncGenerator.prototype object built-in
* @{
*/
/**
- * Convert routine type to operation type..
+ * Convert routine type to operation type.
*/
#define ECMA_ASYNC_GENERATOR_ROUTINE_TO_OPERATION(type) \
((ecma_async_generator_operation_type_t) ((type) -ECMA_ASYNC_GENERATOR_PROTOTYPE_ROUTINE_NEXT))
@@ -150,5 +148,3 @@ ecma_builtin_async_generator_prototype_dispatch_routine (uint8_t builtin_routine
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.inc.h
index 481c097d..dcad1c62 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.inc.h
@@ -19,8 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* Object properties:
* (property name, object pointer getter) */
@@ -36,6 +34,4 @@ ROUTINE (LIT_MAGIC_STRING_NEXT, ECMA_ASYNC_GENERATOR_PROTOTYPE_ROUTINE_NEXT, 1,
ROUTINE (LIT_MAGIC_STRING_RETURN, ECMA_ASYNC_GENERATOR_PROTOTYPE_ROUTINE_RETURN, 1, 1)
ROUTINE (LIT_MAGIC_STRING_THROW, ECMA_ASYNC_GENERATOR_PROTOTYPE_ROUTINE_THROW, 1, 1)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.c b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.c
index 2f5651b1..46937420 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.c
@@ -15,8 +15,6 @@
#include "ecma-globals.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -39,5 +37,3 @@
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.inc.h
index 076e42cc..a856cbbe 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.inc.h
@@ -19,8 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* ECMA-262 v6, 25.3.2.3.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, ECMA_BUILTIN_ID_ASYNC_GENERATOR_FUNCTION, ECMA_PROPERTY_FLAG_CONFIGURABLE)
@@ -32,6 +30,4 @@ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
LIT_MAGIC_STRING_ASYNC_GENERATOR_FUNCTION_UL,
ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.c
index ec65c765..28579fee 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.c
@@ -17,8 +17,6 @@
#include "ecma-builtins.h"
#include "ecma-iterator-object.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -103,5 +101,3 @@ ecma_builtin_async_iterator_prototype_dispatch_routine (uint8_t builtin_routine_
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.inc.h
index 4a0cb720..53d43d00 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.inc.h
@@ -19,12 +19,8 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* Routine properties:
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
ROUTINE (LIT_GLOBAL_SYMBOL_ASYNC_ITERATOR, ECMA_BUILTIN_ASYNC_ITERATOR_PROTOTYPE_OBJECT_ASYNC_ITERATOR, 0, 0)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-boolean.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-boolean.inc.h
index 51e0c298..36f68455 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-boolean.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-boolean.inc.h
@@ -31,10 +31,7 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE, ECM
* (property name, object pointer getter) */
NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
-
-#if JERRY_ESNEXT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_BOOLEAN_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_BOOLEAN */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c
index 082273e8..5ad4f2d8 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c
@@ -92,9 +92,6 @@ enum
ECMA_DATE_PROTOTYPE_TO_STRING, /* ECMA-262 v5, 15.9.5.2 */
ECMA_DATE_PROTOTYPE_TO_DATE_STRING, /* ECMA-262 v5, 15.9.5.3 */
-#if !JERRY_ESNEXT
- ECMA_DATE_PROTOTYPE_TO_UTC_STRING, /* ECMA-262 v5, 15.9.5.42 */
-#endif /* JERRY_ESNEXT */
ECMA_DATE_PROTOTYPE_TO_TIME_STRING, /* ECMA-262 v5, 15.9.5.4 */
ECMA_DATE_PROTOTYPE_TO_ISO_STRING, /* ECMA-262 v5, 15.9.5.43 */
@@ -102,9 +99,7 @@ enum
ECMA_DATE_PROTOTYPE_SET_TIME, /* ECMA-262 v5, 15.9.5.27 */
ECMA_DATE_PROTOTYPE_TO_JSON, /* ECMA-262 v5, 15.9.5.44 */
-#if JERRY_ESNEXT
ECMA_DATE_PROTOTYPE_TO_PRIMITIVE, /* ECMA-262 v6 20.3.4.45 */
-#endif /* JERRY_ESNEXT */
};
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-date-prototype.inc.h"
@@ -178,7 +173,6 @@ ecma_builtin_date_prototype_to_json (ecma_value_t this_arg) /**< this argument *
return ret_value;
} /* ecma_builtin_date_prototype_to_json */
-#if JERRY_ESNEXT
/**
* The Date.prototype object's toPrimitive routine
*
@@ -216,7 +210,6 @@ ecma_builtin_date_prototype_to_primitive (ecma_value_t this_arg, /**< this argum
return ecma_raise_type_error (ECMA_ERR_INVALID_ARGUMENT_TYPE_IN_TOPRIMITIVE);
} /* ecma_builtin_date_prototype_to_primitive */
-#endif /* JERRY_ESNEXT */
/**
* Dispatch get date functions
@@ -400,28 +393,20 @@ ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< buil
}
}
-#if JERRY_ESNEXT
ecma_date_object_t *date_object_p = (ecma_date_object_t *) object_p;
ecma_number_t *date_value_p = &date_object_p->date_value;
-#else /* !JERRY_ESNEXT */
- ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
- ecma_number_t *date_value_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t, ext_object_p->u.cls.u3.date);
-#endif /* JERRY_ESNEXT */
-
ecma_number_t date_value = *date_value_p;
if (!BUILTIN_DATE_FUNCTION_IS_UTC (builtin_routine_id))
{
ecma_number_t local_tza;
-#if JERRY_ESNEXT
if (date_object_p->header.u.cls.u1.date_flags & ECMA_DATE_TZA_SET)
{
local_tza = date_object_p->header.u.cls.u3.tza;
JERRY_ASSERT (local_tza == ecma_date_local_time_zone_adjustment (date_value));
}
else
-#endif /* JERRY_ESNEXT */
{
local_tza = ecma_date_local_time_zone_adjustment (date_value);
}
@@ -472,9 +457,7 @@ ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< buil
if (ecma_number_is_nan (converted_number[0]))
{
*date_value_p = converted_number[0];
-#if JERRY_ESNEXT
date_object_p->header.u.cls.u1.date_flags &= (uint8_t) ~ECMA_DATE_TZA_SET;
-#endif /* JERRY_ESNEXT */
return ecma_make_number_value (converted_number[0]);
}
@@ -603,9 +586,7 @@ ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< buil
*date_value_p = full_date;
-#if JERRY_ESNEXT
date_object_p->header.u.cls.u1.date_flags &= (uint8_t) ~ECMA_DATE_TZA_SET;
-#endif /* JERRY_ESNEXT */
return ecma_make_number_value (full_date);
} /* ecma_builtin_date_prototype_dispatch_set */
@@ -631,12 +612,10 @@ ecma_builtin_date_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< b
return ecma_builtin_date_prototype_to_json (this_arg);
}
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (builtin_routine_id == ECMA_DATE_PROTOTYPE_TO_PRIMITIVE))
{
return ecma_builtin_date_prototype_to_primitive (this_arg, arguments_list[0]);
}
-#endif /* JERRY_ESNEXT */
if (!ecma_is_value_object (this_arg)
|| !ecma_object_class_is (ecma_get_object_from_value (this_arg), ECMA_OBJECT_CLASS_DATE))
@@ -646,14 +625,8 @@ ecma_builtin_date_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< b
ecma_object_t *this_obj_p = ecma_get_object_from_value (this_arg);
-#if JERRY_ESNEXT
ecma_date_object_t *date_object_p = (ecma_date_object_t *) this_obj_p;
ecma_number_t *date_value_p = &date_object_p->date_value;
-#else /* JERRY_ESNEXT */
- ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) this_obj_p;
- ecma_number_t *date_value_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t, ext_object_p->u.cls.u3.date);
-#endif /* JERRY_ESNEXT */
-
ecma_number_t date_value = *date_value_p;
if (builtin_routine_id == ECMA_DATE_PROTOTYPE_GET_TIME)
@@ -671,9 +644,7 @@ ecma_builtin_date_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< b
}
*date_value_p = ecma_date_time_clip (time_num);
-#if JERRY_ESNEXT
date_object_p->header.u.cls.u1.date_flags &= (uint8_t) ~ECMA_DATE_TZA_SET;
-#endif /* JERRY_ESNEXT */
return ecma_make_number_value (*date_value_p);
}
@@ -685,7 +656,7 @@ ecma_builtin_date_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< b
if (!BUILTIN_DATE_FUNCTION_IS_UTC (builtin_routine_id))
{
ecma_number_t local_tza;
-#if JERRY_ESNEXT
+
if (date_object_p->header.u.cls.u1.date_flags & ECMA_DATE_TZA_SET)
{
local_tza = date_object_p->header.u.cls.u3.tza;
@@ -693,14 +664,11 @@ ecma_builtin_date_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< b
}
else
{
-#endif /* JERRY_ESNEXT */
local_tza = ecma_date_local_time_zone_adjustment (date_value);
-#if JERRY_ESNEXT
JERRY_ASSERT (local_tza <= INT32_MAX && local_tza >= INT32_MIN);
date_object_p->header.u.cls.u3.tza = (int32_t) local_tza;
date_object_p->header.u.cls.u1.date_flags |= ECMA_DATE_TZA_SET;
}
-#endif /* JERRY_ESNEXT */
date_value += local_tza;
}
@@ -736,12 +704,6 @@ ecma_builtin_date_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< b
{
return ecma_date_value_to_date_string (date_value);
}
-#if !JERRY_ESNEXT
- case ECMA_DATE_PROTOTYPE_TO_UTC_STRING:
- {
- return ecma_date_value_to_utc_string (date_value);
- }
-#endif /* JERRY_ESNEXT */
default:
{
JERRY_ASSERT (builtin_routine_id == ECMA_DATE_PROTOTYPE_TO_TIME_STRING);
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h
index ff4f9a20..a960cc45 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h
@@ -65,7 +65,6 @@ ROUTINE (LIT_MAGIC_STRING_SET_FULL_YEAR_UL, ECMA_DATE_PROTOTYPE_SET_FULL_YEAR, N
ROUTINE (LIT_MAGIC_STRING_SET_UTC_FULL_YEAR_UL, ECMA_DATE_PROTOTYPE_SET_UTC_FULL_YEAR, NON_FIXED, 3)
ROUTINE (LIT_MAGIC_STRING_TO_ISO_STRING_UL, ECMA_DATE_PROTOTYPE_TO_ISO_STRING, 0, 0)
ROUTINE (LIT_MAGIC_STRING_TO_JSON_UL, ECMA_DATE_PROTOTYPE_TO_JSON, 1, 1)
-#if JERRY_ESNEXT
ROUTINE_CONFIGURABLE_ONLY (LIT_GLOBAL_SYMBOL_TO_PRIMITIVE, ECMA_DATE_PROTOTYPE_TO_PRIMITIVE, 1, 1)
INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TO_UTC_STRING_UL,
LIT_MAGIC_STRING_TO_UTC_STRING_UL,
@@ -74,16 +73,6 @@ INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TO_UTC_STRING_UL,
INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TO_GMT_STRING_UL,
LIT_MAGIC_STRING_TO_UTC_STRING_UL,
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
-#endif /* JERRY_BUILTIN_ANNEXB */
-#else /* !JERRY_ESNEXT */
-ROUTINE (LIT_MAGIC_STRING_TO_UTC_STRING_UL, ECMA_DATE_PROTOTYPE_TO_UTC_STRING, 0, 0)
-#if JERRY_BUILTIN_ANNEXB
-ROUTINE (LIT_MAGIC_STRING_TO_GMT_STRING_UL, ECMA_DATE_PROTOTYPE_TO_UTC_STRING, 0, 0)
-#endif /* JERRY_BUILTIN_ANNEXB */
-#endif /* !JERRY_ESNEXT */
-
-#if JERRY_BUILTIN_ANNEXB
-
ROUTINE (LIT_MAGIC_STRING_GET_YEAR_UL, ECMA_DATE_PROTOTYPE_GET_YEAR, 0, 0)
ROUTINE (LIT_MAGIC_STRING_SET_YEAR_UL, ECMA_DATE_PROTOTYPE_SET_YEAR, 1, 1)
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-date.c b/jerry-core/ecma/builtin-objects/ecma-builtin-date.c
index af90c7a1..201634d9 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-date.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-date.c
@@ -669,13 +669,7 @@ static ecma_value_t
ecma_builtin_date_utc (const ecma_value_t args[], /**< arguments list */
uint32_t args_number) /**< number of arguments */
{
-#if JERRY_ESNEXT
- const uint32_t required_args_number = 1;
-#else /* !JERRY_ESNEXT */
- const uint32_t required_args_number = 2;
-#endif /* JERRY_ESNEXT */
-
- if (args_number < required_args_number)
+ if (args_number < 1)
{
return ecma_make_nan_value ();
}
@@ -712,7 +706,6 @@ ecma_builtin_date_now_helper (void)
static ecma_value_t
ecma_builtin_date_create (ecma_number_t tv)
{
-#if JERRY_ESNEXT
JERRY_ASSERT (JERRY_CONTEXT (current_new_target_p) != NULL);
ecma_object_t *prototype_obj_p =
@@ -731,17 +724,6 @@ ecma_builtin_date_create (ecma_number_t tv)
date_object_p->header.u.cls.u1.date_flags = ECMA_DATE_TZA_NONE;
date_object_p->header.u.cls.u3.tza = 0;
date_object_p->date_value = tv;
-#else /* !JERRY_ESNEXT */
- ecma_number_t *date_value_p = ecma_alloc_number ();
- *date_value_p = tv;
-
- ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_DATE_PROTOTYPE);
- ecma_object_t *obj_p = ecma_create_object (prototype_obj_p, sizeof (ecma_extended_object_t), ECMA_OBJECT_TYPE_CLASS);
-
- ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
- ext_object_p->u.cls.type = ECMA_OBJECT_CLASS_DATE;
- ECMA_SET_INTERNAL_VALUE_POINTER (ext_object_p->u.cls.u3.date, date_value_p);
-#endif /* JERRY_ESNEXT */
return ecma_make_object_value (obj_p);
} /* ecma_builtin_date_create */
@@ -793,14 +775,7 @@ ecma_builtin_date_dispatch_construct (const ecma_value_t *arguments_list_p, /**<
if (ecma_is_value_object (argument)
&& ecma_object_class_is (ecma_get_object_from_value (argument), ECMA_OBJECT_CLASS_DATE))
{
-#if JERRY_ESNEXT
- tv = ((ecma_date_object_t *) ecma_get_object_from_value (argument))->date_value;
-#else /* !JERRY_ESNEXT */
- ecma_extended_object_t *arg_ext_object_p = (ecma_extended_object_t *) ecma_get_object_from_value (argument);
- tv = *ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t, arg_ext_object_p->u.cls.u3.date);
-#endif /* JERRY_ESNEXT */
-
- return ecma_builtin_date_create (tv);
+ return ecma_builtin_date_create (((ecma_date_object_t *) ecma_get_object_from_value (argument))->date_value);
}
/* 4.b */
ecma_value_t primitive = ecma_op_to_primitive (argument, ECMA_PREFERRED_TYPE_NO);
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-date.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-date.inc.h
index f390e0dd..a50ac00f 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-date.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-date.inc.h
@@ -30,9 +30,7 @@ ROUTINE (LIT_MAGIC_STRING_PARSE, ECMA_DATE_ROUTINE_PARSE, 1, 1)
ROUTINE (LIT_MAGIC_STRING_UTC_U, ECMA_DATE_ROUTINE_UTC, NON_FIXED, 7)
ROUTINE (LIT_MAGIC_STRING_NOW, ECMA_DATE_ROUTINE_NOW, 0, 0)
-#if JERRY_ESNEXT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_DATE_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_DATE */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-error.c b/jerry-core/ecma/builtin-objects/ecma-builtin-error.c
index 1f8dedda..846186a1 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-error.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-error.c
@@ -65,9 +65,6 @@ ecma_value_t
ecma_builtin_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
uint32_t arguments_list_len) /**< number of arguments */
{
-#if !JERRY_ESNEXT
- return ecma_builtin_error_dispatch_call (arguments_list_p, arguments_list_len);
-#else /* JERRY_ESNEXT */
ecma_object_t *proto_p =
ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p), ECMA_BUILTIN_ID_ERROR_PROTOTYPE);
@@ -87,7 +84,6 @@ ecma_builtin_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**
ecma_deref_object (proto_p);
return result;
-#endif /* JERRY_ESNEXT */
} /* ecma_builtin_error_dispatch_construct */
/**
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-error.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-error.inc.h
index 7098dd95..d8cff1bd 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-error.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-error.inc.h
@@ -30,8 +30,6 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
/* ECMA-262 v5, 15.7.3.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_ERROR_PROTOTYPE, ECMA_PROPERTY_FIXED)
-#if JERRY_ESNEXT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.c b/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.c
index 3804420d..341d179b 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.c
@@ -67,9 +67,6 @@ ecma_value_t
ecma_builtin_eval_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
uint32_t arguments_list_len) /**< number of arguments */
{
-#if !JERRY_ESNEXT
- return ecma_builtin_eval_error_dispatch_call (arguments_list_p, arguments_list_len);
-#else /* JERRY_ESNEXT */
ecma_object_t *proto_p =
ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p), ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE);
@@ -89,7 +86,6 @@ ecma_builtin_eval_error_dispatch_construct (const ecma_value_t *arguments_list_p
ecma_deref_object (proto_p);
return result;
-#endif /* JERRY_ESNEXT */
} /* ecma_builtin_eval_error_dispatch_construct */
/**
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h
index 9efa35f6..29c8f966 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h
@@ -32,9 +32,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
/* ECMA-262 v5, 15.11.3.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE, ECMA_PROPERTY_FIXED)
-#if JERRY_ESNEXT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_EVAL_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_ERRORS */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c
index 8910eaaa..e7f0b1f9 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c
@@ -48,9 +48,7 @@ enum
ECMA_FUNCTION_PROTOTYPE_CALL,
ECMA_FUNCTION_PROTOTYPE_APPLY,
ECMA_FUNCTION_PROTOTYPE_BIND,
-#if JERRY_ESNEXT
ECMA_FUNCTION_PROTOTYPE_SYMBOL_HAS_INSTANCE,
-#endif /* JERRY_ESNEXT */
};
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-function-prototype.inc.h"
@@ -103,12 +101,10 @@ ecma_builtin_function_prototype_object_to_string (ecma_object_t *func_obj_p) /**
if (extended_info & CBC_EXTENDED_CODE_FLAGS_HAS_SOURCE_CODE_RANGE)
{
-#if JERRY_ESNEXT
if (extended_info & CBC_EXTENDED_CODE_FLAGS_HAS_ARGUMENT_LENGTH)
{
ecma_extended_info_decode_vlq (&extended_info_p);
}
-#endif /* JERRY_ESNEXT */
uint32_t range_start = ecma_extended_info_decode_vlq (&extended_info_p);
uint32_t range_size = ecma_extended_info_decode_vlq (&extended_info_p);
@@ -159,7 +155,6 @@ ecma_builtin_function_prototype_object_to_string (ecma_object_t *func_obj_p) /**
lit_magic_string_id_t header_id = LIT_MAGIC_STRING_FUNCTION_TO_STRING_ANON;
-#if JERRY_ESNEXT
switch (CBC_FUNCTION_GET_TYPE (bytecode_p->status_flags))
{
case CBC_FUNCTION_GENERATOR:
@@ -178,7 +173,6 @@ ecma_builtin_function_prototype_object_to_string (ecma_object_t *func_obj_p) /**
break;
}
}
-#endif /* JERRY_ESNEXT */
ecma_stringbuilder_t builder = ecma_stringbuilder_create_from (ecma_get_magic_string (header_id));
ecma_value_t function_arguments = CBC_SCRIPT_GET_FUNCTION_ARGUMENTS (script_p, script_p->refs_and_type);
@@ -314,9 +308,6 @@ ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p, /**<
/* 4. 11. 18. */
ecma_object_t *prototype_obj_p;
-#if !JERRY_ESNEXT
- prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE);
-#else /* JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
if (ECMA_OBJECT_IS_PROXY (this_arg_obj_p))
{
@@ -344,7 +335,6 @@ ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p, /**<
#if JERRY_BUILTIN_PROXY
}
#endif /* JERRY_BUILTIN_PROXY */
-#endif /* !JERRY_ESNEXT */
ecma_object_t *function_p;
ecma_bound_function_t *bound_func_p;
@@ -390,7 +380,6 @@ ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p, /**<
bound_func_p->header.u.bound_function.args_len_or_this = args_len_or_this;
}
-#if JERRY_ESNEXT
if (prototype_obj_p != NULL)
{
ecma_deref_object (prototype_obj_p);
@@ -461,7 +450,6 @@ ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p, /**<
NULL);
name_prop_value_p->value = bound_function_name;
-#endif /* JERRY_ESNEXT */
/*
* [[Class]] property is not stored explicitly for objects of ECMA_OBJECT_TYPE_FUNCTION type.
@@ -516,12 +504,10 @@ ecma_builtin_function_prototype_dispatch_routine (uint8_t builtin_routine_id, /*
{
if (!ecma_op_is_callable (this_arg))
{
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (builtin_routine_id == ECMA_FUNCTION_PROTOTYPE_SYMBOL_HAS_INSTANCE))
{
return ECMA_VALUE_FALSE;
}
-#endif /* JERRY_ESNEXT */
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_FUNCTION);
}
@@ -546,12 +532,10 @@ ecma_builtin_function_prototype_dispatch_routine (uint8_t builtin_routine_id, /*
{
return ecma_builtin_function_prototype_object_bind (func_obj_p, arguments_list_p, arguments_number);
}
-#if JERRY_ESNEXT
case ECMA_FUNCTION_PROTOTYPE_SYMBOL_HAS_INSTANCE:
{
return ecma_op_object_has_instance (func_obj_p, arguments_list_p[0]);
}
-#endif /* JERRY_ESNEXT */
default:
{
JERRY_UNREACHABLE ();
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.inc.h
index 46261d2d..8bab444f 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.inc.h
@@ -29,10 +29,7 @@ OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, ECMA_BUILTIN_ID_FUNCTION, ECMA_PROPE
* (property name, object pointer getter) */
NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 0, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
-
-#if JERRY_ESNEXT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING__EMPTY, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
/* Routine properties:
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
@@ -41,7 +38,6 @@ ROUTINE (LIT_MAGIC_STRING_APPLY, ECMA_FUNCTION_PROTOTYPE_APPLY, 2, 2)
ROUTINE (LIT_MAGIC_STRING_CALL, ECMA_FUNCTION_PROTOTYPE_CALL, NON_FIXED, 1)
ROUTINE (LIT_MAGIC_STRING_BIND, ECMA_FUNCTION_PROTOTYPE_BIND, NON_FIXED, 1)
-#if JERRY_ESNEXT
/**
* ECMA-262 v6.0 19.2.3.6 @@hasInstance
* the property attributes are: { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
@@ -55,6 +51,5 @@ ACCESSOR_BUILTIN_FUNCTION (LIT_MAGIC_STRING_CALLER,
ECMA_BUILTIN_ID_TYPE_ERROR_THROWER,
ECMA_BUILTIN_ID_TYPE_ERROR_THROWER,
ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-function.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-function.inc.h
index 388755de..92e50eda 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-function.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-function.inc.h
@@ -29,9 +29,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, EC
* (property name, object pointer getter) */
NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
-
-#if JERRY_ESNEXT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_FUNCTION_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.c b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.c
index 14907dd1..acb25eec 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.c
@@ -15,8 +15,6 @@
#include "ecma-globals.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
#include "ecma-function-object.h"
@@ -31,7 +29,7 @@
* \addtogroup ecmabuiltins
* @{
*
- * \addtogroup generator ECMA GeneratorFunction object built-in
+ * \addtogroup generatorfunction ECMA GeneratorFunction object built-in
* @{
*/
@@ -68,5 +66,3 @@ ecma_builtin_generator_function_dispatch_construct (const ecma_value_t *argument
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.inc.h
index a6d60bdc..39416a91 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.inc.h
@@ -19,8 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* ECMA-262 v6, 25.2.2 */
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_GENERATOR_FUNCTION_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
@@ -30,6 +28,4 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_CONFIGURABLE)
/* ECMA-262 v6, 25.2.2.2 */
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_GENERATOR, ECMA_PROPERTY_FIXED)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.c
index 703f6e1d..15afb4d1 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.c
@@ -24,8 +24,6 @@
#include "opcodes.h"
#include "vm-defines.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -55,12 +53,12 @@ enum
* \addtogroup ecmabuiltins
* @{
*
- * \addtogroup generator ECMA Generator.prototype object built-in
+ * \addtogroup generatorprototype ECMA Generator.prototype object built-in
* @{
*/
/**
- * Convert routine type to operation type..
+ * Convert routine type to operation type.
*/
#define ECMA_GENERATOR_ROUTINE_TO_OPERATION(type) \
((ecma_iterator_command_type_t) ((type) -ECMA_GENERATOR_PROTOTYPE_ROUTINE_NEXT))
@@ -252,5 +250,3 @@ ecma_builtin_generator_prototype_dispatch_routine (uint8_t builtin_routine_id, /
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.inc.h
index 4028b4e8..07086dbd 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.inc.h
@@ -19,8 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* Object properties:
* (property name, object pointer getter) */
@@ -36,6 +34,4 @@ ROUTINE (LIT_MAGIC_STRING_NEXT, ECMA_GENERATOR_PROTOTYPE_ROUTINE_NEXT, 1, 1)
ROUTINE (LIT_MAGIC_STRING_RETURN, ECMA_GENERATOR_PROTOTYPE_ROUTINE_RETURN, 1, 1)
ROUTINE (LIT_MAGIC_STRING_THROW, ECMA_GENERATOR_PROTOTYPE_ROUTINE_THROW, 1, 1)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-generator.c b/jerry-core/ecma/builtin-objects/ecma-builtin-generator.c
index 29045609..6d822933 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-generator.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-generator.c
@@ -15,8 +15,6 @@
#include "ecma-globals.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -39,5 +37,3 @@
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-generator.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-generator.inc.h
index bf3fc2f5..b45bd937 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-generator.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-generator.inc.h
@@ -19,8 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* ECMA-262 v6, 25.3.2.3.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, ECMA_BUILTIN_ID_GENERATOR_FUNCTION, ECMA_PROPERTY_FLAG_CONFIGURABLE)
@@ -30,6 +28,4 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_GENERATOR_PROTOTYPE, E
/* ECMA-262 v6, 25.3.2.3.3 */
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_GENERATOR_FUNCTION_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-global.c b/jerry-core/ecma/builtin-objects/ecma-builtin-global.c
index 6cc44663..d9ccc8ff 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-global.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-global.c
@@ -100,12 +100,10 @@ ecma_builtin_global_object_eval (ecma_value_t x) /**< routine's first argument *
parse_opts |= ECMA_PARSE_STRICT_MODE;
}
-#if JERRY_ESNEXT
if (vm_is_direct_eval_form_call ())
{
parse_opts |= ECMA_GET_LOCAL_PARSE_OPTS ();
}
-#endif /* JERRY_ESNEXT */
/* steps 2 to 8 */
return ecma_op_eval (x, parse_opts);
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h
index 6048dfd4..e0b02698 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h
@@ -173,14 +173,12 @@ OBJECT_VALUE (LIT_MAGIC_STRING_WEAKMAP_UL, ECMA_BUILTIN_ID_WEAKMAP, ECMA_PROPERT
OBJECT_VALUE (LIT_MAGIC_STRING_WEAKREF_UL, ECMA_BUILTIN_ID_WEAKREF, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
#endif /* JERRY_BUILTIN_WEAKREF */
-#if JERRY_ESNEXT
OBJECT_VALUE (LIT_MAGIC_STRING_AGGREGATE_ERROR_UL, ECMA_BUILTIN_ID_AGGREGATE_ERROR, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
OBJECT_VALUE (LIT_MAGIC_STRING_PROMISE_UL, ECMA_BUILTIN_ID_PROMISE, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
/* ECMA-262 v6, 19.4.1.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_SYMBOL_UL, ECMA_BUILTIN_ID_SYMBOL, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_GLOBAL_THIS
/* ECMA-262 v11, 18.1.1 */
@@ -212,14 +210,10 @@ ROUTINE (LIT_MAGIC_STRING_DECODE_URI, ECMA_GLOBAL_DECODE_URI, 1, 1)
ROUTINE (LIT_MAGIC_STRING_DECODE_URI_COMPONENT, ECMA_GLOBAL_DECODE_URI_COMPONENT, 1, 1)
ROUTINE (LIT_MAGIC_STRING_ENCODE_URI, ECMA_GLOBAL_ENCODE_URI, 1, 1)
ROUTINE (LIT_MAGIC_STRING_ENCODE_URI_COMPONENT, ECMA_GLOBAL_ENCODE_URI_COMPONENT, 1, 1)
-#if JERRY_ESNEXT
+
INTRINSIC_PROPERTY (LIT_MAGIC_STRING_PARSE_FLOAT, LIT_MAGIC_STRING_PARSE_FLOAT, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
INTRINSIC_PROPERTY (LIT_MAGIC_STRING_PARSE_INT, LIT_MAGIC_STRING_PARSE_INT, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
-#else /* !JERRY_ESNEXT */
-ROUTINE (LIT_MAGIC_STRING_PARSE_FLOAT, ECMA_GLOBAL_PARSE_FLOAT, 1, 1)
-ROUTINE (LIT_MAGIC_STRING_PARSE_INT, ECMA_GLOBAL_PARSE_INT, 2, 2)
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_ANNEXB
ROUTINE (LIT_MAGIC_STRING_ESCAPE, ECMA_GLOBAL_ESCAPE, 1, 1)
ROUTINE (LIT_MAGIC_STRING_UNESCAPE, ECMA_GLOBAL_UNESCAPE, 1, 1)
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.c b/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.c
index d727f026..3a048d22 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.c
@@ -13,24 +13,26 @@
* limitations under the License.
*/
-#include "ecma-globals.h"
-
-#if JERRY_ESNEXT
-
#include "ecma-builtin-handlers.h"
+
+#include "ecma-globals.h"
#include "ecma-iterator-object.h"
#include "ecma-promise-object.h"
static const ecma_builtin_handler_t ecma_native_handlers[] = {
+/** @cond doxygen_suppress */
#define ECMA_NATIVE_HANDLER(id, handler, length) handler,
#include "ecma-builtin-handlers.inc.h"
#undef ECMA_NATIVE_HANDLER
+ /** @endcond */
};
static const uint8_t ecma_native_handler_lengths[] = {
+/** @cond doxygen_suppress */
#define ECMA_NATIVE_HANDLER(id, handler, length) length,
#include "ecma-builtin-handlers.inc.h"
#undef ECMA_NATIVE_HANDLER
+ /** @endcond */
};
/**
@@ -56,5 +58,3 @@ ecma_builtin_handler_get_length (ecma_native_handler_id_t id) /**< handler id */
JERRY_ASSERT (id != ECMA_NATIVE_HANDLER_START && id < ECMA_NATIVE_HANDLER__COUNT);
return ecma_native_handler_lengths[id - 1];
} /* ecma_builtin_handler_get_length */
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.h b/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.h
index 21e96311..01434739 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.h
@@ -16,22 +16,21 @@
#ifndef ECMA_BUILTIN_HANDLERS_H
#define ECMA_BUILTIN_HANDLERS_H
-#include "ecma-globals.h"
-
-#if JERRY_ESNEXT
-
#include "ecma-builtins.h"
+#include "ecma-globals.h"
#include "ecma-helpers.h"
#include "ecma-promise-object.h"
#include "ecma-proxy-object.h"
typedef enum
{
+ /** @cond doxygen_suppress */
ECMA_NATIVE_HANDLER_START = 0,
#define ECMA_NATIVE_HANDLER(id, handler, length) id,
#include "ecma-builtin-handlers.inc.h"
#undef ECMA_NATIVE_HANDLER
ECMA_NATIVE_HANDLER__COUNT
+ /** @endcond */
} ecma_native_handler_id_t;
typedef enum
@@ -49,6 +48,4 @@ typedef enum
ecma_builtin_handler_t ecma_builtin_handler_get (ecma_native_handler_id_t id);
uint8_t ecma_builtin_handler_get_length (ecma_native_handler_id_t id);
-#endif /* JERRY_ESNEXT */
-
#endif /* !ECMA_BUILTIN_HANDLERS_H */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-defines.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-defines.inc.h
index 94cf6801..cbd81c69 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-defines.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-defines.inc.h
@@ -25,7 +25,6 @@
#define STRING_VALUE(name, magic_string_id, prop_attributes)
#endif /* !STRING_VALUE */
-#if JERRY_ESNEXT
#ifndef SYMBOL_VALUE
#define SYMBOL_VALUE(symbol, desc_magic_string_id)
#endif /* !SYMBOL_VALUE */
@@ -37,7 +36,6 @@
#ifndef ACCESSOR_BUILTIN_FUNCTION_OBJECT
#define ACCESSOR_BUILTIN_FUNCTION_OBJECT(name, getter_builtin_id, setter_builtin_id, prop_attributes)
#endif /* !ACCESSOR_BUILTIN_FUNCTION_OBJECT */
-#endif /* JERRY_ESNEXT */
#ifndef OBJECT_VALUE
#define OBJECT_VALUE(name, obj_builtin_id, prop_attributes)
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-undefs.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-undefs.inc.h
index 951c5fb4..3d053c5d 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-undefs.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-undefs.inc.h
@@ -16,11 +16,9 @@
#undef SIMPLE_VALUE
#undef NUMBER_VALUE
#undef STRING_VALUE
-#if JERRY_ESNEXT
#undef SYMBOL_VALUE
#undef INTRINSIC_PROPERTY
#undef ACCESSOR_BUILTIN_FUNCTION_OBJECT
-#endif /* JERRY_ESNEXT */
#undef OBJECT_VALUE
#undef ROUTINE
#undef ROUTINE_CONFIGURABLE_ONLY
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c
index 90104af4..e298fad4 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c
@@ -37,7 +37,6 @@
* @{
*/
-#if JERRY_ESNEXT
/**
* Helper function for Object.prototype.toString routine when
* the @@toStringTag property is present
@@ -100,7 +99,6 @@ ecma_builtin_helper_object_to_string_tag_helper (ecma_value_t tag_value) /**< st
return ecma_make_string_value (ret_string_p);
} /* ecma_builtin_helper_object_to_string_tag_helper */
-#endif /* JERRY_ESNEXT */
/**
* Common implementation of the Object.prototype.toString routine
@@ -144,7 +142,6 @@ ecma_builtin_helper_object_to_string (const ecma_value_t this_arg) /**< this arg
builtin_tag = ecma_object_get_class_name (obj_p);
-#if JERRY_ESNEXT
ecma_value_t is_array = ecma_is_value_array (obj_this);
if (ECMA_IS_VALUE_ERROR (is_array))
@@ -181,8 +178,6 @@ ecma_builtin_helper_object_to_string (const ecma_value_t this_arg) /**< this arg
}
ecma_free_value (tag);
-#endif /* JERRY_ESNEXT */
-
ecma_deref_object (obj_p);
}
@@ -260,7 +255,6 @@ ecma_builtin_helper_array_index_normalize (ecma_value_t arg, /**< index */
ecma_length_t length, /**< array's length */
ecma_length_t *number_p) /**< [out] ecma_length_t */
{
-#if JERRY_ESNEXT
ecma_number_t to_int;
if (ECMA_IS_VALUE_ERROR (ecma_op_to_integer (arg, &to_int)))
@@ -272,9 +266,6 @@ ecma_builtin_helper_array_index_normalize (ecma_value_t arg, /**< index */
: (ecma_length_t) JERRY_MIN (to_int, (ecma_number_t) length));
return ECMA_VALUE_EMPTY;
-#else /* !JERRY_ESNEXT */
- return ecma_builtin_helper_uint32_index_normalize (arg, length, number_p);
-#endif /* JERRY_ESNEXT */
} /* ecma_builtin_helper_array_index_normalize */
/**
@@ -336,7 +327,6 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array *
ecma_value_t value) /**< value to concat */
{
/* 5.b */
-#if JERRY_ESNEXT
ecma_value_t is_spreadable = ecma_op_is_concat_spreadable (value);
if (ECMA_IS_VALUE_ERROR (is_spreadable))
@@ -347,17 +337,11 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array *
bool spread_object = is_spreadable == ECMA_VALUE_TRUE;
/* ES11: 22.1.3.1.5.c.iv.3.b */
const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE | JERRY_PROP_SHOULD_THROW;
-#else /* !JERRY_ESNEXT */
- /* ES5.1: 15.4.4.4.5.b.iii.3.b */
- const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE;
- bool spread_object = ecma_is_value_true (ecma_is_value_array (value));
-#endif /* JERRY_ESNEXT */
if (spread_object)
{
ecma_object_t *obj_p = ecma_get_object_from_value (value);
-#if JERRY_ESNEXT
ecma_length_t arg_len;
ecma_value_t error = ecma_op_object_get_length (obj_p, &arg_len);
@@ -371,10 +355,7 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array *
{
return ecma_raise_type_error (ECMA_ERR_INVALID_ARRAY_LENGTH);
}
-#else /* !JERRY_ESNEXT */
- /* 5.b.ii */
- uint32_t arg_len = ecma_array_get_length (obj_p);
-#endif /* JERRY_ESNEXT */
+
/* 5.b.iii */
for (ecma_length_t array_index = 0; array_index < arg_len; array_index++)
{
@@ -396,14 +377,11 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array *
ecma_value_t put_comp =
ecma_builtin_helper_def_prop_by_index (array_obj_p, *length_p + array_index, get_value, prop_flags);
ecma_free_value (get_value);
-#if JERRY_ESNEXT
+
if (ECMA_IS_VALUE_ERROR (put_comp))
{
return put_comp;
}
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (ecma_is_value_true (put_comp));
-#endif /* JERRY_ESNEXT */
}
*length_p += arg_len;
@@ -414,14 +392,10 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array *
/* This will always be a simple value since 'is_throw' is false, so no need to free. */
ecma_value_t put_comp = ecma_builtin_helper_def_prop_by_index (array_obj_p, (*length_p)++, value, prop_flags);
-#if JERRY_ESNEXT
if (ECMA_IS_VALUE_ERROR (put_comp))
{
return put_comp;
}
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (ecma_is_value_true (put_comp));
-#endif /* JERRY_ESNEXT */
return ECMA_VALUE_EMPTY;
} /* ecma_builtin_helper_array_concat_value */
@@ -578,7 +552,6 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
/* 5 (indexOf) -- 6 (lastIndexOf) */
const lit_utf8_size_t original_len = ecma_string_get_length (original_str_p);
-#if JERRY_ESNEXT
/* 4, 6 (startsWith, includes, endsWith) */
if (mode >= ECMA_STRING_STARTS_WITH)
{
@@ -595,7 +568,6 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
return ecma_raise_type_error (ECMA_ERR_SEARCH_STRING_CANNOT_BE_OF_TYPE_REGEXP);
}
}
-#endif /* JERRY_ESNEXT */
/* 7, 8 */
ecma_string_t *search_str_p = ecma_op_to_string (arg1);
@@ -609,18 +581,15 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
/* 4 (indexOf, lastIndexOf), 9 (startsWith, includes), 10 (endsWith) */
ecma_number_t pos_num;
-#if JERRY_ESNEXT
+
if (mode > ECMA_STRING_LAST_INDEX_OF)
{
ret_value = ecma_op_to_integer (arg2, &pos_num);
}
else
{
-#endif /* JERRY_ESNEXT */
ret_value = ecma_op_to_number (arg2, &pos_num);
-#if JERRY_ESNEXT
}
-#endif /* JERRY_ESNEXT */
/* 10 (startsWith, includes), 11 (endsWith) */
if (ECMA_IS_VALUE_ERROR (ret_value))
@@ -640,7 +609,6 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
switch (mode)
{
-#if JERRY_ESNEXT
case ECMA_STRING_STARTS_WITH:
{
if (start > original_len)
@@ -685,8 +653,6 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
ret_value = ecma_make_boolean_value (index == (uint32_t) start_ends_with);
break;
}
-#endif /* JERRY_ESNEXT */
-
case ECMA_STRING_INDEX_OF:
{
/* 8 (indexOf) -- 9 (lastIndexOf) */
@@ -932,7 +898,6 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
}
case LIT_CHAR_AMPERSAND:
{
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (ctx_p->matched_p == NULL))
{
JERRY_ASSERT (ctx_p->capture_count == 0);
@@ -944,7 +909,6 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
ecma_stringbuilder_append (&(ctx_p->builder), ecma_get_string_from_value (match_value));
break;
}
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (ctx_p->matched_p != NULL);
ecma_stringbuilder_append_raw (&(ctx_p->builder), ctx_p->matched_p, ctx_p->matched_size);
@@ -957,7 +921,6 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
}
case LIT_CHAR_SINGLE_QUOTE:
{
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (ctx_p->matched_p == NULL))
{
JERRY_ASSERT (ctx_p->capture_count == 0);
@@ -975,7 +938,6 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
(lit_utf8_size_t) (ctx_p->string_p + ctx_p->string_size - begin_p));
break;
}
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (ctx_p->matched_p != NULL);
ecma_stringbuilder_append_raw (&(ctx_p->builder),
@@ -990,12 +952,11 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
if (lit_char_is_decimal_digit (c))
{
uint32_t capture_count = ctx_p->capture_count;
-#if JERRY_ESNEXT
+
if (capture_count == 0 && ctx_p->u.collection_p != NULL)
{
capture_count = ctx_p->u.collection_p->item_count;
}
-#endif /* JERRY_ESNEXT */
uint8_t idx = (uint8_t) (c - LIT_CHAR_0);
if (curr_p < replace_end_p && lit_char_is_decimal_digit (*(curr_p)))
@@ -1026,7 +987,6 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
break;
#endif /* JERRY_BUILTIN_REGEXP */
}
-#if JERRY_ESNEXT
else if (ctx_p->u.collection_p != NULL)
{
const ecma_value_t capture_value = ctx_p->u.collection_p->buffer_p[idx];
@@ -1037,7 +997,6 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
break;
}
-#endif /* JERRY_ESNEXT */
}
}
@@ -1062,6 +1021,19 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
} /* ecma_builtin_replace_substitute */
/**
+ * Helper function to determine if method is the builtin exec method
+ *
+ * @return true, if function is the builtin exec method
+ * false, otherwise
+ */
+extern inline bool JERRY_ATTR_ALWAYS_INLINE
+ecma_builtin_is_regexp_exec (ecma_extended_object_t *obj_p) /**< function object */
+{
+ return (ecma_get_object_type (&obj_p->object) == ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION
+ && obj_p->u.built_in.routine_id == ECMA_REGEXP_PROTOTYPE_ROUTINE_EXEC);
+} /* ecma_builtin_is_regexp_exec */
+
+/**
* @}
* @}
*/
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h
index 71ae115b..482cf8fa 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h
@@ -29,6 +29,37 @@
*/
/**
+ * List of built-in routine identifiers.
+ */
+enum
+{
+ /** These routines must be in this order */
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_START = 0,
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_EXEC,
+#if JERRY_BUILTIN_ANNEXB
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_COMPILE,
+#endif /* JERRY_BUILTIN_ANNEXB */
+
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_TEST,
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_TO_STRING,
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_SOURCE,
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_FLAGS,
+
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_GLOBAL,
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_IGNORE_CASE,
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_MULTILINE,
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_STICKY,
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_UNICODE,
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_DOT_ALL,
+
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_SEARCH,
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_MATCH,
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_REPLACE,
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_SPLIT,
+ ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_MATCH_ALL,
+};
+
+/**
* Mode of string index routine.
*/
typedef enum
@@ -90,10 +121,7 @@ typedef struct
} ecma_replace_context_t;
void ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p);
-
-#if JERRY_ESNEXT
bool ecma_builtin_is_regexp_exec (ecma_extended_object_t *obj_p);
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_DATE
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h
index be175c23..3755f612 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h
@@ -141,7 +141,6 @@ const ecma_builtin_property_descriptor_t PROPERTY_DESCRIPTOR_LIST_NAME[] = {
{ name, ECMA_BUILTIN_PROPERTY_NUMBER, (prop_attributes) | ECMA_PROPERTY_FLAG_BUILT_IN, number_value },
#define STRING_VALUE(name, magic_string_id, prop_attributes) \
{ name, ECMA_BUILTIN_PROPERTY_STRING, (prop_attributes) | ECMA_PROPERTY_FLAG_BUILT_IN, magic_string_id },
-#if JERRY_ESNEXT
#define SYMBOL_VALUE(name, symbol) { name, ECMA_BUILTIN_PROPERTY_SYMBOL, ECMA_PROPERTY_BUILT_IN_FIXED, symbol },
#define INTRINSIC_PROPERTY(name, magic_string_id, prop_attributes) \
{ name, ECMA_BUILTIN_PROPERTY_INTRINSIC_PROPERTY, (prop_attributes) | ECMA_PROPERTY_FLAG_BUILT_IN, magic_string_id },
@@ -150,7 +149,6 @@ const ecma_builtin_property_descriptor_t PROPERTY_DESCRIPTOR_LIST_NAME[] = {
ECMA_BUILTIN_PROPERTY_ACCESSOR_BUILTIN_FUNCTION, \
(prop_attributes) | ECMA_PROPERTY_FLAG_BUILT_IN, \
ECMA_ACCESSOR_READ_WRITE (getter_builtin_id, setter_builtin_id) },
-#endif /* JERRY_ESNEXT */
#include BUILTIN_INC_HEADER_NAME
{ LIT_MAGIC_STRING__COUNT, ECMA_BUILTIN_PROPERTY_END, 0, 0 }
};
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.c b/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.c
index 0134afa6..66519dcd 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.c
@@ -25,8 +25,6 @@
#include "lit-char-helpers.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -106,7 +104,7 @@ ecma_builtin_intrinsic_array_prototype_values (ecma_value_t this_value) /**< thi
* Returned value must be freed with ecma_free_value.
*/
static ecma_value_t
-ecma_builtin_intrinsic_map_prototype_entries (ecma_value_t this_value)
+ecma_builtin_intrinsic_map_prototype_entries (ecma_value_t this_value) /**< this value */
{
ecma_extended_object_t *map_object_p = ecma_op_container_get_object (this_value, LIT_MAGIC_STRING_MAP_UL);
@@ -132,7 +130,7 @@ ecma_builtin_intrinsic_map_prototype_entries (ecma_value_t this_value)
* Returned value must be freed with ecma_free_value.
*/
static ecma_value_t
-ecma_builtin_intrinsic_set_prototype_values (ecma_value_t this_value)
+ecma_builtin_intrinsic_set_prototype_values (ecma_value_t this_value) /**< this value */
{
ecma_extended_object_t *map_object_p = ecma_op_container_get_object (this_value, LIT_MAGIC_STRING_SET_UL);
@@ -164,10 +162,26 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built-
switch (builtin_routine_id)
{
+#if JERRY_BUILTIN_ARRAY
case ECMA_INTRINSIC_ARRAY_PROTOTYPE_VALUES:
{
return ecma_builtin_intrinsic_array_prototype_values (this_arg);
}
+ case ECMA_INTRINSIC_ARRAY_TO_STRING:
+ {
+ ecma_value_t this_obj = ecma_op_to_object (this_arg);
+ if (ECMA_IS_VALUE_ERROR (this_obj))
+ {
+ return this_obj;
+ }
+
+ ecma_value_t result = ecma_array_object_to_string (this_obj);
+ ecma_deref_object (ecma_get_object_from_value (this_obj));
+
+ return result;
+ }
+#endif /* JERRY_BUILTIN_ARRAY */
+#if JERRY_BUILTIN_TYPEDARRAY
case ECMA_INTRINSIC_TYPEDARRAY_PROTOTYPE_VALUES:
{
if (!ecma_is_typedarray (this_arg))
@@ -182,6 +196,8 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built-
return ecma_typedarray_iterators_helper (this_arg, ECMA_ITERATOR_VALUES);
}
+#endif /* JERRY_BUILTIN_TYPEDARRAY */
+#if JERRY_BUILTIN_CONTAINER
case ECMA_INTRINSIC_SET_PROTOTYPE_VALUES:
{
return ecma_builtin_intrinsic_set_prototype_values (this_arg);
@@ -190,19 +206,8 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built-
{
return ecma_builtin_intrinsic_map_prototype_entries (this_arg);
}
- case ECMA_INTRINSIC_ARRAY_TO_STRING:
- {
- ecma_value_t this_obj = ecma_op_to_object (this_arg);
- if (ECMA_IS_VALUE_ERROR (this_obj))
- {
- return this_obj;
- }
-
- ecma_value_t result = ecma_array_object_to_string (this_obj);
- ecma_deref_object (ecma_get_object_from_value (this_obj));
-
- return result;
- }
+#endif /* JERRY_BUILTIN_CONTAINER */
+#if JERRY_BUILTIN_DATE
case ECMA_INTRINSIC_DATE_TO_UTC_STRING:
{
if (!ecma_is_value_object (this_arg)
@@ -211,13 +216,7 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built-
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_DATE_OBJECT);
}
-#if JERRY_ESNEXT
ecma_number_t *date_value_p = &((ecma_date_object_t *) ecma_get_object_from_value (this_arg))->date_value;
-#else /* !JERRY_ESNEXT */
- ecma_extended_object_t *arg_ext_object_p = (ecma_extended_object_t *) ecma_get_object_from_value (argument);
- ecma_number_t *date_value_p =
- ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t, arg_ext_object_p->u.class_prop.u.date);
-#endif /* JERRY_ESNEXT */
if (ecma_number_is_nan (*date_value_p))
{
@@ -226,6 +225,8 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built-
return ecma_date_value_to_utc_string (*date_value_p);
}
+#endif /* JERRY_BUILTIN_DATE */
+#if JERRY_BUILTIN_STRING
case ECMA_INTRINSIC_STRING_TRIM_START:
case ECMA_INTRINSIC_STRING_TRIM_END:
{
@@ -265,6 +266,7 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built-
ecma_deref_ecma_string (to_str_p);
return result;
}
+#endif /* JERRY_BUILTIN_STRING */
default:
{
JERRY_ASSERT (builtin_routine_id == ECMA_INTRINSIC_PARSE_INT || builtin_routine_id == ECMA_INTRINSIC_PARSE_FLOAT);
@@ -301,5 +303,3 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built-
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.inc.h
index d3d0e582..54c82c4d 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.inc.h
@@ -19,8 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* Routine properties:
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
ROUTINE (LIT_INTERNAL_MAGIC_STRING_ARRAY_PROTOTYPE_VALUES, ECMA_INTRINSIC_ARRAY_PROTOTYPE_VALUES, 0, 0)
@@ -33,5 +31,5 @@ ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ECMA_INTRINSIC_ARRAY_TO_STRING, 0, 0)
ROUTINE (LIT_MAGIC_STRING_TO_UTC_STRING_UL, ECMA_INTRINSIC_DATE_TO_UTC_STRING, 0, 0)
ROUTINE (LIT_MAGIC_STRING_PARSE_FLOAT, ECMA_INTRINSIC_PARSE_FLOAT, 1, 1)
ROUTINE (LIT_MAGIC_STRING_PARSE_INT, ECMA_INTRINSIC_PARSE_INT, 2, 2)
-#endif /* JERRY_ESNEXT */
+
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.c
index 1bcc9166..ca991d66 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.c
@@ -17,8 +17,6 @@
#include "ecma-builtins.h"
#include "ecma-iterator-object.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -102,5 +100,3 @@ ecma_builtin_iterator_prototype_dispatch_routine (uint8_t builtin_routine_id, /*
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.inc.h
index 4719360a..4054eb40 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.inc.h
@@ -19,12 +19,8 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* Routine properties:
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ECMA_BUILTIN_ITERATOR_PROTOTYPE_OBJECT_ITERATOR, 0, 0)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-json.c b/jerry-core/ecma/builtin-objects/ecma-builtin-json.c
index 2dfa053a..11a6871b 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-json.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-json.c
@@ -653,13 +653,11 @@ ecma_builtin_json_internalize_property (ecma_object_t *reviver_p, /**< reviver f
/* 3.a */
ecma_value_t is_array = ecma_is_value_array (value);
-#if JERRY_ESNEXT
if (ECMA_IS_VALUE_ERROR (is_array))
{
ecma_free_value (value);
return is_array;
}
-#endif /* JERRY_ESNEXT */
ecma_object_t *object_p = ecma_get_object_from_value (value);
@@ -702,15 +700,12 @@ ecma_builtin_json_internalize_property (ecma_object_t *reviver_p, /**< reviver f
{
ecma_collection_t *props_p =
ecma_op_object_get_enumerable_property_names (object_p, ECMA_ENUMERABLE_PROPERTY_KEYS);
-#if JERRY_ESNEXT
+
if (JERRY_UNLIKELY (props_p == NULL))
{
ecma_deref_object (object_p);
return ECMA_VALUE_ERROR;
}
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (props_p != NULL);
-#endif /* JERRY_ESNEXT */
ecma_value_t *buffer_p = props_p->buffer_p;
@@ -773,12 +768,10 @@ ecma_builtin_json_internalize_process_property (ecma_object_t *reviver_p, /**< r
/* ES11: 2.b.iii.2.a / 2.c.ii.2.a */
ecma_value_t delete_val = ecma_op_object_delete (object_p, prop_name, false);
-#if JERRY_ESNEXT
if (ECMA_IS_VALUE_ERROR (delete_val))
{
return delete_val;
}
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (ecma_is_value_boolean (delete_val));
}
@@ -789,12 +782,10 @@ ecma_builtin_json_internalize_process_property (ecma_object_t *reviver_p, /**< r
ecma_builtin_helper_def_prop (object_p, prop_name, new_element, ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE);
ecma_free_value (new_element);
-#if JERRY_ESNEXT
if (ECMA_IS_VALUE_ERROR (def_value))
{
return def_value;
}
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (ecma_is_value_boolean (def_value));
}
@@ -900,7 +891,6 @@ ecma_builtin_json_quote (ecma_stringbuilder_t *builder_p, /**< builder for the r
bool should_escape = false;
-#if JERRY_ESNEXT
if (lit_is_code_point_utf16_high_surrogate (c))
{
if (str_p < str_end_p)
@@ -922,7 +912,6 @@ ecma_builtin_json_quote (ecma_stringbuilder_t *builder_p, /**< builder for the r
{
should_escape = true;
}
-#endif /* JERRY_ESNEXT */
if (c == LIT_CHAR_BACKSLASH || c == LIT_CHAR_DOUBLE_QUOTE)
{
@@ -1571,12 +1560,10 @@ ecma_builtin_json_stringify (ecma_value_t arg1, /**< value */
{
ecma_value_t is_array = ecma_is_value_array (arg2);
-#if JERRY_ESNEXT
if (ECMA_IS_VALUE_ERROR (is_array))
{
return is_array;
}
-#endif /* JERRY_ESNEXT */
if (ecma_is_value_true (is_array))
{
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-json.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-json.inc.h
index 21776999..30d13551 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-json.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-json.inc.h
@@ -21,10 +21,8 @@
#if JERRY_BUILTIN_JSON
-#if JERRY_ESNEXT
/* ECMA-262 v6, 24.3.3 */
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_JSON_U, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
/* Routine properties:
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-math.c b/jerry-core/ecma/builtin-objects/ecma-builtin-math.c
index 0e69365f..33a9bc23 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-math.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-math.c
@@ -62,7 +62,6 @@ enum
ECMA_MATH_OBJECT_SIN, /* ECMA-262 v5, 15.8.2.16 */
ECMA_MATH_OBJECT_SQRT, /* ECMA-262 v5, 15.8.2.17 */
ECMA_MATH_OBJECT_TAN, /* ECMA-262 v5, 15.8.2.18 */
-#if JERRY_ESNEXT
ECMA_MATH_OBJECT_ACOSH, /* ECMA-262 v6, 20.2.2.3 */
ECMA_MATH_OBJECT_ASINH, /* ECMA-262 v6, 20.2.2.5 */
ECMA_MATH_OBJECT_ATANH, /* ECMA-262 v6, 20.2.2.7 */
@@ -78,19 +77,14 @@ enum
ECMA_MATH_OBJECT_SINH, /* ECMA-262 v6, 20.2.2.31 */
ECMA_MATH_OBJECT_TANH, /* ECMA-262 v6, 20.2.2.34 */
ECMA_MATH_OBJECT_TRUNC, /* ECMA-262 v6, 20.2.2.35 */
-#endif /* JERRY_ESNEXT */
ECMA_MATH_OBJECT_ATAN2,
-/* ECMA-262 v5, 15.8.2.5 */ /* first routine with 2 arguments */
-#if JERRY_ESNEXT
+ /* ECMA-262 v5, 15.8.2.5 */ /* first routine with 2 arguments */
ECMA_MATH_OBJECT_IMUL, /* ECMA-262 v6, 20.2.2.19 */
-#endif /* JERRY_ESNEXT */
ECMA_MATH_OBJECT_POW,
/* ECMA-262 v5, 15.8.2.13 */ /* last routine with 1 or 2 arguments*/
ECMA_MATH_OBJECT_MAX, /* ECMA-262 v5, 15.8.2.11 */
ECMA_MATH_OBJECT_MIN, /* ECMA-262 v5, 15.8.2.12 */
-#if JERRY_ESNEXT
ECMA_MATH_OBJECT_HYPOT, /* ECMA-262 v6, 20.2.2.18 */
-#endif /* JERRY_ESNEXT */
ECMA_MATH_OBJECT_RANDOM, /* ECMA-262 v5, 15.8.2.14 */
};
@@ -164,7 +158,6 @@ ecma_builtin_math_object_max_min (bool is_max, /**< 'max' or 'min' operation */
return ecma_make_number_value (result_num);
} /* ecma_builtin_math_object_max_min */
-#if JERRY_ESNEXT
/**
* The Math object's 'hypot' routine
*
@@ -270,8 +263,6 @@ ecma_builtin_math_object_sign (ecma_number_t arg)
return (ecma_number_t) 1.0;
} /* ecma_builtin_math_object_sign */
-#endif /* JERRY_ESNEXT */
-
/**
* The Math object's 'random' routine.
*
@@ -384,7 +375,6 @@ ecma_builtin_math_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wi
x = DOUBLE_TO_ECMA_NUMBER_T (log (x));
break;
}
-#if JERRY_ESNEXT
case ECMA_MATH_OBJECT_TRUNC:
{
x = ecma_builtin_math_object_trunc (x);
@@ -395,7 +385,6 @@ ecma_builtin_math_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wi
x = ecma_builtin_math_object_sign (x);
break;
}
-#endif /* JERRY_ESNEXT */
case ECMA_MATH_OBJECT_ROUND:
{
if (ecma_number_is_nan (x) || ecma_number_is_zero (x) || ecma_number_is_infinity (x))
@@ -456,7 +445,6 @@ ecma_builtin_math_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wi
x = ecma_number_pow (x, y);
break;
}
-#if JERRY_ESNEXT
case ECMA_MATH_OBJECT_ACOSH:
{
x = DOUBLE_TO_ECMA_NUMBER_T (acosh (x));
@@ -543,7 +531,6 @@ ecma_builtin_math_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wi
x = (int32_t) (ecma_number_to_uint32 (x) * ecma_number_to_uint32 (y));
break;
}
-#endif /* JERRY_ESNEXT */
}
return ecma_make_number_value (x);
} /* if (builtin_routine_id <= ECMA_MATH_OBJECT_POW) */
@@ -555,12 +542,10 @@ ecma_builtin_math_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wi
arguments_number);
}
-#if JERRY_ESNEXT
if (builtin_routine_id == ECMA_MATH_OBJECT_HYPOT)
{
return ecma_builtin_math_object_hypot (arguments_list, arguments_number);
}
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (builtin_routine_id == ECMA_MATH_OBJECT_RANDOM);
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-math.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-math.inc.h
index 16d24d5e..c30ad25d 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-math.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-math.inc.h
@@ -48,10 +48,8 @@ NUMBER_VALUE (LIT_MAGIC_STRING_SQRT1_2_U, ECMA_BUILTIN_NUMBER_SQRT_1_2, ECMA_PRO
/* ECMA-262 v5, 15.8.1.8 */
NUMBER_VALUE (LIT_MAGIC_STRING_SQRT2_U, ECMA_BUILTIN_NUMBER_SQRT2, ECMA_PROPERTY_FIXED)
-#if JERRY_ESNEXT
/* ECMA-262 v6, 20.2.1.9 */
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_MATH_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
/* Routine properties:
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
@@ -73,7 +71,6 @@ ROUTINE (LIT_MAGIC_STRING_ROUND, ECMA_MATH_OBJECT_ROUND, 1, 1)
ROUTINE (LIT_MAGIC_STRING_SIN, ECMA_MATH_OBJECT_SIN, 1, 1)
ROUTINE (LIT_MAGIC_STRING_SQRT, ECMA_MATH_OBJECT_SQRT, 1, 1)
ROUTINE (LIT_MAGIC_STRING_TAN, ECMA_MATH_OBJECT_TAN, 1, 1)
-#if JERRY_ESNEXT
ROUTINE (LIT_MAGIC_STRING_ACOSH, ECMA_MATH_OBJECT_ACOSH, 1, 1)
ROUTINE (LIT_MAGIC_STRING_ASINH, ECMA_MATH_OBJECT_ASINH, 1, 1)
ROUTINE (LIT_MAGIC_STRING_ATANH, ECMA_MATH_OBJECT_ATANH, 1, 1)
@@ -91,7 +88,6 @@ ROUTINE (LIT_MAGIC_STRING_SIGN, ECMA_MATH_OBJECT_SIGN, 1, 1)
ROUTINE (LIT_MAGIC_STRING_SINH, ECMA_MATH_OBJECT_SINH, 1, 1)
ROUTINE (LIT_MAGIC_STRING_TANH, ECMA_MATH_OBJECT_TANH, 1, 1)
ROUTINE (LIT_MAGIC_STRING_TRUNC, ECMA_MATH_OBJECT_TRUNC, 1, 1)
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_MATH */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-number.c b/jerry-core/ecma/builtin-objects/ecma-builtin-number.c
index 6d4dfbd7..89fa1ab9 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-number.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-number.c
@@ -34,7 +34,6 @@
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
-#if JERRY_ESNEXT
/**
* This object has a custom dispatch function.
*/
@@ -51,7 +50,6 @@ enum
ECMA_NUMBER_OBJECT_ROUTINE_IS_INTEGER,
ECMA_NUMBER_OBJECT_ROUTINE_IS_SAFE_INTEGER
};
-#endif /* JERRY_ESNEXT */
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-number.inc.h"
#define BUILTIN_UNDERSCORED_ID number
@@ -155,7 +153,6 @@ ecma_builtin_number_dispatch_construct (const ecma_value_t *arguments_list_p, /*
#endif /* JERRY_BUILTIN_BIGINT */
} /* ecma_builtin_number_dispatch_construct */
-#if JERRY_ESNEXT
/**
* The Number object 'isInteger' and 'isSafeInteger' routine
*
@@ -240,8 +237,6 @@ ecma_builtin_number_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
}
} /* ecma_builtin_number_dispatch_routine */
-#endif /* JERRY_ESNEXT */
-
/**
* @}
* @}
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-number.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-number.inc.h
index c586aa07..5a30cbf0 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-number.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-number.inc.h
@@ -41,8 +41,6 @@ NUMBER_VALUE (LIT_MAGIC_STRING_POSITIVE_INFINITY_U, ECMA_BUILTIN_NUMBER_POSITIVE
/* ECMA-262 v5, 15.7.3.6 */
NUMBER_VALUE (LIT_MAGIC_STRING_NEGATIVE_INFINITY_U, ECMA_BUILTIN_NUMBER_NEGATIVE_INFINITY, ECMA_PROPERTY_FIXED)
-#if JERRY_ESNEXT
-
/* ECMA-262 v6, 20.1.2.1 */
NUMBER_VALUE (LIT_MAGIC_STRING_EPSILON_U, ECMA_BUILTIN_NUMBER_EPSILON, ECMA_PROPERTY_FIXED)
@@ -53,7 +51,6 @@ NUMBER_VALUE (LIT_MAGIC_STRING_MAX_SAFE_INTEGER_U, ECMA_BUILTIN_NUMBER_MAX_SAFE_
NUMBER_VALUE (LIT_MAGIC_STRING_MIN_SAFE_INTEGER_U, ECMA_BUILTIN_NUMBER_MIN_SAFE_INTEGER, ECMA_PROPERTY_FIXED)
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_NUMBER_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
/* Object properties:
* (property name, object pointer getter) */
@@ -65,12 +62,11 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_NUMBER_PROTOTYPE, ECMA
/* Routine properties:
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
-#if JERRY_ESNEXT
ROUTINE (LIT_MAGIC_STRING_IS_FINITE, ECMA_NUMBER_OBJECT_ROUTINE_IS_FINITE, 1, 1)
ROUTINE (LIT_MAGIC_STRING_IS_NAN, ECMA_NUMBER_OBJECT_ROUTINE_IS_NAN, 1, 1)
ROUTINE (LIT_MAGIC_STRING_IS_INTEGER, ECMA_NUMBER_OBJECT_ROUTINE_IS_INTEGER, 1, 1)
ROUTINE (LIT_MAGIC_STRING_IS_SAFE_INTEGER, ECMA_NUMBER_OBJECT_ROUTINE_IS_SAFE_INTEGER, 1, 1)
INTRINSIC_PROPERTY (LIT_MAGIC_STRING_PARSE_FLOAT, LIT_MAGIC_STRING_PARSE_FLOAT, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
INTRINSIC_PROPERTY (LIT_MAGIC_STRING_PARSE_INT, LIT_MAGIC_STRING_PARSE_INT, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
-#endif /* JERRY_ESNEXT */
+
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c
index e57af2ec..28abfbb4 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c
@@ -52,12 +52,12 @@ enum
ECMA_OBJECT_PROTOTYPE_HAS_OWN_PROPERTY,
ECMA_OBJECT_PROTOTYPE_PROPERTY_IS_ENUMERABLE,
ECMA_OBJECT_PROTOTYPE_SET_PROTO,
-#if JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB
+#if JERRY_BUILTIN_ANNEXB
ECMA_OBJECT_PROTOTYPE_DEFINE_GETTER,
ECMA_OBJECT_PROTOTYPE_DEFINE_SETTER,
ECMA_OBJECT_PROTOTYPE_LOOKUP_GETTER,
ECMA_OBJECT_PROTOTYPE_LOOKUP_SETTER,
-#endif /* JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB */
+#endif /* JERRY_BUILTIN_ANNEXB */
};
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-object-prototype.inc.h"
@@ -193,7 +193,7 @@ ecma_builtin_object_prototype_object_property_is_enumerable (ecma_object_t *obj_
return ecma_make_boolean_value (is_enumerable);
} /* ecma_builtin_object_prototype_object_property_is_enumerable */
-#if JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB
+#if JERRY_BUILTIN_ANNEXB
/**
* The Object.prototype object's '__defineGetter__' and '__defineSetter__' routine
*
@@ -369,7 +369,7 @@ ecma_builtin_object_prototype_lookup_getter_setter (ecma_value_t this_arg, /**<
return ret_value;
} /* ecma_builtin_object_prototype_lookup_getter_setter */
-#endif /* JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB */
+#endif /* JERRY_BUILTIN_ANNEXB */
/**
* Dispatcher of the built-in's routines
@@ -427,13 +427,11 @@ ecma_builtin_object_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
ecma_value_t ret_value;
-#if JERRY_ESNEXT
if (builtin_routine_id == ECMA_OBJECT_PROTOTYPE_GET_PROTO)
{
ret_value = ecma_builtin_object_object_get_prototype_of (obj_p);
}
else
-#endif /* JERRY_ESNEXT */
{
ret_value = ecma_builtin_object_prototype_object_is_prototype_of (obj_p, arguments_list_p[0]);
}
@@ -445,7 +443,6 @@ ecma_builtin_object_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
JERRY_ASSERT (builtin_routine_id >= ECMA_OBJECT_PROTOTYPE_HAS_OWN_PROPERTY);
-#if JERRY_ESNEXT
if (builtin_routine_id == ECMA_OBJECT_PROTOTYPE_SET_PROTO)
{
return ecma_builtin_object_object_set_proto (this_arg, arguments_list_p[0]);
@@ -474,7 +471,6 @@ ecma_builtin_object_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
false);
}
#endif /* JERRY_BUILTIN_ANNEXB */
-#endif /* JERRY_ESNEXT*/
ecma_string_t *prop_name_p = ecma_op_to_property_key (arguments_list_p[0]);
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.inc.h
index 47d2b8b4..b218eda5 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.inc.h
@@ -39,11 +39,11 @@ ROUTINE (LIT_MAGIC_STRING_HAS_OWN_PROPERTY_UL, ECMA_OBJECT_PROTOTYPE_HAS_OWN_PRO
ROUTINE (LIT_MAGIC_STRING_IS_PROTOTYPE_OF_UL, ECMA_OBJECT_PROTOTYPE_IS_PROTOTYPE_OF, 1, 1)
ROUTINE (LIT_MAGIC_STRING_PROPERTY_IS_ENUMERABLE_UL, ECMA_OBJECT_PROTOTYPE_PROPERTY_IS_ENUMERABLE, 1, 1)
-#if JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB
+#if JERRY_BUILTIN_ANNEXB
ROUTINE (LIT_MAGIC_STRING_DEFINE_GETTER, ECMA_OBJECT_PROTOTYPE_DEFINE_GETTER, 2, 2)
ROUTINE (LIT_MAGIC_STRING_DEFINE_SETTER, ECMA_OBJECT_PROTOTYPE_DEFINE_SETTER, 2, 2)
ROUTINE (LIT_MAGIC_STRING_LOOKUP_GETTER, ECMA_OBJECT_PROTOTYPE_LOOKUP_GETTER, 1, 1)
ROUTINE (LIT_MAGIC_STRING_LOOKUP_SETTER, ECMA_OBJECT_PROTOTYPE_LOOKUP_SETTER, 1, 1)
-#endif /* JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB*/
+#endif /* JERRY_BUILTIN_ANNEXB*/
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-object.c b/jerry-core/ecma/builtin-objects/ecma-builtin-object.c
index e355e687..392ba2d3 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-object.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-object.c
@@ -21,20 +21,17 @@
#include "ecma-builtins.h"
#include "ecma-conversion.h"
#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
#include "ecma-gc.h"
#include "ecma-globals.h"
#include "ecma-helpers.h"
+#include "ecma-iterator-object.h"
#include "ecma-objects-general.h"
#include "ecma-objects.h"
#include "ecma-proxy-object.h"
-#include "jrt.h"
-#if JERRY_ESNEXT
-#include "ecma-function-object.h"
-#include "ecma-iterator-object.h"
-
#include "jcontext.h"
-#endif /* JERRY_ESNEXT */
+#include "jrt.h"
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -126,7 +123,6 @@ ecma_value_t
ecma_builtin_object_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
uint32_t arguments_list_len) /**< number of arguments */
{
-#if JERRY_ESNEXT
if (JERRY_CONTEXT (current_new_target_p) != ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT))
{
ecma_object_t *prototype_obj_p =
@@ -141,7 +137,7 @@ ecma_builtin_object_dispatch_construct (const ecma_value_t *arguments_list_p, /*
return ecma_make_object_value (object_p);
}
-#endif /* JERRY_ESNEXT */
+
return ecma_builtin_object_dispatch_call (arguments_list_p, arguments_list_len);
} /* ecma_builtin_object_dispatch_construct */
@@ -176,7 +172,6 @@ ecma_builtin_object_object_get_prototype_of (ecma_object_t *obj_p) /**< routine'
return ECMA_VALUE_NULL;
} /* ecma_builtin_object_object_get_prototype_of */
-#if JERRY_ESNEXT
/**
* The Object object's 'setPrototypeOf' routine
*
@@ -303,7 +298,6 @@ ecma_builtin_object_object_set_proto (ecma_value_t arg1, /**< routine's first ar
return ECMA_VALUE_UNDEFINED;
} /* ecma_builtin_object_object_set_proto */
-#endif /* JERRY_ESNEXT */
/**
* SetIntegrityLevel operation
@@ -731,7 +725,6 @@ ecma_builtin_object_object_get_own_property_descriptor (ecma_object_t *obj_p, /*
return ECMA_VALUE_UNDEFINED;
} /* ecma_builtin_object_object_get_own_property_descriptor */
-#if JERRY_ESNEXT
/**
* The Object object's 'getOwnPropertyDescriptors' routine
*
@@ -799,7 +792,6 @@ ecma_builtin_object_object_get_own_property_descriptors (ecma_object_t *obj_p) /
return ecma_make_object_value (descriptors_p);
} /* ecma_builtin_object_object_get_own_property_descriptors */
-#endif /* JERRY_ESNEXT */
/**
* The Object object's 'defineProperties' routine
@@ -852,12 +844,10 @@ ecma_builtin_object_object_define_properties (ecma_object_t *obj_p, /**< routine
ecma_property_descriptor_t prop_desc;
ecma_value_t get_desc = ecma_op_object_get_own_property_descriptor (props_p, prop_name_p, &prop_desc);
-#if JERRY_ESNEXT
if (ECMA_IS_VALUE_ERROR (get_desc))
{
goto cleanup;
}
-#endif /* JERRY_ESNEXT */
if (ecma_is_value_true (get_desc))
{
@@ -1024,8 +1014,6 @@ ecma_builtin_object_object_define_property (ecma_object_t *obj_p, /**< routine's
return ecma_make_object_value (obj_p);
} /* ecma_builtin_object_object_define_property */
-#if JERRY_ESNEXT
-
/**
* The Object object's 'assign' routine
*
@@ -1286,8 +1274,6 @@ cleanup_iterator:
return result;
} /* ecma_builtin_object_from_entries */
-#endif /* JERRY_ESNEXT */
-
/**
* GetOwnPropertyKeys abstract method
*
@@ -1301,7 +1287,6 @@ static ecma_value_t
ecma_op_object_get_own_property_keys (ecma_value_t this_arg, /**< this argument */
uint16_t type) /**< routine type */
{
-#if JERRY_ESNEXT
/* 1. */
ecma_value_t object = ecma_op_to_object (this_arg);
@@ -1351,12 +1336,6 @@ ecma_op_object_get_own_property_keys (ecma_value_t this_arg, /**< this argument
ecma_collection_free (props_p);
return result_array;
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (type);
- ecma_object_t *obj_p = ecma_get_object_from_value (this_arg);
- ecma_collection_t *props_p = ecma_op_object_own_property_keys (obj_p, JERRY_PROPERTY_FILTER_ALL);
- return ecma_op_new_array_object_from_collection (props_p, false);
-#endif /* JERRY_ESNEXT */
} /* ecma_op_object_get_own_property_keys */
/**
@@ -1384,7 +1363,6 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
{
return ecma_builtin_object_object_create (arg1, arg2);
}
-#if JERRY_ESNEXT
case ECMA_OBJECT_ROUTINE_SET_PROTOTYPE_OF:
{
return ecma_builtin_object_object_set_prototype_of (arg1, arg2);
@@ -1393,7 +1371,6 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
{
return ecma_builtin_object_object_is (arg1, arg2);
}
-#endif /* JERRY_ESNEXT */
default:
{
break;
@@ -1401,21 +1378,13 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
}
ecma_object_t *obj_p;
-#if !JERRY_ESNEXT
- if (!ecma_is_value_object (arg1))
- {
- return ecma_raise_type_error (ECMA_ERR_ARGUMENT_IS_NOT_AN_OBJECT);
- }
-#endif /* !JERRY_ESNEXT */
if (builtin_routine_id <= ECMA_OBJECT_ROUTINE_DEFINE_PROPERTIES)
{
-#if JERRY_ESNEXT
if (!ecma_is_value_object (arg1))
{
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_IS_NOT_AN_OBJECT);
}
-#endif /* JERRY_ESNEXT */
obj_p = ecma_get_object_from_value (arg1);
@@ -1439,7 +1408,6 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
}
else if (builtin_routine_id <= ECMA_OBJECT_ROUTINE_ENTRIES)
{
-#if JERRY_ESNEXT
ecma_value_t object = ecma_op_to_object (arg1);
if (ECMA_IS_VALUE_ERROR (object))
{
@@ -1447,9 +1415,6 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
}
obj_p = ecma_get_object_from_value (object);
-#else /* !JERRY_ESNEXT */
- obj_p = ecma_get_object_from_value (arg1);
-#endif /* JERRY_ESNEXT */
ecma_value_t result;
switch (builtin_routine_id)
@@ -1459,7 +1424,6 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
result = ecma_builtin_object_object_get_prototype_of (obj_p);
break;
}
-#if JERRY_ESNEXT
case ECMA_OBJECT_ROUTINE_ASSIGN:
{
result = ecma_builtin_object_object_assign (obj_p, arguments_list_p + 1, arguments_number - 1);
@@ -1467,7 +1431,6 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
}
case ECMA_OBJECT_ROUTINE_ENTRIES:
case ECMA_OBJECT_ROUTINE_VALUES:
-#endif /* JERRY_ESNEXT */
case ECMA_OBJECT_ROUTINE_KEYS:
{
JERRY_ASSERT (builtin_routine_id - ECMA_OBJECT_ROUTINE_KEYS < ECMA_ENUMERABLE_PROPERTY__COUNT);
@@ -1491,7 +1454,6 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
ecma_deref_ecma_string (prop_name_p);
break;
}
-#if JERRY_ESNEXT
case ECMA_OBJECT_ROUTINE_HAS_OWN:
{
ecma_string_t *prop_name_p = ecma_op_to_property_key (arg2);
@@ -1516,16 +1478,13 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
result = ecma_builtin_object_from_entries (arg1);
break;
}
-#endif /* JERRY_ESNEXT */
default:
{
JERRY_UNREACHABLE ();
}
}
-#if JERRY_ESNEXT
ecma_deref_object (obj_p);
-#endif /* JERRY_ESNEXT */
return result;
}
else if (builtin_routine_id <= ECMA_OBJECT_ROUTINE_GET_OWN_PROPERTY_SYMBOLS)
@@ -1534,12 +1493,10 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
}
else if (builtin_routine_id <= ECMA_OBJECT_ROUTINE_SEAL)
{
-#if JERRY_ESNEXT
if (!ecma_is_value_object (arg1))
{
return ecma_copy_value (arg1);
}
-#endif /* JERRY_ESNEXT */
obj_p = ecma_get_object_from_value (arg1);
switch (builtin_routine_id)
@@ -1565,12 +1522,11 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
else
{
JERRY_ASSERT (builtin_routine_id <= ECMA_OBJECT_ROUTINE_IS_SEALED);
-#if JERRY_ESNEXT
+
if (!ecma_is_value_object (arg1))
{
return ecma_make_boolean_value (builtin_routine_id != ECMA_OBJECT_ROUTINE_IS_EXTENSIBLE);
}
-#endif /* JERRY_ESNEXT */
obj_p = ecma_get_object_from_value (arg1);
switch (builtin_routine_id)
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h
index b046141b..ee02ad62 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h
@@ -29,43 +29,31 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
/* ECMA-262 v5, 15.2.3.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, ECMA_PROPERTY_FIXED)
-
-#if JERRY_ESNEXT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_OBJECT_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
/* Routine properties:
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
ROUTINE (LIT_MAGIC_STRING_GET_PROTOTYPE_OF_UL, ECMA_OBJECT_ROUTINE_GET_PROTOTYPE_OF, 1, 1)
ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_NAMES_UL, ECMA_OBJECT_ROUTINE_GET_OWN_PROPERTY_NAMES, 1, 1)
-#if JERRY_ESNEXT
ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_SYMBOLS_UL, ECMA_OBJECT_ROUTINE_GET_OWN_PROPERTY_SYMBOLS, 1, 1)
-#endif /* JERRY_ESNEXT */
ROUTINE (LIT_MAGIC_STRING_SEAL, ECMA_OBJECT_ROUTINE_SEAL, 1, 1)
ROUTINE (LIT_MAGIC_STRING_FREEZE, ECMA_OBJECT_ROUTINE_FREEZE, 1, 1)
ROUTINE (LIT_MAGIC_STRING_PREVENT_EXTENSIONS_UL, ECMA_OBJECT_ROUTINE_PREVENT_EXTENSIONS, 1, 1)
ROUTINE (LIT_MAGIC_STRING_IS_SEALED_UL, ECMA_OBJECT_ROUTINE_IS_SEALED, 1, 1)
ROUTINE (LIT_MAGIC_STRING_IS_FROZEN_UL, ECMA_OBJECT_ROUTINE_IS_FROZEN, 1, 1)
ROUTINE (LIT_MAGIC_STRING_IS_EXTENSIBLE, ECMA_OBJECT_ROUTINE_IS_EXTENSIBLE, 1, 1)
-#if JERRY_ESNEXT
ROUTINE (LIT_MAGIC_STRING_ENTRIES, ECMA_OBJECT_ROUTINE_ENTRIES, 1, 1)
ROUTINE (LIT_MAGIC_STRING_VALUES, ECMA_OBJECT_ROUTINE_VALUES, 1, 1)
-#endif /* JERRY_ESNEXT */
ROUTINE (LIT_MAGIC_STRING_KEYS, ECMA_OBJECT_ROUTINE_KEYS, 1, 1)
ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL, ECMA_OBJECT_ROUTINE_GET_OWN_PROPERTY_DESCRIPTOR, 2, 2)
-#if JERRY_ESNEXT
ROUTINE (LIT_MAGIC_STRING_HAS_OWN_UL, ECMA_OBJECT_ROUTINE_HAS_OWN, 2, 2)
ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTORS_UL, ECMA_OBJECT_ROUTINE_GET_OWN_PROPERTY_DESCRIPTORS, 1, 1)
ROUTINE (LIT_MAGIC_STRING_OBJECT_FROM_ENTRIES, ECMA_OBJECT_ROUTINE_FROM_ENTRIES, 1, 1)
-#endif /* JERRY_ESNEXT */
ROUTINE (LIT_MAGIC_STRING_CREATE, ECMA_OBJECT_ROUTINE_CREATE, 2, 2)
ROUTINE (LIT_MAGIC_STRING_DEFINE_PROPERTIES_UL, ECMA_OBJECT_ROUTINE_DEFINE_PROPERTIES, 2, 2)
ROUTINE (LIT_MAGIC_STRING_DEFINE_PROPERTY_UL, ECMA_OBJECT_ROUTINE_DEFINE_PROPERTY, 3, 3)
-
-#if JERRY_ESNEXT
ROUTINE (LIT_MAGIC_STRING_SET_PROTOTYPE_OF_UL, ECMA_OBJECT_ROUTINE_SET_PROTOTYPE_OF, 2, 2)
ROUTINE (LIT_MAGIC_STRING_ASSIGN, ECMA_OBJECT_ROUTINE_ASSIGN, NON_FIXED, 2)
ROUTINE (LIT_MAGIC_STRING_IS, ECMA_OBJECT_ROUTINE_IS, 2, 2)
-#endif /* JERRY_ESNEXT */
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.c
index 252512d6..b24f6d5b 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.c
@@ -16,8 +16,6 @@
#include "ecma-globals.h"
#include "ecma-promise-object.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -93,5 +91,3 @@ ecma_builtin_promise_prototype_dispatch_routine (uint8_t builtin_routine_id, /**
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.inc.h
index 2f741624..76ee6fda 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.inc.h
@@ -15,8 +15,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* Object properties:
* (property name, object pointer getter) */
@@ -29,6 +27,4 @@ ROUTINE (LIT_MAGIC_STRING_THEN, ECMA_PROMISE_PROTOTYPE_ROUTINE_THEN, 2, 2)
ROUTINE (LIT_MAGIC_STRING_CATCH, ECMA_PROMISE_PROTOTYPE_ROUTINE_CATCH, 1, 1)
ROUTINE (LIT_MAGIC_STRING_FINALLY, ECMA_PROMISE_PROTOTYPE_ROUTINE_FINALLY, 1, 1)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c b/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c
index 7a53b9c1..02f600c5 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c
@@ -27,8 +27,6 @@
#include "jcontext.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -527,5 +525,3 @@ ecma_builtin_promise_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-promise.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-promise.inc.h
index 52a63aa4..6c697539 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-promise.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-promise.inc.h
@@ -19,8 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* Number properties:
* (property name, number value, writable, enumerable, configurable) */
@@ -45,6 +43,4 @@ ROUTINE (LIT_MAGIC_STRING_ANY, ECMA_PROMISE_ROUTINE_ANY, 1, 1)
/* ES2015 25.4.4.6 */
ACCESSOR_READ_ONLY (LIT_GLOBAL_SYMBOL_SPECIES, ECMA_PROMISE_ROUTINE_SPECIES_GET, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.c b/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.c
index 83ae4feb..c17a2369 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.c
@@ -67,9 +67,6 @@ ecma_value_t
ecma_builtin_range_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
uint32_t arguments_list_len) /**< number of arguments */
{
-#if !JERRY_ESNEXT
- return ecma_builtin_range_error_dispatch_call (arguments_list_p, arguments_list_len);
-#else /* JERRY_ESNEXT */
ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p),
ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE);
@@ -89,7 +86,6 @@ ecma_builtin_range_error_dispatch_construct (const ecma_value_t *arguments_list_
ecma_deref_object (proto_p);
return result;
-#endif /* JERRY_ESNEXT */
} /* ecma_builtin_range_error_dispatch_construct */
/**
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.inc.h
index 042c13a3..6891fa5b 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.inc.h
@@ -31,10 +31,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
/* ECMA-262 v5, 15.11.3.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE, ECMA_PROPERTY_FIXED)
-
-#if JERRY_ESNEXT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_RANGE_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_ERRORS */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.c b/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.c
index 5c983555..2a3f2da5 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.c
@@ -67,9 +67,6 @@ ecma_value_t
ecma_builtin_reference_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
uint32_t arguments_list_len) /**< number of arguments */
{
-#if !JERRY_ESNEXT
- return ecma_builtin_reference_error_dispatch_call (arguments_list_p, arguments_list_len);
-#else /* JERRY_ESNEXT */
ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p),
ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE);
@@ -89,7 +86,6 @@ ecma_builtin_reference_error_dispatch_construct (const ecma_value_t *arguments_l
ecma_deref_object (proto_p);
return result;
-#endif /* JERRY_ESNEXT */
} /* ecma_builtin_reference_error_dispatch_construct */
/**
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.inc.h
index fa268dbc..b28ada19 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.inc.h
@@ -31,10 +31,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
/* ECMA-262 v5, 15.11.3.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE, ECMA_PROPERTY_FIXED)
-
-#if JERRY_ESNEXT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_REFERENCE_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_ERRORS */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.c
index 69fa1e47..94c0384d 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.c
@@ -41,39 +41,6 @@
*/
#define BUILTIN_CUSTOM_DISPATCH
-/**
- * List of built-in routine identifiers.
- */
-enum
-{
- /** These routines must be in this order */
- ECMA_REGEXP_PROTOTYPE_ROUTINE_START = 0,
- ECMA_REGEXP_PROTOTYPE_ROUTINE_EXEC,
-#if JERRY_BUILTIN_ANNEXB
- ECMA_REGEXP_PROTOTYPE_ROUTINE_COMPILE,
-#endif /* JERRY_BUILTIN_ANNEXB */
-
- ECMA_REGEXP_PROTOTYPE_ROUTINE_TEST,
- ECMA_REGEXP_PROTOTYPE_ROUTINE_TO_STRING,
-#if JERRY_ESNEXT
- ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_SOURCE,
- ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_FLAGS,
-
- ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_GLOBAL,
- ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_IGNORE_CASE,
- ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_MULTILINE,
- ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_STICKY,
- ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_UNICODE,
- ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_DOT_ALL,
-
- ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_SEARCH,
- ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_MATCH,
- ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_REPLACE,
- ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_SPLIT,
- ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_MATCH_ALL,
-#endif /* JERRY_ESNEXT */
-};
-
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-regexp-prototype.inc.h"
#define BUILTIN_UNDERSCORED_ID regexp_prototype
#include "ecma-builtin-internal-routines-template.inc.h"
@@ -88,7 +55,6 @@ enum
* @{
*/
-#if JERRY_ESNEXT
/**
* Helper function to retrieve the flags associated with a RegExp object
*
@@ -239,7 +205,6 @@ ecma_builtin_regexp_prototype_get_source (ecma_extended_object_t *re_obj_p) /**<
return ecma_op_escape_regexp_pattern (ecma_get_string_from_value (bc_p->source));
} /* ecma_builtin_regexp_prototype_get_source */
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_ANNEXB
/**
@@ -258,13 +223,6 @@ ecma_builtin_regexp_prototype_compile (ecma_value_t this_arg, /**< this */
ecma_value_t pattern_arg, /**< pattern or RegExp object */
ecma_value_t flags_arg) /**< flags */
{
-#if !JERRY_ESNEXT
- if (ecma_get_object_from_value (this_arg) == ecma_builtin_get (ECMA_BUILTIN_ID_REGEXP_PROTOTYPE))
- {
- return ecma_raise_type_error (ECMA_ERR_ARGUMENT_IS_NOT_AN_REGEXP);
- }
-#endif /* !JERRY_ESNEXT */
-
ecma_object_t *this_obj_p = ecma_get_object_from_value (this_arg);
ecma_extended_object_t *re_obj_p = (ecma_extended_object_t *) this_obj_p;
re_compiled_code_t *old_bc_p = ECMA_GET_INTERNAL_VALUE_POINTER (re_compiled_code_t, re_obj_p->u.cls.u3.value);
@@ -362,7 +320,6 @@ static ecma_value_t
ecma_builtin_regexp_prototype_test (ecma_value_t this_arg, /**< this argument */
ecma_value_t arg) /**< routine's argument */
{
-#if JERRY_ESNEXT
ecma_string_t *arg_str_p = ecma_op_to_string (arg);
if (JERRY_UNLIKELY (arg_str_p == NULL))
@@ -378,14 +335,6 @@ ecma_builtin_regexp_prototype_test (ecma_value_t this_arg, /**< this argument */
{
return result;
}
-#else /* !JERRY_ESNEXT */
- ecma_value_t result = ecma_builtin_regexp_prototype_exec (this_arg, arg);
-
- if (ECMA_IS_VALUE_ERROR (result))
- {
- return result;
- }
-#endif /* JERRY_ESNEXT */
ecma_value_t ret_value = ecma_make_boolean_value (!ecma_is_value_null (result));
ecma_free_value (result);
@@ -405,7 +354,6 @@ ecma_builtin_regexp_prototype_test (ecma_value_t this_arg, /**< this argument */
static ecma_value_t
ecma_builtin_regexp_prototype_to_string (ecma_object_t *object_p) /**< this object */
{
-#if JERRY_ESNEXT
ecma_value_t result = ecma_op_object_get_by_magic_id (object_p, LIT_MAGIC_STRING_SOURCE);
if (ECMA_IS_VALUE_ERROR (result))
{
@@ -446,54 +394,8 @@ ecma_builtin_regexp_prototype_to_string (ecma_object_t *object_p) /**< this obje
ecma_deref_ecma_string (flags_p);
return ecma_make_string_value (ecma_stringbuilder_finalize (&builder));
-#else /* !JERRY_ESNEXT */
- ecma_extended_object_t *re_obj_p = (ecma_extended_object_t *) object_p;
-
- re_compiled_code_t *bc_p = ECMA_GET_INTERNAL_VALUE_POINTER (re_compiled_code_t, re_obj_p->u.cls.u3.value);
-
- ecma_string_t *source_p = ecma_get_string_from_value (bc_p->source);
- uint16_t flags = bc_p->header.status_flags;
-
- ecma_stringbuilder_t result = ecma_stringbuilder_create ();
- ecma_stringbuilder_append_byte (&result, LIT_CHAR_SLASH);
- ecma_stringbuilder_append (&result, source_p);
- ecma_stringbuilder_append_byte (&result, LIT_CHAR_SLASH);
-
- if (flags & RE_FLAG_GLOBAL)
- {
- ecma_stringbuilder_append_byte (&result, LIT_CHAR_LOWERCASE_G);
- }
-
- if (flags & RE_FLAG_IGNORE_CASE)
- {
- ecma_stringbuilder_append_byte (&result, LIT_CHAR_LOWERCASE_I);
- }
-
- if (flags & RE_FLAG_MULTILINE)
- {
- ecma_stringbuilder_append_byte (&result, LIT_CHAR_LOWERCASE_M);
- }
-
- return ecma_make_string_value (ecma_stringbuilder_finalize (&result));
-#endif /* JERRY_ESNEXT */
} /* ecma_builtin_regexp_prototype_to_string */
-#if JERRY_ESNEXT
-/**
- * Helper function to determine if method is the builtin exec method
- *
- * @return true, if function is the builtin exec method
- * false, otherwise
- */
-extern inline bool JERRY_ATTR_ALWAYS_INLINE
-ecma_builtin_is_regexp_exec (ecma_extended_object_t *obj_p)
-{
- return (ecma_get_object_type (&obj_p->object) == ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION
- && obj_p->u.built_in.routine_id == ECMA_REGEXP_PROTOTYPE_ROUTINE_EXEC);
-} /* ecma_builtin_is_regexp_exec */
-#endif /* JERRY_ESNEXT */
-
-#if JERRY_ESNEXT
/**
* The RegExp.prototype object's 'matchAll' routine
*
@@ -628,7 +530,6 @@ ecma_builtin_regexp_prototype_match_all (ecma_object_t *regexp_obj_p, /**< this
return ecma_make_object_value (result_obj);
} /* ecma_builtin_regexp_prototype_match_all */
-#endif /* JERRY_ESNEXT */
/**
* Dispatcher of the Regexp built-in's routines
@@ -645,12 +546,6 @@ ecma_builtin_regexp_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
{
JERRY_UNUSED (arguments_number);
-#if !JERRY_ESNEXT
- bool require_regexp = builtin_routine_id <= ECMA_REGEXP_PROTOTYPE_ROUTINE_TO_STRING;
-#else /* JERRY_ESNEXT */
- bool require_regexp = builtin_routine_id < ECMA_REGEXP_PROTOTYPE_ROUTINE_TEST;
-#endif /* JERRY_ESNEXT */
-
ecma_object_t *obj_p = NULL;
/* 1. && 2. */
@@ -658,7 +553,8 @@ ecma_builtin_regexp_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
{
obj_p = ecma_get_object_from_value (this_arg);
- if (require_regexp && !ecma_object_class_is (obj_p, ECMA_OBJECT_CLASS_REGEXP))
+ if (builtin_routine_id < ECMA_REGEXP_PROTOTYPE_ROUTINE_TEST
+ && !ecma_object_class_is (obj_p, ECMA_OBJECT_CLASS_REGEXP))
{
obj_p = NULL;
}
@@ -689,7 +585,6 @@ ecma_builtin_regexp_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
{
return ecma_builtin_regexp_prototype_to_string (obj_p);
}
-#if JERRY_ESNEXT
case ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_SEARCH:
{
return ecma_regexp_search_helper (this_arg, arguments_list_p[0]);
@@ -749,7 +644,6 @@ ecma_builtin_regexp_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
ecma_extended_object_t *re_obj_p = (ecma_extended_object_t *) obj_p;
return ecma_builtin_regexp_prototype_flags_helper (re_obj_p, builtin_routine_id);
}
-#endif /* JERRY_ESNEXT */
default:
{
JERRY_UNREACHABLE ();
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h
index 9b60457e..51486e9f 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h
@@ -24,7 +24,6 @@
/* ECMA-262 v5, 15.10.6.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, ECMA_BUILTIN_ID_REGEXP, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
-#if JERRY_ESNEXT
ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_FLAGS, ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_FLAGS, ECMA_PROPERTY_FLAG_CONFIGURABLE)
ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_SOURCE, ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_SOURCE, ECMA_PROPERTY_FLAG_CONFIGURABLE)
@@ -52,22 +51,6 @@ ROUTINE (LIT_GLOBAL_SYMBOL_SEARCH, ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_SEARCH,
ROUTINE (LIT_GLOBAL_SYMBOL_SPLIT, ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_SPLIT, 2, 2)
ROUTINE (LIT_GLOBAL_SYMBOL_MATCH, ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_MATCH, 1, 1)
ROUTINE (LIT_GLOBAL_SYMBOL_MATCH_ALL, ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_MATCH_ALL, 1, 1)
-#else /* !JERRY_ESNEXT */
-/* ECMA-262 v5, 15.10.7.1 */
-STRING_VALUE (LIT_MAGIC_STRING_SOURCE, LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP, ECMA_PROPERTY_FIXED)
-
-/* ECMA-262 v5, 15.10.7.2 */
-SIMPLE_VALUE (LIT_MAGIC_STRING_GLOBAL, ECMA_VALUE_FALSE, ECMA_PROPERTY_FIXED)
-
-/* ECMA-262 v5, 15.10.7.3 */
-SIMPLE_VALUE (LIT_MAGIC_STRING_IGNORECASE_UL, ECMA_VALUE_FALSE, ECMA_PROPERTY_FIXED)
-
-/* ECMA-262 v5, 15.10.7.4 */
-SIMPLE_VALUE (LIT_MAGIC_STRING_MULTILINE, ECMA_VALUE_FALSE, ECMA_PROPERTY_FIXED)
-
-/* ECMA-262 v5, 15.10.7.5 */
-NUMBER_VALUE (LIT_MAGIC_STRING_LASTINDEX_UL, 0, ECMA_PROPERTY_FLAG_WRITABLE)
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_ANNEXB
ROUTINE (LIT_MAGIC_STRING_COMPILE, ECMA_REGEXP_PROTOTYPE_ROUTINE_COMPILE, 2, 2)
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.c
index 83070766..5a1d554d 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.c
@@ -20,8 +20,6 @@
#include "ecma-iterator-object.h"
#include "ecma-objects.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -184,5 +182,3 @@ free_variables:
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.inc.h
index d2eebddb..612bf697 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.inc.h
@@ -19,8 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
LIT_MAGIC_STRING_REGEXP_STRING_ITERATOR_UL,
ECMA_PROPERTY_FLAG_CONFIGURABLE)
@@ -29,6 +27,4 @@ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
ROUTINE (LIT_MAGIC_STRING_NEXT, ecma_builtin_regexp_string_iterator_prototype_object_next, 0, 0)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.c b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.c
index a2dc4353..0b3cfe58 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.c
@@ -49,13 +49,9 @@ ecma_builtin_regexp_dispatch_helper (const ecma_value_t *arguments_list_p, /**<
{
ecma_value_t pattern_value = ECMA_VALUE_UNDEFINED;
ecma_value_t flags_value = ECMA_VALUE_UNDEFINED;
-#if JERRY_ESNEXT
bool create_regexp_from_bc = false;
bool free_arguments = false;
ecma_object_t *new_target_p = JERRY_CONTEXT (current_new_target_p);
-#else /* !JERRY_ESNEXT */
- ecma_object_t *new_target_p = NULL;
-#endif /* JERRY_ESNEXT */
if (arguments_list_len > 0)
{
@@ -68,7 +64,6 @@ ecma_builtin_regexp_dispatch_helper (const ecma_value_t *arguments_list_p, /**<
}
}
-#if JERRY_ESNEXT
ecma_value_t regexp_value = ecma_op_is_regexp (pattern_value);
if (ECMA_IS_VALUE_ERROR (regexp_value))
@@ -144,31 +139,18 @@ ecma_builtin_regexp_dispatch_helper (const ecma_value_t *arguments_list_p, /**<
free_arguments = true;
}
-#else /* !JERRY_ESNEXT */
- if (ecma_object_is_regexp_object (pattern_value))
- {
- if (ecma_is_value_undefined (flags_value))
- {
- return ecma_copy_value (pattern_value);
- }
-
- return ecma_raise_type_error (ECMA_ERR_INVALID_ARGUMENT_IS_PASSED_TO_REGEXP_FUNCTION);
- }
-#endif /* JERRY_ESNEXT */
ecma_value_t ret_value = ECMA_VALUE_ERROR;
ecma_object_t *new_target_obj_p = ecma_op_regexp_alloc (new_target_p);
if (JERRY_LIKELY (new_target_obj_p != NULL))
{
-#if JERRY_ESNEXT
if (create_regexp_from_bc)
{
ret_value = ecma_op_create_regexp_from_bytecode (new_target_obj_p, bc_p);
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (ret_value));
}
else
-#endif /* JERRY_ESNEXT */
{
ret_value = ecma_op_create_regexp_from_pattern (new_target_obj_p, pattern_value, flags_value);
@@ -179,13 +161,11 @@ ecma_builtin_regexp_dispatch_helper (const ecma_value_t *arguments_list_p, /**<
}
}
-#if JERRY_ESNEXT
if (free_arguments)
{
ecma_free_value (pattern_value);
ecma_free_value (flags_value);
}
-#endif /* JERRY_ESNEXT */
return ret_value;
} /* ecma_builtin_regexp_dispatch_helper */
@@ -216,7 +196,6 @@ ecma_builtin_regexp_dispatch_construct (const ecma_value_t *arguments_list_p, /*
return ecma_builtin_regexp_dispatch_helper (arguments_list_p, arguments_list_len);
} /* ecma_builtin_regexp_dispatch_construct */
-#if JERRY_ESNEXT
/**
* 21.2.4.2 get RegExp [ @@species ] accessor
*
@@ -228,7 +207,6 @@ ecma_builtin_regexp_species_get (ecma_value_t this_value) /**< This Value */
{
return ecma_copy_value (this_value);
} /* ecma_builtin_regexp_species_get */
-#endif /* JERRY_ESNEXT */
/**
* @}
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.inc.h
index 882e42ca..a9fa8922 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.inc.h
@@ -25,13 +25,10 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 2, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
/* ECMA-262 v5, 15.10.5.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_REGEXP_PROTOTYPE, ECMA_PROPERTY_FIXED)
-
-#if JERRY_ESNEXT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_REGEXP_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
/* ECMA-262 v6, 21.2.4.2 */
ACCESSOR_READ_ONLY (LIT_GLOBAL_SYMBOL_SPECIES, ecma_builtin_regexp_species_get, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_REGEXP */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.c
index c7808239..5f2158cf 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.c
@@ -17,8 +17,6 @@
#include "ecma-builtins.h"
#include "ecma-iterator-object.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -205,5 +203,3 @@ ecma_builtin_string_iterator_prototype_dispatch_routine (uint8_t builtin_routine
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.inc.h
index e5d043d1..adc799d1 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.inc.h
@@ -19,14 +19,10 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_STRING_ITERATOR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
/* Routine properties:
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
ROUTINE (LIT_MAGIC_STRING_NEXT, ECMA_BUILTIN_STRING_ITERATOR_PROTOTYPE_OBJECT_NEXT, 0, 0)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c
index fb46e02e..8616fbf5 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c
@@ -291,7 +291,6 @@ static ecma_value_t
ecma_builtin_string_prototype_object_match (ecma_value_t this_argument, /**< this argument */
ecma_value_t regexp_arg) /**< routine's argument */
{
-#if JERRY_ESNEXT
/* 3. */
if (!(ecma_is_value_undefined (regexp_arg) || ecma_is_value_null (regexp_arg)))
{
@@ -351,37 +350,8 @@ ecma_builtin_string_prototype_object_match (ecma_value_t this_argument, /**< thi
ecma_free_value (new_regexp);
return ret_value;
-
-#else /* !JERRY_ESNEXT */
- if (ecma_object_is_regexp_object (regexp_arg))
- {
- return ecma_regexp_match_helper (regexp_arg, this_argument);
- }
-
- ecma_object_t *regexp_obj_p = ecma_op_regexp_alloc (NULL);
-
- if (JERRY_UNLIKELY (regexp_obj_p == NULL))
- {
- return ECMA_VALUE_ERROR;
- }
-
- ecma_value_t new_regexp = ecma_op_create_regexp_from_pattern (regexp_obj_p, regexp_arg, ECMA_VALUE_UNDEFINED);
-
- if (ECMA_IS_VALUE_ERROR (new_regexp))
- {
- ecma_deref_object (regexp_obj_p);
- return new_regexp;
- }
-
- ecma_value_t result = ecma_regexp_match_helper (new_regexp, this_argument);
-
- ecma_free_value (new_regexp);
-
- return result;
-#endif /* JERRY_ESNEXT */
} /* ecma_builtin_string_prototype_object_match */
-#if JERRY_ESNEXT
/**
* The String.prototype object's 'matchAll' routine
*
@@ -505,7 +475,6 @@ ecma_builtin_string_prototype_object_match_all (ecma_value_t this_argument, /**<
return ret_value;
} /* ecma_builtin_string_prototype_object_match_all */
-#endif /* JERRY_ESNEXT */
/**
* The String.prototype object's 'replace' and 'replaceAll' routine
@@ -524,7 +493,6 @@ ecma_builtin_string_prototype_object_replace_helper (ecma_value_t this_value, /*
ecma_value_t replace_value, /**< routine's second argument */
bool replace_all)
{
-#if JERRY_ESNEXT
if (!(ecma_is_value_undefined (search_value) || ecma_is_value_null (search_value)))
{
if (replace_all)
@@ -590,12 +558,6 @@ ecma_builtin_string_prototype_object_replace_helper (ecma_value_t this_value, /*
return replace_result;
}
}
-#else /* !JERRY_ESNEXT */
- if (ecma_object_is_regexp_object (search_value))
- {
- return ecma_regexp_replace_helper (search_value, this_value, replace_value);
- }
-#endif /* JERRY_ESNEXT */
ecma_string_t *input_str_p = ecma_op_to_string (this_value);
@@ -762,7 +724,6 @@ static ecma_value_t
ecma_builtin_string_prototype_object_search (ecma_value_t this_value, /**< this argument */
ecma_value_t regexp_value) /**< routine's argument */
{
-#if JERRY_ESNEXT
if (!(ecma_is_value_undefined (regexp_value) || ecma_is_value_null (regexp_value)))
{
ecma_object_t *obj_p = ecma_get_object_from_value (ecma_op_to_object (regexp_value));
@@ -781,12 +742,6 @@ ecma_builtin_string_prototype_object_search (ecma_value_t this_value, /**< this
return search_result;
}
}
-#else /* !JERRY_ESNEXT */
- if (ecma_object_is_regexp_object (regexp_value))
- {
- return ecma_regexp_search_helper (regexp_value, this_value);
- }
-#endif /* JERRY_ESNEXT */
ecma_value_t result = ECMA_VALUE_ERROR;
@@ -799,7 +754,8 @@ ecma_builtin_string_prototype_object_search (ecma_value_t this_value, /**< this
ecma_string_t *pattern_p = ecma_regexp_read_pattern_str_helper (regexp_value);
if (pattern_p == NULL)
{
- goto cleanup_string;
+ ecma_deref_ecma_string (string_p);
+ return result;
}
ecma_object_t *new_regexp_obj_p = ecma_op_regexp_alloc (NULL);
@@ -808,7 +764,7 @@ ecma_builtin_string_prototype_object_search (ecma_value_t this_value, /**< this
{
ecma_deref_ecma_string (string_p);
ecma_deref_ecma_string (pattern_p);
- return ECMA_VALUE_ERROR;
+ return result;
}
ecma_value_t new_regexp =
@@ -818,22 +774,17 @@ ecma_builtin_string_prototype_object_search (ecma_value_t this_value, /**< this
if (ECMA_IS_VALUE_ERROR (new_regexp))
{
+ ecma_deref_ecma_string (string_p);
ecma_deref_object (new_regexp_obj_p);
- goto cleanup_string;
+ return result;
}
-#if !JERRY_ESNEXT
- result = ecma_regexp_search_helper (new_regexp, ecma_make_string_value (string_p));
- ecma_deref_object (ecma_get_object_from_value (new_regexp));
-#else /* JERRY_ESNEXT */
ecma_object_t *regexp_obj_p = ecma_get_object_from_value (new_regexp);
ecma_value_t this_str_value = ecma_make_string_value (string_p);
result = ecma_op_invoke_by_symbol_id (new_regexp, LIT_GLOBAL_SYMBOL_SEARCH, &this_str_value, 1);
ecma_deref_object (regexp_obj_p);
-#endif /* !JERRY_ESNEXT */
-
-cleanup_string:
ecma_deref_ecma_string (string_p);
+
return result;
} /* ecma_builtin_string_prototype_object_search */
@@ -926,7 +877,6 @@ ecma_builtin_string_prototype_object_split (ecma_value_t this_value, /**< this a
ecma_value_t separator_value, /**< separator */
ecma_value_t limit_value) /**< limit */
{
-#if JERRY_ESNEXT
if (!(ecma_is_value_undefined (separator_value) || ecma_is_value_null (separator_value)))
{
ecma_object_t *obj_p = ecma_get_object_from_value (ecma_op_to_object (separator_value));
@@ -947,12 +897,6 @@ ecma_builtin_string_prototype_object_split (ecma_value_t this_value, /**< this a
return split_result;
}
}
-#else /* !JERRY_ESNEXT */
- if (ecma_object_is_regexp_object (separator_value))
- {
- return ecma_regexp_split_helper (separator_value, this_value, limit_value);
- }
-#endif /* JERRY_ESNEXT */
ecma_value_t result = ECMA_VALUE_ERROR;
@@ -1180,7 +1124,6 @@ ecma_builtin_string_prototype_object_conversion_helper (ecma_string_t *input_str
{
lit_code_point_t cp = lit_cesu8_read_next (&input_curr_p);
-#if JERRY_ESNEXT
if (lit_is_code_point_utf16_high_surrogate (cp) && input_curr_p < input_str_end_p)
{
const ecma_char_t next_ch = lit_cesu8_peek_next (input_curr_p);
@@ -1190,7 +1133,6 @@ ecma_builtin_string_prototype_object_conversion_helper (ecma_string_t *input_str
input_curr_p += LIT_UTF8_MAX_BYTES_IN_CODE_UNIT;
}
}
-#endif /* JERRY_ESNEXT */
if (lower_case)
{
@@ -1224,8 +1166,6 @@ ecma_builtin_string_prototype_object_trim (ecma_string_t *original_string_p) /**
return ecma_make_string_value (trimmed_string_p);
} /* ecma_builtin_string_prototype_object_trim */
-#if JERRY_ESNEXT
-
/**
* The String.prototype object's 'repeat' routine
*
@@ -1338,8 +1278,6 @@ ecma_builtin_string_prototype_object_code_point_at (ecma_string_t *this_string_p
return ecma_make_uint32_value (lit_convert_surrogate_pair_to_code_point (first, second));
} /* ecma_builtin_string_prototype_object_code_point_at */
-#endif /* JERRY_ESNEXT */
-
#if JERRY_BUILTIN_ANNEXB
/**
@@ -1403,8 +1341,6 @@ ecma_builtin_string_prototype_object_substr (ecma_string_t *this_string_p, /**<
#endif /* JERRY_BUILTIN_ANNEXB */
-#if JERRY_ESNEXT
-
/**
* The String.prototype object's @@iterator routine
*
@@ -1423,8 +1359,6 @@ ecma_builtin_string_prototype_object_iterator (ecma_value_t to_string) /**< this
ECMA_ITERATOR_VALUES);
} /* ecma_builtin_string_prototype_object_iterator */
-#endif /* JERRY_ESNEXT */
-
/**
* Dispatcher of the built-in's routines
*
@@ -1458,12 +1392,10 @@ ecma_builtin_string_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
return ecma_builtin_string_prototype_object_match (this_arg, arg1);
}
-#if JERRY_ESNEXT
if (builtin_routine_id == ECMA_STRING_PROTOTYPE_MATCH_ALL)
{
return ecma_builtin_string_prototype_object_match_all (this_arg, arg1);
}
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_REGEXP */
if (builtin_routine_id <= ECMA_STRING_PROTOTYPE_CHAR_CODE_AT)
@@ -1478,12 +1410,11 @@ ecma_builtin_string_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
{
return ecma_builtin_string_prototype_object_replace_helper (this_arg, arg1, arg2, false);
}
-#if JERRY_ESNEXT
+
else if (builtin_routine_id == ECMA_STRING_PROTOTYPE_REPLACE_ALL)
{
return ecma_builtin_string_prototype_object_replace_helper (this_arg, arg1, arg2, true);
}
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_REGEXP */
ecma_string_t *string_p = ecma_op_to_string (this_arg);
@@ -1515,11 +1446,9 @@ ecma_builtin_string_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
}
case ECMA_STRING_PROTOTYPE_LAST_INDEX_OF:
case ECMA_STRING_PROTOTYPE_INDEX_OF:
-#if JERRY_ESNEXT
case ECMA_STRING_PROTOTYPE_STARTS_WITH:
case ECMA_STRING_PROTOTYPE_INCLUDES:
case ECMA_STRING_PROTOTYPE_ENDS_WITH:
-#endif /* JERRY_ESNEXT */
{
ecma_string_index_of_mode_t mode;
mode = (ecma_string_index_of_mode_t) (builtin_routine_id - ECMA_STRING_PROTOTYPE_LAST_INDEX_OF);
@@ -1569,7 +1498,6 @@ ecma_builtin_string_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
break;
}
#endif /* JERRY_BUILTIN_ANNEXB */
-#if JERRY_ESNEXT
case ECMA_STRING_PROTOTYPE_REPEAT:
{
ret_value = ecma_builtin_string_prototype_object_repeat (string_p, arg1);
@@ -1591,7 +1519,6 @@ ecma_builtin_string_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
ret_value = ecma_string_pad (to_string_val, arg1, arg2, builtin_routine_id == ECMA_STRING_PROTOTYPE_PAD_START);
break;
}
-#endif /* JERRY_ESNEXT */
default:
{
JERRY_UNREACHABLE ();
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.inc.h
index ba3278f1..3e54d262 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.inc.h
@@ -49,9 +49,7 @@ ROUTINE (LIT_MAGIC_STRING_LOCALE_COMPARE_UL, ECMA_STRING_PROTOTYPE_LOCALE_COMPAR
#if JERRY_BUILTIN_REGEXP
ROUTINE (LIT_MAGIC_STRING_MATCH, ECMA_STRING_PROTOTYPE_MATCH, 1, 1)
ROUTINE (LIT_MAGIC_STRING_REPLACE, ECMA_STRING_PROTOTYPE_REPLACE, 2, 2)
-#if JERRY_ESNEXT
ROUTINE (LIT_MAGIC_STRING_REPLACE_ALL, ECMA_STRING_PROTOTYPE_REPLACE_ALL, 2, 2)
-#endif /* JERRY_ESNEXT */
ROUTINE (LIT_MAGIC_STRING_SEARCH, ECMA_STRING_PROTOTYPE_SEARCH, 1, 1)
#endif /* JERRY_BUILTIN_REGEXP */
@@ -67,7 +65,6 @@ ROUTINE (LIT_MAGIC_STRING_TRIM, ECMA_STRING_PROTOTYPE_TRIM, 0, 0)
ROUTINE (LIT_MAGIC_STRING_SUBSTR, ECMA_STRING_PROTOTYPE_SUBSTR, 2, 2)
#endif /* JERRY_BUILTIN_ANNEXB */
-#if JERRY_ESNEXT
ROUTINE (LIT_MAGIC_STRING_REPEAT, ECMA_STRING_PROTOTYPE_REPEAT, 1, 1)
ROUTINE (LIT_MAGIC_STRING_STARTS_WITH, ECMA_STRING_PROTOTYPE_STARTS_WITH, 2, 1)
ROUTINE (LIT_MAGIC_STRING_INCLUDES, ECMA_STRING_PROTOTYPE_INCLUDES, 2, 1)
@@ -82,7 +79,6 @@ INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TRIM_START, LIT_MAGIC_STRING_TRIM_START, EC
INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TRIM_LEFT, LIT_MAGIC_STRING_TRIM_START, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TRIM_END, LIT_MAGIC_STRING_TRIM_END, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TRIM_RIGHT, LIT_MAGIC_STRING_TRIM_END, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_STRING */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-string.c b/jerry-core/ecma/builtin-objects/ecma-builtin-string.c
index 13207c42..b0276312 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-string.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-string.c
@@ -22,12 +22,10 @@
#include "ecma-helpers.h"
#include "ecma-objects.h"
#include "ecma-string-object.h"
-
-#include "lit-strings.h"
-#if JERRY_ESNEXT
#include "ecma-symbol-object.h"
-#endif /* JERRY_ESNEXT */
+
#include "jrt.h"
+#include "lit-strings.h"
#if JERRY_BUILTIN_STRING
@@ -118,8 +116,6 @@ ecma_builtin_string_object_from_char_code (const ecma_value_t args[], /**< argum
return isError ? ECMA_VALUE_ERROR : ecma_make_string_value (ret_string_p);
} /* ecma_builtin_string_object_from_char_code */
-#if JERRY_ESNEXT
-
/**
* The String object's 'raw' routine
*
@@ -332,8 +328,6 @@ ecma_builtin_string_object_from_code_point (const ecma_value_t args[], /**< argu
return ecma_make_string_value (ret_str_p);
} /* ecma_builtin_string_object_from_code_point */
-#endif /* JERRY_ESNEXT */
-
/**
* Handle calling [[Call]] of built-in String object
*
@@ -355,13 +349,11 @@ ecma_builtin_string_dispatch_call (const ecma_value_t *arguments_list_p, /**< ar
{
ret_value = ecma_make_magic_string_value (LIT_MAGIC_STRING__EMPTY);
}
-#if JERRY_ESNEXT
/* 2.a */
else if (ecma_is_value_symbol (arguments_list_p[0]))
{
ret_value = ecma_get_symbol_descriptive_string (arguments_list_p[0]);
}
-#endif /* JERRY_ESNEXT */
/* 2.b */
else
{
@@ -412,7 +404,6 @@ ecma_builtin_string_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
{
return ecma_builtin_string_object_from_char_code (arguments_list_p, arguments_number);
}
-#if JERRY_ESNEXT
case ECMA_BUILTIN_STRING_OBJECT_FROM_CODE_POINT:
{
return ecma_builtin_string_object_from_code_point (arguments_list_p, arguments_number);
@@ -421,7 +412,6 @@ ecma_builtin_string_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
{
return ecma_builtin_string_object_raw (arguments_list_p, arguments_number);
}
-#endif /* JERRY_ESNEXT */
default:
{
JERRY_UNREACHABLE ();
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-string.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-string.inc.h
index 8bc41343..2178acf1 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-string.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-string.inc.h
@@ -31,19 +31,13 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
/* ECMA-262 v5, 15.7.3.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_STRING_PROTOTYPE, ECMA_PROPERTY_FIXED)
-
-#if JERRY_ESNEXT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_STRING_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
/* Routine properties:
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
ROUTINE (LIT_MAGIC_STRING_FROM_CHAR_CODE_UL, ECMA_BUILTIN_STRING_OBJECT_FROM_CHAR_CODE, NON_FIXED, 1)
-
-#if JERRY_ESNEXT
ROUTINE (LIT_MAGIC_STRING_FROM_CODE_POINT_UL, ECMA_BUILTIN_STRING_OBJECT_FROM_CODE_POINT, NON_FIXED, 1)
ROUTINE (LIT_MAGIC_STRING_RAW, ECMA_BUILTIN_STRING_OBJECT_RAW, NON_FIXED, 1)
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_STRING */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.c
index c508148b..df4c9d5f 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.c
@@ -25,8 +25,6 @@
#include "jrt.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -111,5 +109,3 @@ ecma_builtin_symbol_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.inc.h
index 585b86b6..9b0daa0c 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.inc.h
@@ -19,8 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* Object properties:
* (property name, object pointer getter) */
@@ -35,6 +33,5 @@ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_SYMBOL_UL, ECMA_
/* ECMA-262, v11, 19.4.3.2 */
ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_DESCRIPTION, ECMA_SYMBOL_PROTOTYPE_DESCRIPTION, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.c b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.c
index 38c13297..3ce75f9b 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.c
@@ -27,8 +27,6 @@
#include "jcontext.h"
#include "jrt.h"
-#if JERRY_ESNEXT
-
#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
@@ -253,5 +251,3 @@ ecma_builtin_symbol_key_for (ecma_value_t this_arg, /**< this argument */
* @}
* @}
*/
-
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.inc.h
index 1d34b3a4..9fecbd4f 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.inc.h
@@ -19,8 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
-#if JERRY_ESNEXT
-
/* Number properties:
* (property name, number value, writable, enumerable, configurable) */
@@ -79,6 +77,4 @@ SYMBOL_VALUE (LIT_MAGIC_STRING_MATCH_ALL, LIT_GLOBAL_SYMBOL_MATCH_ALL)
ROUTINE (LIT_MAGIC_STRING_FOR, ecma_builtin_symbol_for, 1, 1)
ROUTINE (LIT_MAGIC_STRING_KEY_FOR, ecma_builtin_symbol_key_for, 1, 1)
-#endif /* JERRY_ESNEXT */
-
#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.c b/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.c
index 6227ef60..449c0db6 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.c
@@ -67,9 +67,6 @@ ecma_value_t
ecma_builtin_syntax_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
uint32_t arguments_list_len) /**< number of arguments */
{
-#if !JERRY_ESNEXT
- return ecma_builtin_syntax_error_dispatch_call (arguments_list_p, arguments_list_len);
-#else /* JERRY_ESNEXT */
ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p),
ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE);
@@ -89,7 +86,6 @@ ecma_builtin_syntax_error_dispatch_construct (const ecma_value_t *arguments_list
ecma_deref_object (proto_p);
return result;
-#endif /* JERRY_ESNEXT */
} /* ecma_builtin_syntax_error_dispatch_construct */
/**
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.inc.h
index 18df8255..bee730cf 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.inc.h
@@ -31,10 +31,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
/* ECMA-262 v5, 15.11.3.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE, ECMA_PROPERTY_FIXED)
-
-#if JERRY_ESNEXT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_SYNTAX_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_ERRORS */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.c b/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.c
index a16fce50..c18cdaad 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.c
@@ -67,9 +67,6 @@ ecma_value_t
ecma_builtin_type_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
uint32_t arguments_list_len) /**< number of arguments */
{
-#if !JERRY_ESNEXT
- return ecma_builtin_type_error_dispatch_call (arguments_list_p, arguments_list_len);
-#else /* JERRY_ESNEXT */
ecma_object_t *proto_p =
ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p), ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE);
@@ -89,7 +86,6 @@ ecma_builtin_type_error_dispatch_construct (const ecma_value_t *arguments_list_p
ecma_deref_object (proto_p);
return result;
-#endif /* JERRY_ESNEXT */
} /* ecma_builtin_type_error_dispatch_construct */
/**
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.inc.h
index a4508f91..d2bb8e33 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.inc.h
@@ -31,10 +31,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
/* ECMA-262 v5, 15.11.3.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE, ECMA_PROPERTY_FIXED)
-
-#if JERRY_ESNEXT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_TYPE_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_ERRORS */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.c b/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.c
index 52d7a2b6..1c7333e9 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.c
@@ -67,9 +67,6 @@ ecma_value_t
ecma_builtin_uri_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
uint32_t arguments_list_len) /**< number of arguments */
{
-#if !JERRY_ESNEXT
- return ecma_builtin_uri_error_dispatch_call (arguments_list_p, arguments_list_len);
-#else /* JERRY_ESNEXT */
ecma_object_t *proto_p =
ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p), ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE);
@@ -89,7 +86,6 @@ ecma_builtin_uri_error_dispatch_construct (const ecma_value_t *arguments_list_p,
ecma_deref_object (proto_p);
return result;
-#endif /* JERRY_ESNEXT */
} /* ecma_builtin_uri_error_dispatch_construct */
/**
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.inc.h
index fd98a1d7..ed1d3d5a 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.inc.h
@@ -31,10 +31,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
/* ECMA-262 v5, 15.11.3.1 */
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE, ECMA_PROPERTY_FIXED)
-
-#if JERRY_ESNEXT
STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_URI_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE)
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_ERRORS */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtins-internal.h b/jerry-core/ecma/builtin-objects/ecma-builtins-internal.h
index c8030b6b..5695e2d8 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtins-internal.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtins-internal.h
@@ -31,12 +31,10 @@ typedef enum
ECMA_BUILTIN_PROPERTY_SIMPLE, /**< simple value property */
ECMA_BUILTIN_PROPERTY_NUMBER, /**< number value property */
ECMA_BUILTIN_PROPERTY_STRING, /**< string value property */
-#if JERRY_ESNEXT
ECMA_BUILTIN_PROPERTY_SYMBOL, /**< symbol value property */
ECMA_BUILTIN_PROPERTY_INTRINSIC_PROPERTY, /**< intrinsic routine property */
ECMA_BUILTIN_PROPERTY_ACCESSOR_BUILTIN_FUNCTION, /**< full accessor property with builtin function object
getter/setter pair */
-#endif /* JERRY_ESNEXT */
ECMA_BUILTIN_PROPERTY_OBJECT, /**< builtin object property */
ECMA_BUILTIN_PROPERTY_ROUTINE, /**< routine property */
ECMA_BUILTIN_PROPERTY_ACCESSOR_READ_WRITE, /**< full accessor property */
@@ -51,11 +49,9 @@ typedef enum
{
ECMA_BUILTIN_NUMBER_MAX = 256, /**< value of ECMA_NUMBER_MAX_VALUE */
ECMA_BUILTIN_NUMBER_MIN, /**< value of ECMA_NUMBER_MIN_VALUE */
-#if JERRY_ESNEXT
ECMA_BUILTIN_NUMBER_EPSILON, /**< value of ECMA_NUMBER_EPSILON */
ECMA_BUILTIN_NUMBER_MAX_SAFE_INTEGER, /**< value of ECMA_NUMBER_MAX_SAFE_INTEGER */
ECMA_BUILTIN_NUMBER_MIN_SAFE_INTEGER, /**< value of ECMA_NUMBER_MIN_SAFE_INTEGER */
-#endif /* JERRY_ESNEXT */
ECMA_BUILTIN_NUMBER_E, /**< value of ECMA_NUMBER_E */
ECMA_BUILTIN_NUMBER_PI, /**< value of ECMA_NUMBER_PI */
ECMA_BUILTIN_NUMBER_LN10, /**< value of ECMA_NUMBER_LN10 */
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtins.c b/jerry-core/ecma/builtin-objects/ecma-builtins.c
index 61692cb0..c1450071 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtins.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtins.c
@@ -455,40 +455,6 @@ ecma_instantiate_builtin (ecma_global_object_t *global_object_p, /**< global obj
}
#endif /* JERRY_BUILTIN_BOOLEAN */
-#if !JERRY_ESNEXT
-#if JERRY_BUILTIN_DATE
- case ECMA_BUILTIN_ID_DATE_PROTOTYPE:
- {
- JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_BUILT_IN_CLASS);
- ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
-
- ext_object_p->u.cls.type = ECMA_OBJECT_CLASS_DATE;
-
- ecma_number_t *prim_prop_num_value_p = ecma_alloc_number ();
- *prim_prop_num_value_p = ecma_number_make_nan ();
- ECMA_SET_INTERNAL_VALUE_POINTER (ext_object_p->u.cls.u3.value, prim_prop_num_value_p);
- break;
- }
-#endif /* JERRY_BUILTIN_DATE */
-
-#if JERRY_BUILTIN_REGEXP
- case ECMA_BUILTIN_ID_REGEXP_PROTOTYPE:
- {
- JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_BUILT_IN_CLASS);
- ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
-
- ext_object_p->u.cls.type = ECMA_OBJECT_CLASS_REGEXP;
-
- re_compiled_code_t *bc_p =
- re_compile_bytecode (ecma_get_magic_string (LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP), RE_FLAG_EMPTY);
-
- JERRY_ASSERT (bc_p != NULL);
-
- ECMA_SET_INTERNAL_VALUE_POINTER (ext_object_p->u.cls.u3.value, bc_p);
- break;
- }
-#endif /* JERRY_BUILTIN_REGEXP */
-#endif /* !JERRY_ESNEXT */
default:
{
JERRY_ASSERT (obj_type != ECMA_OBJECT_TYPE_BUILT_IN_CLASS);
@@ -550,15 +516,13 @@ ecma_builtin_create_global_object (void)
/* Temporary self reference for GC mark. */
ECMA_SET_NON_NULL_POINTER (global_object_p->global_env_cp, object_p);
-#if JERRY_ESNEXT
global_object_p->global_scope_cp = global_object_p->global_env_cp;
-#endif /* JERRY_ESNEXT */
ecma_object_t *global_lex_env_p = ecma_create_object_lex_env (NULL, object_p);
+
ECMA_SET_NON_NULL_POINTER (global_object_p->global_env_cp, global_lex_env_p);
-#if JERRY_ESNEXT
global_object_p->global_scope_cp = global_object_p->global_env_cp;
-#endif /* JERRY_ESNEXT */
+
ecma_deref_object (global_lex_env_p);
ecma_object_t *prototype_object_p;
@@ -727,8 +691,6 @@ ecma_builtin_make_function_object_for_setter_accessor (ecma_object_t *builtin_ob
ECMA_BUILTIN_ROUTINE_SETTER);
} /* ecma_builtin_make_function_object_for_setter_accessor */
-#if JERRY_ESNEXT
-
/**
* Create specification defined properties for built-in native handlers.
*
@@ -769,8 +731,6 @@ ecma_builtin_native_handler_try_to_instantiate_property (ecma_object_t *object_p
return prop_p;
} /* ecma_builtin_native_handler_try_to_instantiate_property */
-#endif /* JERRY_ESNEXT */
-
/**
* Lazy instantiation of builtin routine property of builtin object
*
@@ -789,12 +749,10 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**<
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (ext_func_p->u.built_in.id == ECMA_BUILTIN_ID_HANDLER))
{
return ecma_builtin_native_handler_try_to_instantiate_property (object_p, property_name_p);
}
-#endif /* !JERRY_ESNEXT */
if (ecma_string_is_length (property_name_p))
{
@@ -803,7 +761,6 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**<
*/
ecma_property_t *len_prop_p;
-#if JERRY_ESNEXT
uint8_t *bitset_p = &ext_func_p->u.built_in.u2.routine_flags;
if (*bitset_p & ECMA_BUILTIN_ROUTINE_LENGTH_INITIALIZED)
@@ -816,12 +773,6 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**<
* as it is configurable and so can be deleted (ECMA-262 v6, 19.2.4.1) */
ecma_property_value_t *len_prop_value_p =
ecma_create_named_data_property (object_p, property_name_p, ECMA_PROPERTY_BUILT_IN_CONFIGURABLE, &len_prop_p);
-#else /* !JERRY_ESNEXT */
- /* We don't need to mark that the property was already lazy instantiated,
- * as it is non-configurable and so can't be deleted (ECMA-262 v5, 13.2.5) */
- ecma_property_value_t *len_prop_value_p =
- ecma_create_named_data_property (object_p, property_name_p, ECMA_PROPERTY_BUILT_IN_FIXED, &len_prop_p);
-#endif /* JERRY_ESNEXT */
uint8_t length = 0;
@@ -845,7 +796,6 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**<
return len_prop_p;
}
-#if JERRY_ESNEXT
/*
* Lazy instantiation of 'name' property
*/
@@ -918,7 +868,6 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**<
return name_prop_p;
}
-#endif /* JERRY_ESNEXT */
return NULL;
} /* ecma_builtin_routine_try_to_instantiate_property */
@@ -937,12 +886,10 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
{
lit_magic_string_id_t magic_string_id = ecma_get_string_magic (property_name_p);
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (ecma_prop_name_is_symbol (property_name_p)) && property_name_p->u.hash & ECMA_SYMBOL_FLAG_GLOBAL)
{
magic_string_id = (property_name_p->u.hash >> ECMA_SYMBOL_FLAGS_SHIFT);
}
-#endif /* JERRY_ESNEXT */
if (magic_string_id == LIT_MAGIC_STRING__COUNT)
{
@@ -1034,11 +981,9 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
static const ecma_number_t builtin_number_list[] = {
ECMA_NUMBER_MAX_VALUE,
ECMA_NUMBER_MIN_VALUE,
-#if JERRY_ESNEXT
ECMA_NUMBER_EPSILON,
ECMA_NUMBER_MAX_SAFE_INTEGER,
ECMA_NUMBER_MIN_SAFE_INTEGER,
-#endif /* JERRY_ESNEXT */
ECMA_NUMBER_E,
ECMA_NUMBER_PI,
ECMA_NUMBER_LN10,
@@ -1083,7 +1028,6 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
value = ecma_make_magic_string_value ((lit_magic_string_id_t) curr_property_p->value);
break;
}
-#if JERRY_ESNEXT
case ECMA_BUILTIN_PROPERTY_SYMBOL:
{
lit_magic_string_id_t symbol_id = (lit_magic_string_id_t) curr_property_p->value;
@@ -1108,7 +1052,6 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
ecma_ref_object (setter_p);
break;
}
-#endif /* JERRY_ESNEXT */
case ECMA_BUILTIN_PROPERTY_OBJECT:
{
ecma_object_t *builtin_object_p;
@@ -1182,8 +1125,6 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
return prop_p;
} /* ecma_builtin_try_to_instantiate_property */
-#if JERRY_ESNEXT
-
/**
* Delete configurable properties of native handlers.
*/
@@ -1241,8 +1182,6 @@ ecma_builtin_routine_delete_built_in_property (ecma_object_t *object_p, /**< obj
*bitset_p |= ECMA_BUILTIN_ROUTINE_NAME_INITIALIZED;
} /* ecma_builtin_routine_delete_built_in_property */
-#endif /* JERRY_ESNEXT */
-
/**
* Delete configurable properties of built-ins.
*/
@@ -1252,7 +1191,6 @@ ecma_builtin_delete_built_in_property (ecma_object_t *object_p, /**< object */
{
lit_magic_string_id_t magic_string_id = ecma_get_string_magic (property_name_p);
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (ecma_prop_name_is_symbol (property_name_p)))
{
if (property_name_p->u.hash & ECMA_SYMBOL_FLAG_GLOBAL)
@@ -1260,7 +1198,6 @@ ecma_builtin_delete_built_in_property (ecma_object_t *object_p, /**< object */
magic_string_id = (property_name_p->u.hash >> ECMA_SYMBOL_FLAGS_SHIFT);
}
}
-#endif /* JERRY_ESNEXT */
ecma_built_in_props_t *built_in_props_p;
ecma_object_type_t object_type = ecma_get_object_type (object_p);
@@ -1307,8 +1244,6 @@ ecma_builtin_delete_built_in_property (ecma_object_t *object_p, /**< object */
*bitset_p |= bit_for_index;
} /* ecma_builtin_delete_built_in_property */
-#if JERRY_ESNEXT
-
/**
* List names of an Built-in native handler object's lazy instantiated properties,
* adding them to corresponding string collections
@@ -1334,8 +1269,6 @@ ecma_builtin_native_handler_list_lazy_property_names (ecma_object_t *object_p, /
}
} /* ecma_builtin_native_handler_list_lazy_property_names */
-#endif /* JERRY_ESNEXT */
-
/**
* List names of a built-in function's lazy instantiated properties
*
@@ -1356,7 +1289,6 @@ ecma_builtin_routine_list_lazy_property_names (ecma_object_t *object_p, /**< a b
return;
}
-#if JERRY_ESNEXT
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
if (JERRY_UNLIKELY (ext_func_p->u.built_in.id == ECMA_BUILTIN_ID_HANDLER))
@@ -1377,11 +1309,6 @@ ecma_builtin_routine_list_lazy_property_names (ecma_object_t *object_p, /**< a b
ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_NAME));
prop_counter_p->string_named_props++;
}
-#else /* !JERRY_ESNEXT */
- /* 'length' property is non-enumerable (ECMA-262 v5, 15) */
- ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH));
- prop_counter_p->string_named_props++;
-#endif /* JERRY_ESNEXT */
} /* ecma_builtin_routine_list_lazy_property_names */
/**
@@ -1421,10 +1348,8 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
uint8_t *bitset_p = built_in_props_p->u2.instantiated_bitset + 1;
#endif /* JERRY_BUILTIN_REALMS */
-#if JERRY_ESNEXT
uint8_t *symbol_bitset_p = bitset_p;
bool has_symbol = true;
-#endif /* JERRY_BUILTIN_REALMS */
if (!(filter & JERRY_PROPERTY_FILTER_EXCLUDE_STRINGS))
{
@@ -1432,9 +1357,7 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
uint8_t bitset = built_in_props_p->u2.instantiated_bitset[0];
uint32_t index = 0;
-#if JERRY_ESNEXT
has_symbol = false;
-#endif /* JERRY_BUILTIN_REALMS */
while (curr_property_p->magic_string_id != LIT_MAGIC_STRING__COUNT)
{
@@ -1448,21 +1371,17 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
if (!(bitset & bit_for_index))
{
-#if JERRY_ESNEXT
if (JERRY_LIKELY (curr_property_p->magic_string_id < LIT_NON_INTERNAL_MAGIC_STRING__COUNT))
{
-#endif /* JERRY_ESNEXT */
ecma_value_t name = ecma_make_magic_string_value ((lit_magic_string_id_t) curr_property_p->magic_string_id);
ecma_collection_push_back (prop_names_p, name);
prop_counter_p->string_named_props++;
-#if JERRY_ESNEXT
}
else
{
JERRY_ASSERT (LIT_IS_GLOBAL_SYMBOL (curr_property_p->magic_string_id));
has_symbol = true;
}
-#endif /* JERRY_ESNEXT */
}
curr_property_p++;
@@ -1470,7 +1389,6 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
}
}
-#if JERRY_ESNEXT
if (has_symbol && !(filter & JERRY_PROPERTY_FILTER_EXCLUDE_SYMBOLS))
{
const ecma_builtin_property_descriptor_t *curr_property_p = ecma_builtin_property_list_references[builtin_id];
@@ -1498,7 +1416,6 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
index++;
}
}
-#endif /* JERRY_ESNEXT */
} /* ecma_builtin_list_lazy_property_names */
/**
@@ -1563,13 +1480,11 @@ ecma_builtin_dispatch_call (ecma_object_t *obj_p, /**< built-in object */
if (ecma_builtin_function_is_routine (obj_p))
{
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (ext_obj_p->u.built_in.id == ECMA_BUILTIN_ID_HANDLER))
{
ecma_builtin_handler_t handler = ecma_builtin_handler_get (ext_obj_p->u.built_in.routine_id);
return handler (obj_p, arguments_list_p, arguments_list_len);
}
-#endif /* !JERRY_ESNEXT */
return ecma_builtin_dispatch_routine (ext_obj_p, this_arg_value, arguments_list_p, arguments_list_len);
}
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtins.h b/jerry-core/ecma/builtin-objects/ecma-builtins.h
index 96040de7..82761cdc 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtins.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtins.h
@@ -38,8 +38,6 @@ typedef enum
ECMA_BUILTIN_ID__COUNT /**< number of built-in objects */
} ecma_builtin_id_t;
-#if JERRY_ESNEXT
-
/**
* Special id for handlers (handlers are not regular built-ins, but
* they use the same ecma_built_in_props_t structure as other built-ins)
@@ -51,8 +49,6 @@ typedef enum
*/
#define ECMA_BUILTIN_GLOBAL_SYMBOL_COUNT (LIT_GLOBAL_SYMBOL__LAST - LIT_GLOBAL_SYMBOL__FIRST + 1)
-#endif /* JERRY_ESNEXT */
-
/**
* Construct a routine value
*/
@@ -100,9 +96,7 @@ typedef struct
ecma_value_t this_binding; /**< 'this' binding of this global object */
#endif /* JERRY_BUILTIN_REALMS */
jmem_cpointer_t global_env_cp; /**< global lexical environment */
-#if JERRY_ESNEXT
jmem_cpointer_t global_scope_cp; /**< global lexical scope */
-#endif /* JERRY_ESNEXT */
jmem_cpointer_t builtin_objects[ECMA_BUILTIN_OBJECTS_COUNT]; /**< pointer to instances of built-in objects */
} ecma_global_object_t;
@@ -120,9 +114,7 @@ ecma_value_t ecma_builtin_dispatch_construct (ecma_object_t *obj_p,
ecma_property_t *ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p,
ecma_string_t *property_name_p);
ecma_property_t *ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, ecma_string_t *property_name_p);
-#if JERRY_ESNEXT
void ecma_builtin_routine_delete_built_in_property (ecma_object_t *object_p, ecma_string_t *property_name_p);
-#endif /* JERRY_ESNEXT */
void ecma_builtin_delete_built_in_property (ecma_object_t *object_p, ecma_string_t *property_name_p);
void ecma_builtin_routine_list_lazy_property_names (ecma_object_t *object_p,
ecma_collection_t *prop_names_p,
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h
index 48cae1ca..449aef98 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h
@@ -46,7 +46,6 @@ BUILTIN_ROUTINE (ECMA_BUILTIN_ID_ARRAY,
array)
#endif /* JERRY_BUILTIN_ARRAY */
-#if JERRY_ESNEXT
#if JERRY_BUILTIN_DATE
/* The Date.prototype object (20.3.4) */
BUILTIN (ECMA_BUILTIN_ID_DATE_PROTOTYPE,
@@ -64,25 +63,6 @@ BUILTIN (ECMA_BUILTIN_ID_REGEXP_PROTOTYPE,
true,
regexp_prototype)
#endif /* JERRY_BUILTIN_REGEXP */
-#else /* !JERRY_ESNEXT */
-#if JERRY_BUILTIN_DATE
-/* The Date.prototype object (15.9.4) */
-BUILTIN (ECMA_BUILTIN_ID_DATE_PROTOTYPE,
- ECMA_OBJECT_TYPE_BUILT_IN_CLASS,
- ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
- true,
- date_prototype)
-#endif /* JERRY_BUILTIN_DATE */
-
-#if JERRY_BUILTIN_REGEXP
-/* The RegExp.prototype object (15.10.6) */
-BUILTIN (ECMA_BUILTIN_ID_REGEXP_PROTOTYPE,
- ECMA_OBJECT_TYPE_BUILT_IN_CLASS,
- ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
- true,
- regexp_prototype)
-#endif /* JERRY_BUILTIN_REGEXP */
-#endif /* !JERRY_ESNEXT */
#if JERRY_BUILTIN_STRING
/* The String.prototype object (15.5.4) */
@@ -185,11 +165,7 @@ BUILTIN_ROUTINE (ECMA_BUILTIN_ID_REGEXP,
regexp)
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_ESNEXT
#define ECMA_BUILTIN_NATIVE_ERROR_PROTOTYPE_ID ECMA_BUILTIN_ID_ERROR
-#else /* !JERRY_ESNEXT */
-#define ECMA_BUILTIN_NATIVE_ERROR_PROTOTYPE_ID ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE
-#endif /* JERRY_ESNEXT */
/* The Error object (15.11.1) */
BUILTIN_ROUTINE (ECMA_BUILTIN_ID_ERROR,
@@ -276,7 +252,6 @@ BUILTIN_ROUTINE (ECMA_BUILTIN_ID_TYPE_ERROR,
true,
type_error)
-#if JERRY_ESNEXT
/* The AggregateError.prototype object (15.11.6.5) */
BUILTIN (ECMA_BUILTIN_ID_AGGREGATE_ERROR_PROTOTYPE,
ECMA_OBJECT_TYPE_BUILT_IN_GENERAL,
@@ -290,7 +265,6 @@ BUILTIN_ROUTINE (ECMA_BUILTIN_ID_AGGREGATE_ERROR,
ECMA_BUILTIN_NATIVE_ERROR_PROTOTYPE_ID,
true,
aggregate_error)
-#endif /* JERRY_ESNEXT */
/* The URIError.prototype object (15.11.6.6) */
BUILTIN (ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE,
@@ -503,8 +477,6 @@ BUILTIN (ECMA_BUILTIN_ID_BIGUINT64ARRAY_PROTOTYPE,
#endif /* JERRY_BUILTIN_BIGINT */
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
-
BUILTIN (ECMA_BUILTIN_ID_PROMISE_PROTOTYPE,
ECMA_OBJECT_TYPE_BUILT_IN_GENERAL,
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
@@ -517,8 +489,6 @@ BUILTIN_ROUTINE (ECMA_BUILTIN_ID_PROMISE,
true,
promise)
-#endif /* JERRY_ESNEXT */
-
#if JERRY_BUILTIN_CONTAINER
/* The Map prototype object (23.1.3) */
@@ -598,8 +568,6 @@ BUILTIN_ROUTINE (ECMA_BUILTIN_ID_PROXY,
proxy)
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_ESNEXT
-
/* Intrinsic hidden builtin object */
BUILTIN (ECMA_BUILTIN_ID_INTRINSIC_OBJECT,
ECMA_OBJECT_TYPE_BUILT_IN_GENERAL,
@@ -742,8 +710,6 @@ BUILTIN (ECMA_BUILTIN_ID_MAP_ITERATOR_PROTOTYPE,
map_iterator_prototype)
#endif /* JERRY_BUILTIN_CONTAINER */
-#endif /* JERRY_ESNEXT */
-
#if JERRY_BUILTIN_BIGINT
/* The %BigInt.prototype% object */
BUILTIN (ECMA_BUILTIN_ID_BIGINT_PROTOTYPE,
diff --git a/jerry-core/ecma/operations/ecma-arguments-object.c b/jerry-core/ecma/operations/ecma-arguments-object.c
index 4d289409..fd0c6798 100644
--- a/jerry-core/ecma/operations/ecma-arguments-object.c
+++ b/jerry-core/ecma/operations/ecma-arguments-object.c
@@ -297,25 +297,6 @@ ecma_op_arguments_object_try_to_lazy_instantiate_property (ecma_object_t *object
return prop_p;
}
-#if !JERRY_ESNEXT
- if (property_name_p == ecma_get_magic_string (LIT_MAGIC_STRING_CALLER))
- {
- if (arguments_p->header.u.cls.u1.arguments_flags & ECMA_ARGUMENTS_OBJECT_MAPPED)
- {
- return NULL;
- }
-
- ecma_object_t *thrower_p = ecma_builtin_get (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER);
-
- ecma_create_named_accessor_property (object_p,
- ecma_get_magic_string (LIT_MAGIC_STRING_CALLER),
- thrower_p,
- thrower_p,
- ECMA_PROPERTY_BUILT_IN_FIXED,
- &prop_p);
- return prop_p;
- }
-#else /* JERRY_ESNEXT */
if (ecma_op_compare_string_to_global_symbol (property_name_p, LIT_GLOBAL_SYMBOL_ITERATOR)
&& !(flags & ECMA_ARGUMENTS_OBJECT_ITERATOR_INITIALIZED))
{
@@ -331,7 +312,6 @@ ecma_op_arguments_object_try_to_lazy_instantiate_property (ecma_object_t *object
ecma_deref_object (ecma_get_object_from_value (prop_value_p->value));
return prop_p;
}
-#endif /* !JERRY_ESNEXT */
return NULL;
} /* ecma_op_arguments_object_try_to_lazy_instantiate_property */
@@ -362,7 +342,6 @@ ecma_op_arguments_delete_built_in_property (ecma_object_t *object_p, /**< the ob
return;
}
-#if JERRY_ESNEXT
if (ecma_prop_name_is_symbol (property_name_p))
{
JERRY_ASSERT (!(arguments_p->header.u.cls.u1.arguments_flags & ECMA_ARGUMENTS_OBJECT_ITERATOR_INITIALIZED));
@@ -371,7 +350,6 @@ ecma_op_arguments_delete_built_in_property (ecma_object_t *object_p, /**< the ob
arguments_p->header.u.cls.u1.arguments_flags |= ECMA_ARGUMENTS_OBJECT_ITERATOR_INITIALIZED;
return;
}
-#endif /* JERRY_ESNEXT */
uint32_t index = ecma_string_get_array_index (property_name_p);
@@ -436,24 +414,14 @@ ecma_op_arguments_object_list_lazy_property_names (ecma_object_t *obj_p, /**< ar
ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_CALLEE));
prop_counter_p->string_named_props++;
}
-
-#if !JERRY_ESNEXT
- if (!(flags & ECMA_ARGUMENTS_OBJECT_MAPPED))
- {
- ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_CALLER));
- prop_counter_p->string_named_props++;
- }
-#endif /* !JERRY_ESNEXT */
}
-#if JERRY_ESNEXT
if (!(filter & JERRY_PROPERTY_FILTER_EXCLUDE_SYMBOLS) && !(flags & ECMA_ARGUMENTS_OBJECT_ITERATOR_INITIALIZED))
{
ecma_string_t *symbol_p = ecma_op_get_global_symbol (LIT_GLOBAL_SYMBOL_ITERATOR);
ecma_collection_push_back (prop_names_p, ecma_make_symbol_value (symbol_p));
prop_counter_p->symbol_named_props++;
}
-#endif /* JERRY_ESNEXT */
} /* ecma_op_arguments_object_list_lazy_property_names */
/**
diff --git a/jerry-core/ecma/operations/ecma-array-object.c b/jerry-core/ecma/operations/ecma-array-object.c
index b150a980..5919ee6b 100644
--- a/jerry-core/ecma/operations/ecma-array-object.c
+++ b/jerry-core/ecma/operations/ecma-array-object.c
@@ -152,13 +152,11 @@ ecma_op_new_array_object (uint32_t length) /**< length of the new array */
ecma_object_t *
ecma_op_new_array_object_from_length (ecma_length_t length) /**< length of the new array */
{
-#if JERRY_ESNEXT
if (length > UINT32_MAX)
{
ecma_raise_range_error (ECMA_ERR_INVALID_ARRAY_LENGTH);
return NULL;
}
-#endif /* JERRY_ESNEXT */
return ecma_op_new_array_object ((uint32_t) length);
} /* ecma_op_new_array_object_from_length */
@@ -663,7 +661,6 @@ ecma_fast_array_object_own_property_keys (ecma_object_t *object_p, /**< fast acc
return ret_p;
} /* ecma_fast_array_object_own_property_keys */
-#if JERRY_ESNEXT
/**
* Array object creation with custom prototype.
*
@@ -783,7 +780,6 @@ ecma_op_create_array_iterator (ecma_object_t *obj_p, /**< array object */
ECMA_OBJECT_CLASS_ARRAY_ITERATOR,
kind);
} /* ecma_op_create_array_iterator */
-#endif /* JERRY_ESNEXT */
/**
* Low level delete of array items from new_length to old_length
diff --git a/jerry-core/ecma/operations/ecma-array-object.h b/jerry-core/ecma/operations/ecma-array-object.h
index d2d55f90..73d65805 100644
--- a/jerry-core/ecma/operations/ecma-array-object.h
+++ b/jerry-core/ecma/operations/ecma-array-object.h
@@ -88,11 +88,9 @@ ecma_collection_t *ecma_fast_array_object_own_property_keys (ecma_object_t *obje
void ecma_fast_array_convert_to_normal (ecma_object_t *object_p);
-#if JERRY_ESNEXT
ecma_object_t *ecma_op_array_species_create (ecma_object_t *original_array_p, ecma_length_t length);
ecma_value_t ecma_op_create_array_iterator (ecma_object_t *obj_p, ecma_iterator_kind_t kind);
-#endif /* JERRY_ESNEXT */
ecma_value_t ecma_op_array_object_set_length (ecma_object_t *object_p, ecma_value_t new_value, uint16_t flags);
diff --git a/jerry-core/ecma/operations/ecma-async-generator-object.c b/jerry-core/ecma/operations/ecma-async-generator-object.c
index f40dc5b1..f73e4e18 100644
--- a/jerry-core/ecma/operations/ecma-async-generator-object.c
+++ b/jerry-core/ecma/operations/ecma-async-generator-object.c
@@ -32,8 +32,6 @@
#include "vm-stack.h"
#include "vm.h"
-#if JERRY_ESNEXT
-
/** \addtogroup ecma ECMA
* @{
*
@@ -126,6 +124,9 @@ ecma_async_yield_call (ecma_value_t function, /**< function (takes reference) */
/**
* Perform an exception throw and call the approprite handler
+ *
+ * @return ecma value
+ * Returned value must be freed with ecma_free_value.
*/
static ecma_value_t
ecma_async_yield_throw (vm_executable_object_t *async_generator_object_p, /**< async generator */
@@ -516,8 +517,6 @@ ecma_await_continue (vm_executable_object_t *executable_object_p, /**< executabl
}
} /* ecma_await_continue */
-#endif /* JERRY_ESNEXT */
-
/**
* @}
* @}
diff --git a/jerry-core/ecma/operations/ecma-async-generator-object.h b/jerry-core/ecma/operations/ecma-async-generator-object.h
index b5a94cf4..bcd58e0f 100644
--- a/jerry-core/ecma/operations/ecma-async-generator-object.h
+++ b/jerry-core/ecma/operations/ecma-async-generator-object.h
@@ -20,8 +20,6 @@
#include "vm-defines.h"
-#if JERRY_ESNEXT
-
/** \addtogroup ecma ECMA
* @{
*
@@ -82,8 +80,6 @@ void ecma_async_generator_finalize (vm_executable_object_t *async_generator_obje
ecma_value_t ecma_await_continue (vm_executable_object_t *async_generator_object_p, ecma_value_t value);
-#endif /* JERRY_ESNEXT */
-
/**
* @}
* @}
diff --git a/jerry-core/ecma/operations/ecma-big-uint.c b/jerry-core/ecma/operations/ecma-big-uint.c
index 990318e9..3d058209 100644
--- a/jerry-core/ecma/operations/ecma-big-uint.c
+++ b/jerry-core/ecma/operations/ecma-big-uint.c
@@ -1473,8 +1473,6 @@ ecma_big_uint_shift_right (ecma_extended_primitive_t *left_value_p, /**< left Bi
return ecma_big_uint_increase_result (result_value_p);
} /* ecma_big_uint_shift_right */
-#if JERRY_ESNEXT
-
/**
* Compute the left value raised to the power of right value
*
@@ -1545,8 +1543,6 @@ ecma_big_uint_pow (ecma_extended_primitive_t *left_value_p, /**< left BigUInt va
return result_p;
} /* ecma_big_uint_pow */
-#endif /* JERRY_ESNEXT */
-
/**
* Perform bitwise operations on two BigUInt numbers
*
diff --git a/jerry-core/ecma/operations/ecma-big-uint.h b/jerry-core/ecma/operations/ecma-big-uint.h
index 7eec2dd5..727d780f 100644
--- a/jerry-core/ecma/operations/ecma-big-uint.h
+++ b/jerry-core/ecma/operations/ecma-big-uint.h
@@ -124,9 +124,7 @@ ecma_extended_primitive_t *ecma_big_uint_shift_left (ecma_extended_primitive_t *
ecma_extended_primitive_t *
ecma_big_uint_shift_right (ecma_extended_primitive_t *left_value_p, uint32_t right_value, bool increase_result);
-#if JERRY_ESNEXT
ecma_extended_primitive_t *ecma_big_uint_pow (ecma_extended_primitive_t *left_value_p, uint32_t right_value);
-#endif /* JERRY_ESNEXT */
ecma_extended_primitive_t *ecma_big_uint_bitwise_op (uint32_t operation_and_options,
ecma_extended_primitive_t *left_value_p,
diff --git a/jerry-core/ecma/operations/ecma-bigint.c b/jerry-core/ecma/operations/ecma-bigint.c
index 8ce37788..7a4464e0 100644
--- a/jerry-core/ecma/operations/ecma-bigint.c
+++ b/jerry-core/ecma/operations/ecma-bigint.c
@@ -1438,8 +1438,6 @@ ecma_bigint_shift (ecma_value_t left_value, /**< left BigInt value */
return ecma_make_extended_primitive_value (result_p, ECMA_TYPE_BIGINT);
} /* ecma_bigint_shift */
-#if JERRY_ESNEXT
-
/**
* Compute the left value raised to the power of right value
*
@@ -1528,8 +1526,6 @@ ecma_bigint_pow (ecma_value_t left_value, /**< left BigInt value */
return ecma_make_extended_primitive_value (result_p, ECMA_TYPE_BIGINT);
} /* ecma_bigint_pow */
-#endif /* JERRY_ESNEXT */
-
/**
* Convert the result to an ecma value
*
diff --git a/jerry-core/ecma/operations/ecma-bigint.h b/jerry-core/ecma/operations/ecma-bigint.h
index 33ad30d9..460ed769 100644
--- a/jerry-core/ecma/operations/ecma-bigint.h
+++ b/jerry-core/ecma/operations/ecma-bigint.h
@@ -70,9 +70,7 @@ ecma_value_t ecma_bigint_add_sub (ecma_value_t left_value, ecma_value_t right_va
ecma_value_t ecma_bigint_mul (ecma_value_t left_value, ecma_value_t right_value);
ecma_value_t ecma_bigint_div_mod (ecma_value_t left_value, ecma_value_t right_value, bool is_mod);
ecma_value_t ecma_bigint_shift (ecma_value_t left_value, ecma_value_t right_value, bool is_left);
-#if JERRY_ESNEXT
ecma_value_t ecma_bigint_pow (ecma_value_t left_value, ecma_value_t right_value);
-#endif /* JERRY_ESNEXT */
ecma_value_t ecma_bigint_and (ecma_value_t left_value, ecma_value_t right_value);
ecma_value_t ecma_bigint_or (ecma_value_t left_value, ecma_value_t right_value);
diff --git a/jerry-core/ecma/operations/ecma-boolean-object.c b/jerry-core/ecma/operations/ecma-boolean-object.c
index e33299c6..956aa4a7 100644
--- a/jerry-core/ecma/operations/ecma-boolean-object.c
+++ b/jerry-core/ecma/operations/ecma-boolean-object.c
@@ -56,7 +56,6 @@ ecma_op_create_boolean_object (ecma_value_t arg) /**< argument passed to the Boo
ecma_object_t *prototype_obj_p = ecma_builtin_get (proto_id);
-#if JERRY_ESNEXT
ecma_object_t *new_target = JERRY_CONTEXT (current_new_target_p);
if (new_target)
{
@@ -67,7 +66,7 @@ ecma_op_create_boolean_object (ecma_value_t arg) /**< argument passed to the Boo
return ECMA_VALUE_ERROR;
}
}
-#endif /* JERRY_ESNEXT */
+
ecma_object_t *object_p =
ecma_create_object (prototype_obj_p, sizeof (ecma_extended_object_t), ECMA_OBJECT_TYPE_CLASS);
@@ -75,12 +74,10 @@ ecma_op_create_boolean_object (ecma_value_t arg) /**< argument passed to the Boo
ext_object_p->u.cls.type = ECMA_OBJECT_CLASS_BOOLEAN;
ext_object_p->u.cls.u3.value = ecma_make_boolean_value (boolean_value);
-#if JERRY_ESNEXT
if (new_target)
{
ecma_deref_object (prototype_obj_p);
}
-#endif /* JERRY_ESNEXT */
return ecma_make_object_value (object_p);
} /* ecma_op_create_boolean_object */
diff --git a/jerry-core/ecma/operations/ecma-comparison.c b/jerry-core/ecma/operations/ecma-comparison.c
index 68135fa2..5a32a2c6 100644
--- a/jerry-core/ecma/operations/ecma-comparison.c
+++ b/jerry-core/ecma/operations/ecma-comparison.c
@@ -196,7 +196,6 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
return ecma_make_boolean_value (is_equal);
}
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (ecma_is_value_symbol (x)))
{
if (!ecma_is_value_object (y))
@@ -209,14 +208,10 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
y ^= x;
x ^= y;
}
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (ecma_is_value_object (x));
- if (ecma_is_value_string (y)
-#if JERRY_ESNEXT
- || ecma_is_value_symbol (y)
-#endif /* JERRY_ESNEXT */
+ if (ecma_is_value_string (y) || ecma_is_value_symbol (y)
#if JERRY_BUILTIN_BIGINT
|| ecma_is_value_bigint (y)
#endif /* JERRY_BUILTIN_BIGINT */
@@ -254,10 +249,7 @@ bool
ecma_op_strict_equality_compare (ecma_value_t x, /**< first operand */
ecma_value_t y) /**< second operand */
{
- if (ecma_is_value_direct (x) || ecma_is_value_direct (y)
-#if JERRY_ESNEXT
- || ecma_is_value_symbol (x) || ecma_is_value_symbol (y)
-#endif /* JERRY_ESNEXT */
+ if (ecma_is_value_direct (x) || ecma_is_value_direct (y) || ecma_is_value_symbol (x) || ecma_is_value_symbol (y)
|| ecma_is_value_object (x) || ecma_is_value_object (y))
{
JERRY_ASSERT (!ecma_is_value_direct (x) || ecma_is_value_undefined (x) || ecma_is_value_null (x)
diff --git a/jerry-core/ecma/operations/ecma-container-object.c b/jerry-core/ecma/operations/ecma-container-object.c
index f975c39a..c9bc10cb 100644
--- a/jerry-core/ecma/operations/ecma-container-object.c
+++ b/jerry-core/ecma/operations/ecma-container-object.c
@@ -383,7 +383,6 @@ ecma_op_container_create (const ecma_value_t *arguments_list_p, /**< arguments l
ecma_value_t set_value = ecma_make_object_value (object_p);
ecma_value_t result = set_value;
-#if JERRY_ESNEXT
if (arguments_list_len == 0)
{
return result;
@@ -525,7 +524,6 @@ cleanup_adder:
ecma_deref_object (adder_func_p);
cleanup_object:
ecma_deref_object (object_p);
-#endif /* JERRY_ESNEXT */
return result;
} /* ecma_op_container_create */
@@ -875,8 +873,6 @@ ecma_op_container_remove_weak_entry (ecma_object_t *object_p, /**< internal cont
ecma_op_internal_buffer_delete (container_p, (ecma_container_pair_t *) entry_p, map_object_p->u.cls.u2.container_id);
} /* ecma_op_container_remove_weak_entry */
-#if JERRY_ESNEXT
-
/**
* The Create{Set, Map}Iterator Abstract operation
*
@@ -1137,8 +1133,6 @@ ecma_builtin_container_dispatch_routine (uint16_t builtin_routine_id, /**< built
}
} /* ecma_builtin_container_dispatch_routine */
-#endif /* JERRY_ESNEXT */
-
/**
* @}
* @}
diff --git a/jerry-core/ecma/operations/ecma-conversion.c b/jerry-core/ecma/operations/ecma-conversion.c
index 9a71b2ff..cf0c9fde 100644
--- a/jerry-core/ecma/operations/ecma-conversion.c
+++ b/jerry-core/ecma/operations/ecma-conversion.c
@@ -337,12 +337,10 @@ ecma_op_to_numeric (ecma_value_t value, /**< ecma value */
return ECMA_VALUE_EMPTY;
}
-#if JERRY_ESNEXT
if (ecma_is_value_symbol (value))
{
return ecma_raise_type_error (ECMA_ERR_CONVERT_SYMBOL_TO_NUMBER);
}
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT
if (ecma_is_value_bigint (value))
@@ -434,13 +432,11 @@ ecma_op_to_string (ecma_value_t value) /**< ecma value */
return ecma_get_magic_string (LIT_MAGIC_STRING_FALSE);
}
-#if JERRY_ESNEXT
if (ecma_is_value_symbol (value))
{
ecma_raise_type_error (ECMA_ERR_CONVERT_SYMBOL_TO_STRING);
return NULL;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT
if (ecma_is_value_bigint (value))
@@ -489,7 +485,6 @@ ecma_op_to_property_key (ecma_value_t value) /**< ecma value */
return key_p;
}
-#if JERRY_ESNEXT
ecma_value_t key = ecma_op_to_primitive (value, ECMA_PREFERRED_TYPE_STRING);
if (ECMA_IS_VALUE_ERROR (key))
@@ -507,11 +502,6 @@ ecma_op_to_property_key (ecma_value_t value) /**< ecma value */
ecma_free_value (key);
return result;
-#else /* !JERRY_ESNEXT */
- ecma_check_value_type_is_spec_defined (value);
-
- return ecma_op_to_string (value);
-#endif /* JERRY_ESNEXT */
} /* ecma_op_to_property_key */
/**
@@ -548,13 +538,11 @@ ecma_op_to_object (ecma_value_t value) /**< ecma value */
{
return ecma_copy_value (value);
}
-#if JERRY_ESNEXT
else if (ecma_is_value_symbol (value))
{
proto_id = ECMA_BUILTIN_ID_SYMBOL_PROTOTYPE;
class_type = ECMA_OBJECT_CLASS_SYMBOL;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT
else if (ecma_is_value_bigint (value))
{
@@ -628,40 +616,33 @@ ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_des
ecma_op_object_define_own_property (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_WRITABLE), &prop_desc);
JERRY_ASSERT (ecma_is_value_true (completion));
}
- else
+ else if (src_prop_desc_p->flags & (JERRY_PROP_IS_GET_DEFINED | JERRY_PROP_IS_SET_DEFINED))
{
-#if !JERRY_ESNEXT
- JERRY_ASSERT (src_prop_desc_p->flags & (JERRY_PROP_IS_GET_DEFINED | JERRY_PROP_IS_SET_DEFINED));
-#else /* JERRY_ESNEXT */
- if (src_prop_desc_p->flags & (JERRY_PROP_IS_GET_DEFINED | JERRY_PROP_IS_SET_DEFINED))
-#endif /* JERRY_ESNEXT */
+ /* a. */
+ if (src_prop_desc_p->get_p == NULL)
+ {
+ prop_desc.value = ECMA_VALUE_UNDEFINED;
+ }
+ else
{
- /* a. */
- if (src_prop_desc_p->get_p == NULL)
- {
- prop_desc.value = ECMA_VALUE_UNDEFINED;
- }
- else
- {
- prop_desc.value = ecma_make_object_value (src_prop_desc_p->get_p);
- }
-
- completion = ecma_op_object_define_own_property (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_GET), &prop_desc);
- JERRY_ASSERT (ecma_is_value_true (completion));
-
- /* b. */
- if (src_prop_desc_p->set_p == NULL)
- {
- prop_desc.value = ECMA_VALUE_UNDEFINED;
- }
- else
- {
- prop_desc.value = ecma_make_object_value (src_prop_desc_p->set_p);
- }
-
- completion = ecma_op_object_define_own_property (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_SET), &prop_desc);
- JERRY_ASSERT (ecma_is_value_true (completion));
+ prop_desc.value = ecma_make_object_value (src_prop_desc_p->get_p);
}
+
+ completion = ecma_op_object_define_own_property (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_GET), &prop_desc);
+ JERRY_ASSERT (ecma_is_value_true (completion));
+
+ /* b. */
+ if (src_prop_desc_p->set_p == NULL)
+ {
+ prop_desc.value = ECMA_VALUE_UNDEFINED;
+ }
+ else
+ {
+ prop_desc.value = ecma_make_object_value (src_prop_desc_p->set_p);
+ }
+
+ completion = ecma_op_object_define_own_property (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_SET), &prop_desc);
+ JERRY_ASSERT (ecma_is_value_true (completion));
}
prop_desc.value = ecma_make_boolean_value (src_prop_desc_p->flags & JERRY_PROP_IS_ENUMERABLE);
@@ -959,7 +940,6 @@ ecma_op_to_length (ecma_value_t value, /**< ecma value */
return value;
}
-#if JERRY_ESNEXT
/* 2 */
ecma_number_t num;
ecma_value_t length_num = ecma_op_to_integer (value, &num);
@@ -987,23 +967,8 @@ ecma_op_to_length (ecma_value_t value, /**< ecma value */
/* 6 */
*length = (ecma_length_t) num;
return ECMA_VALUE_EMPTY;
-#else /* !JERRY_ESNEXT */
- /* In the case of ES5, ToLength(ES6) operation is the same as ToUint32(ES5) */
- ecma_number_t num;
- ecma_value_t to_number = ecma_op_to_number (value, &num);
-
- /* 2 */
- if (ECMA_IS_VALUE_ERROR (to_number))
- {
- return to_number;
- }
-
- *length = ecma_number_to_uint32 (num);
- return ECMA_VALUE_EMPTY;
-#endif /* JERRY_ESNEXT */
} /* ecma_op_to_length */
-#if JERRY_ESNEXT
/**
* ToIndex operation.
*
@@ -1104,7 +1069,6 @@ ecma_op_create_list_from_array_like (ecma_value_t arr, /**< array value */
/* 9. */
return list_ptr;
} /* ecma_op_create_list_from_array_like */
-#endif /* JERRY_ESNEXT */
/**
* @}
diff --git a/jerry-core/ecma/operations/ecma-conversion.h b/jerry-core/ecma/operations/ecma-conversion.h
index 559b8552..a19ade54 100644
--- a/jerry-core/ecma/operations/ecma-conversion.h
+++ b/jerry-core/ecma/operations/ecma-conversion.h
@@ -62,10 +62,8 @@ ecma_value_t ecma_op_to_object (ecma_value_t value);
bool ecma_op_is_integer (ecma_number_t value);
ecma_value_t ecma_op_to_integer (ecma_value_t value, ecma_number_t *number_p);
ecma_value_t ecma_op_to_length (ecma_value_t value, ecma_length_t *length);
-#if JERRY_ESNEXT
ecma_value_t ecma_op_to_index (ecma_value_t value, ecma_number_t *index);
ecma_collection_t *ecma_op_create_list_from_array_like (ecma_value_t arr, bool prop_names_only);
-#endif /* JERRY_ESNEXT */
ecma_object_t *ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_desc_p);
ecma_value_t ecma_op_to_property_descriptor (ecma_value_t obj_value, ecma_property_descriptor_t *out_prop_desc_p);
diff --git a/jerry-core/ecma/operations/ecma-eval.c b/jerry-core/ecma/operations/ecma-eval.c
index e4a2d734..ac8e2c40 100644
--- a/jerry-core/ecma/operations/ecma-eval.c
+++ b/jerry-core/ecma/operations/ecma-eval.c
@@ -81,9 +81,7 @@ ecma_op_eval_chars_buffer (void *source_p, /**< source code */
parse_opts |= ECMA_PARSE_EVAL;
-#if JERRY_ESNEXT
ECMA_CLEAR_LOCAL_PARSE_OPTS ();
-#endif /* JERRY_ESNEXT */
ecma_compiled_code_t *bytecode_p = parser_parse_script (source_p, parse_opts, NULL);
@@ -93,12 +91,6 @@ ecma_op_eval_chars_buffer (void *source_p, /**< source code */
}
return vm_run_eval (bytecode_p, parse_opts);
-#else /* !JERRY_PARSER */
- JERRY_UNUSED (code_p);
- JERRY_UNUSED (code_buffer_size);
- JERRY_UNUSED (parse_opts);
-
- return ecma_raise_syntax_error (ECMA_ERR_PARSER_NOT_SUPPORTED);
#endif /* JERRY_PARSER */
} /* ecma_op_eval_chars_buffer */
diff --git a/jerry-core/ecma/operations/ecma-exceptions.c b/jerry-core/ecma/operations/ecma-exceptions.c
index 9232a680..675aaf92 100644
--- a/jerry-core/ecma/operations/ecma-exceptions.c
+++ b/jerry-core/ecma/operations/ecma-exceptions.c
@@ -87,13 +87,12 @@ ecma_new_standard_error (jerry_error_t error_type, /**< native error type */
break;
}
-#if JERRY_ESNEXT
case JERRY_ERROR_AGGREGATE:
{
prototype_id = ECMA_BUILTIN_ID_AGGREGATE_ERROR_PROTOTYPE;
break;
}
-#endif /* JERRY_ESNEXT */
+
case JERRY_ERROR_URI:
{
prototype_id = ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE;
@@ -169,7 +168,6 @@ ecma_new_standard_error (jerry_error_t error_type, /**< native error type */
return error_object_p;
} /* ecma_new_standard_error */
-#if JERRY_ESNEXT
/**
* aggregate-error object constructor.
*
@@ -273,8 +271,6 @@ ecma_new_aggregate_error (ecma_value_t error_list_val, /**< errors list */
return ecma_make_object_value (new_error_object_p);
} /* ecma_new_aggregate_error */
-#endif /* JERRY_ESNEXT */
-
/**
* Return the error type for an Error object.
*
@@ -364,13 +360,11 @@ ecma_raise_standard_error_with_format (jerry_error_t error_type, /**< error type
lit_magic_string_id_t class_name = ecma_object_get_class_name (arg_object_p);
arg_string_p = ecma_get_magic_string (class_name);
}
-#if JERRY_ESNEXT
else if (ecma_is_value_symbol (arg_val))
{
ecma_value_t symbol_desc_value = ecma_get_symbol_descriptive_string (arg_val);
arg_string_p = ecma_get_string_from_value (symbol_desc_value);
}
-#endif /* JERRY_ESNEXT */
else
{
arg_string_p = ecma_op_to_string (arg_val);
@@ -504,8 +498,6 @@ ecma_raise_maximum_callstack_error (void)
} /* ecma_raise_maximum_callstack_error */
#endif /* (JERRY_STACK_LIMIT != 0) */
-#if JERRY_ESNEXT
-
/**
* Raise a AggregateError with the given errors and message.
*
@@ -522,8 +514,6 @@ ecma_raise_aggregate_error (ecma_value_t error_list_val, /**< errors list */
return ECMA_VALUE_ERROR;
} /* ecma_raise_aggregate_error */
-#endif /* JERRY_ESNEXT */
-
/**
* @}
* @}
diff --git a/jerry-core/ecma/operations/ecma-exceptions.h b/jerry-core/ecma/operations/ecma-exceptions.h
index d4e6477d..c367a6bf 100644
--- a/jerry-core/ecma/operations/ecma-exceptions.h
+++ b/jerry-core/ecma/operations/ecma-exceptions.h
@@ -42,10 +42,8 @@ ecma_value_t ecma_raise_uri_error (ecma_error_msg_t msg);
#if (JERRY_STACK_LIMIT != 0)
ecma_value_t ecma_raise_maximum_callstack_error (void);
#endif /* (JERRY_STACK_LIMIT != 0) */
-#if JERRY_ESNEXT
ecma_value_t ecma_new_aggregate_error (ecma_value_t error_list_val, ecma_value_t message_val);
ecma_value_t ecma_raise_aggregate_error (ecma_value_t error_list_val, ecma_value_t message_val);
-#endif /* JERRY_ESNEXT */
/**
* @}
diff --git a/jerry-core/ecma/operations/ecma-function-object.c b/jerry-core/ecma/operations/ecma-function-object.c
index 243e31ad..1e24384c 100644
--- a/jerry-core/ecma/operations/ecma-function-object.c
+++ b/jerry-core/ecma/operations/ecma-function-object.c
@@ -41,7 +41,6 @@
* @{
*/
-#if JERRY_ESNEXT
/**
* SetFunctionName operation
*
@@ -91,7 +90,6 @@ ecma_op_function_form_name (ecma_string_t *prop_name_p, /**< property name */
return ecma_make_string_value (prop_name_p);
} /* ecma_op_function_form_name */
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
/**
@@ -180,7 +178,6 @@ ecma_object_check_constructor (ecma_object_t *obj_p) /**< ecma object */
if (JERRY_LIKELY (type == ECMA_OBJECT_TYPE_FUNCTION))
{
-#if JERRY_ESNEXT
const ecma_compiled_code_t *byte_code_p = ecma_op_function_get_compiled_code ((ecma_extended_object_t *) obj_p);
if (!CBC_FUNCTION_IS_CONSTRUCTABLE (byte_code_p->status_flags))
@@ -226,7 +223,6 @@ ecma_object_check_constructor (ecma_object_t *obj_p) /**< ecma object */
return ECMA_ERR_EMPTY;
#endif /* JERRY_ERROR_MESSAGES */
}
-#endif /* JERRY_NEXT */
return ECMA_IS_VALID_CONSTRUCTOR;
}
@@ -253,9 +249,7 @@ ecma_object_check_constructor (ecma_object_t *obj_p) /**< ecma object */
return ECMA_ERR_BULTIN_ROUTINES_HAVE_NO_CONSTRUCTOR;
}
-#if JERRY_ESNEXT
JERRY_ASSERT (((ecma_extended_object_t *) obj_p)->u.built_in.id != ECMA_BUILTIN_ID_HANDLER);
-#endif /* !JERRY_ESNEXT */
}
return ECMA_IS_VALID_CONSTRUCTOR;
@@ -487,11 +481,9 @@ ecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p, /**< argu
return ECMA_VALUE_ERROR;
}
-#if JERRY_ESNEXT
ecma_value_t *func_name_p;
func_name_p = ecma_compiled_code_resolve_function_name ((const ecma_compiled_code_t *) bytecode_p);
*func_name_p = ecma_make_magic_string_value (LIT_MAGIC_STRING_ANONYMOUS);
-#endif /* JERRY_ESNEXT */
ecma_object_t *global_object_p = ecma_builtin_get_global ();
@@ -501,8 +493,6 @@ ecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p, /**< argu
ecma_object_t *global_env_p = ecma_get_global_environment (global_object_p);
ecma_builtin_id_t fallback_proto = ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE;
-
-#if JERRY_ESNEXT
ecma_object_t *new_target_p = JERRY_CONTEXT (current_new_target_p);
ecma_builtin_id_t fallback_ctor = ECMA_BUILTIN_ID_FUNCTION;
@@ -535,14 +525,11 @@ ecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p, /**< argu
ecma_bytecode_deref (bytecode_p);
return ECMA_VALUE_ERROR;
}
-#endif /* JERRY_ESNEXT */
ecma_object_t *func_obj_p = ecma_op_create_function_object (global_env_p, bytecode_p, fallback_proto);
-#if JERRY_ESNEXT
ECMA_SET_NON_NULL_POINTER (func_obj_p->u2.prototype_cp, proto);
ecma_deref_object (proto);
-#endif /* JERRY_ESNEXT */
ecma_bytecode_deref (bytecode_p);
return ecma_make_object_value (func_obj_p);
@@ -562,8 +549,6 @@ ecma_op_create_simple_function_object (ecma_object_t *scope_p, /**< function's s
return ecma_op_create_function_object (scope_p, bytecode_data_p, ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE);
} /* ecma_op_create_simple_function_object */
-#if JERRY_ESNEXT
-
/**
* Create a function object with the appropriate prototype.
*
@@ -666,8 +651,6 @@ ecma_op_create_arrow_function_object (ecma_object_t *scope_p, /**< function's sc
return func_p;
} /* ecma_op_create_arrow_function_object */
-#endif /* JERRY_ESNEXT */
-
/**
* External function object creation operation.
*
@@ -700,8 +683,6 @@ ecma_op_create_external_function_object (ecma_native_handler_t handler_cb) /**<
return function_obj_p;
} /* ecma_op_create_external_function_object */
-#if JERRY_ESNEXT
-
/**
* Create built-in native handler object.
*
@@ -727,8 +708,6 @@ ecma_op_create_native_handler (ecma_native_handler_id_t id, /**< handler id */
return function_obj_p;
} /* ecma_op_create_native_handler */
-#endif /* JERRY_ESNEXT */
-
/**
* Get compiled code of a function object.
*
@@ -809,7 +788,6 @@ ecma_op_function_get_function_realm (ecma_object_t *func_obj_p) /**< function ob
return ECMA_GET_INTERNAL_VALUE_POINTER (ecma_global_object_t, native_function_p->realm_value);
}
-#if JERRY_ESNEXT
if (type == ECMA_OBJECT_TYPE_CONSTRUCTOR_FUNCTION)
{
ecma_value_t script_value = ((ecma_extended_object_t *) func_obj_p)->u.constructor_function.script_value;
@@ -817,7 +795,6 @@ ecma_op_function_get_function_realm (ecma_object_t *func_obj_p) /**< function ob
return (ecma_global_object_t *) script_p->realm_p;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
if (ECMA_OBJECT_IS_PROXY (func_obj_p))
@@ -935,8 +912,6 @@ ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object *
return result;
} /* ecma_op_function_has_instance */
-#if JERRY_ESNEXT
-
/**
* GetSuperConstructor operation for class methods
*
@@ -965,7 +940,6 @@ ecma_op_function_get_super_constructor (ecma_object_t *func_obj_p) /**< function
return ecma_make_object_value (super_ctor_p);
} /* ecma_op_function_get_super_constructor */
-#endif /* JERRY_ESNEXT */
/**
* Ordinary internal method: GetPrototypeFromConstructor (constructor, intrinsicDefaultProto)
@@ -1024,7 +998,6 @@ ecma_op_get_prototype_from_constructor (ecma_object_t *ctor_obj_p, /**< construc
return proto_obj_p;
} /* ecma_op_get_prototype_from_constructor */
-#if JERRY_ESNEXT
/**
* Perform a JavaScript class function object method call.
*
@@ -1092,8 +1065,6 @@ exit:
return ret_value;
} /* ecma_op_function_call_constructor */
-#endif /* JERRY_ESNEXT */
-
/**
* Perform a JavaScript function object method call.
*
@@ -1140,7 +1111,6 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
/* 1. */
switch (CBC_FUNCTION_GET_TYPE (status_flags))
{
-#if JERRY_ESNEXT
case CBC_FUNCTION_CONSTRUCTOR:
{
return ecma_op_function_call_constructor (&shared_args, scope_p, this_binding);
@@ -1168,13 +1138,9 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
}
break;
}
-
-#endif /* JERRY_ESNEXT */
default:
{
-#if JERRY_ESNEXT
shared_args.header.status_flags |= VM_FRAME_CTX_SHARED_NON_ARROW_FUNC;
-#endif /* JERRY_ESNEXT */
if (status_flags & CBC_CODE_FLAGS_STRICT_MODE)
{
@@ -1281,12 +1247,8 @@ ecma_op_function_call_native (ecma_object_t *func_obj_p, /**< Function object */
call_info.function = ecma_make_object_value (func_obj_p);
call_info.this_value = this_arg_value;
-#if JERRY_ESNEXT
ecma_object_t *new_target_p = JERRY_CONTEXT (current_new_target_p);
call_info.new_target = (new_target_p == NULL) ? ECMA_VALUE_UNDEFINED : ecma_make_object_value (new_target_p);
-#else /* JERRY_ESNEXT */
- call_info.new_target = ECMA_VALUE_UNDEFINED;
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (native_function_p->native_handler_cb != NULL);
ecma_value_t ret_value = native_function_p->native_handler_cb (&call_info, arguments_list_p, arguments_list_len);
@@ -1428,14 +1390,12 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
ECMA_CHECK_STACK_USAGE ();
-#if JERRY_ESNEXT
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target_p);
if (JERRY_UNLIKELY (!(JERRY_CONTEXT (status_flags) & ECMA_STATUS_DIRECT_EVAL)))
{
JERRY_CONTEXT (current_new_target_p) = NULL;
}
-#endif /* JERRY_ESNEXT */
ecma_value_t result;
@@ -1458,13 +1418,11 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
break;
}
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_ESNEXT
case ECMA_OBJECT_TYPE_CONSTRUCTOR_FUNCTION:
{
result = ecma_raise_type_error (ECMA_ERR_CLASS_CONSTRUCTOR_NEW);
break;
}
-#endif /* JERRY_ESNEXT */
case ECMA_OBJECT_TYPE_NATIVE_FUNCTION:
{
result = ecma_op_function_call_native (func_obj_p, this_arg_value, arguments_list_p, arguments_list_len);
@@ -1482,9 +1440,7 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
}
}
-#if JERRY_ESNEXT
JERRY_CONTEXT (current_new_target_p) = old_new_target_p;
-#endif /* JERRY_ESNEXT */
return result;
} /* ecma_op_function_call */
@@ -1506,13 +1462,11 @@ ecma_op_function_construct_simple (ecma_object_t *func_obj_p, /**< Function obje
ecma_object_t *new_this_obj_p = NULL;
ecma_value_t this_arg;
-#if JERRY_ESNEXT
ecma_extended_object_t *ext_func_obj_p = (ecma_extended_object_t *) func_obj_p;
/* 5. */
if (!ECMA_GET_THIRD_BIT_FROM_POINTER_TAG (ext_func_obj_p->u.function.scope_cp))
{
-#endif /* JERRY_ESNEXT */
/* 5.a */
ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (new_target_p, ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
@@ -1525,7 +1479,6 @@ ecma_op_function_construct_simple (ecma_object_t *func_obj_p, /**< Function obje
new_this_obj_p = ecma_create_object (proto_p, 0, ECMA_OBJECT_TYPE_GENERAL);
ecma_deref_object (proto_p);
this_arg = ecma_make_object_value (new_this_obj_p);
-#if JERRY_ESNEXT
}
else
{
@@ -1535,25 +1488,19 @@ ecma_op_function_construct_simple (ecma_object_t *func_obj_p, /**< Function obje
/* 6. */
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target_p);
JERRY_CONTEXT (current_new_target_p) = new_target_p;
-#endif /* JERRY_ESNEXT */
ecma_value_t ret_value = ecma_op_function_call_simple (func_obj_p, this_arg, arguments_list_p, arguments_list_len);
-#if JERRY_ESNEXT
JERRY_CONTEXT (current_new_target_p) = old_new_target_p;
-#endif /* JERRY_ESNEXT */
/* 13.a */
if (ECMA_IS_VALUE_ERROR (ret_value) || ecma_is_value_object (ret_value))
{
-#if JERRY_ESNEXT
if (new_this_obj_p != NULL)
{
ecma_deref_object (new_this_obj_p);
}
-#else /* !JERRY_ESNEXT */
- ecma_deref_object (new_this_obj_p);
-#endif /* JERRY_ESNEXT */
+
return ret_value;
}
@@ -1584,16 +1531,12 @@ ecma_op_function_construct_built_in (ecma_object_t *func_obj_p, /**< Function ob
JERRY_CONTEXT (global_object_p) = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_global_object_t, realm_value);
#endif /* JERRY_BUILTIN_REALMS */
-#if JERRY_ESNEXT
ecma_object_t *old_new_target = JERRY_CONTEXT (current_new_target_p);
JERRY_CONTEXT (current_new_target_p) = new_target_p;
-#endif /* JERRY_ESNEXT */
ecma_value_t ret_value = ecma_builtin_dispatch_construct (func_obj_p, arguments_list_p, arguments_list_len);
-#if JERRY_ESNEXT
JERRY_CONTEXT (current_new_target_p) = old_new_target;
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_REALMS
JERRY_CONTEXT (global_object_p) = saved_global_object_p;
@@ -1637,8 +1580,6 @@ ecma_op_function_construct_bound (ecma_object_t *func_obj_p, /**< Function objec
return ret_value;
} /* ecma_op_function_construct_bound */
-#if JERRY_ESNEXT
-
/**
* [[Construct]] internal method for class implicit constructor objects
*
@@ -1704,8 +1645,6 @@ ecma_op_function_construct_constructor (ecma_object_t *func_obj_p, /**< Function
return result;
} /* ecma_op_function_construct_constructor */
-#endif /* JERRY_ESNEXT */
-
/**
* [[Construct]] internal method for external function objects
*
@@ -1731,16 +1670,12 @@ ecma_op_function_construct_native (ecma_object_t *func_obj_p, /**< Function obje
ecma_value_t this_arg = ecma_make_object_value (new_this_obj_p);
ecma_deref_object (proto_p);
-#if JERRY_ESNEXT
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target_p);
JERRY_CONTEXT (current_new_target_p) = new_target_p;
-#endif /* JERRY_ESNEXT */
ecma_value_t ret_value = ecma_op_function_call_native (func_obj_p, this_arg, arguments_list_p, arguments_list_len);
-#if JERRY_ESNEXT
JERRY_CONTEXT (current_new_target_p) = old_new_target_p;
-#endif /* JERRY_ESNEXT */
if (ECMA_IS_VALUE_ERROR (ret_value) || ecma_is_value_object (ret_value))
{
@@ -1787,12 +1722,10 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
return ecma_proxy_object_construct (func_obj_p, new_target_p, arguments_list_p, arguments_list_len);
}
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_ESNEXT
case ECMA_OBJECT_TYPE_CONSTRUCTOR_FUNCTION:
{
return ecma_op_function_construct_constructor (func_obj_p, new_target_p, arguments_list_p, arguments_list_len);
}
-#endif /* JERRY_ESNEXT */
case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
{
return ecma_op_function_construct_bound (func_obj_p, new_target_p, arguments_list_p, arguments_list_len);
@@ -1844,7 +1777,6 @@ ecma_op_lazy_instantiate_prototype_object (ecma_object_t *object_p) /**< the fun
ecma_object_t *proto_object_p = NULL;
bool init_constructor = true;
-#if JERRY_ESNEXT
if (ecma_get_object_type (object_p) == ECMA_OBJECT_TYPE_FUNCTION)
{
const ecma_compiled_code_t *byte_code_p = ecma_op_function_get_compiled_code ((ecma_extended_object_t *) object_p);
@@ -1882,11 +1814,8 @@ ecma_op_lazy_instantiate_prototype_object (ecma_object_t *object_p) /**< the fun
init_constructor = false;
}
}
-#endif /* JERRY_ESNEXT */
-#if JERRY_ESNEXT
if (proto_object_p == NULL)
-#endif /* JERRY_ESNEXT */
{
ecma_object_t *prototype_p;
@@ -1943,7 +1872,6 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**<
{
JERRY_ASSERT (ecma_get_object_type (object_p) == ECMA_OBJECT_TYPE_FUNCTION);
-#if JERRY_ESNEXT
if (ecma_compare_ecma_string_to_magic_id (property_name_p, LIT_MAGIC_STRING_LENGTH))
{
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
@@ -2011,7 +1939,6 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**<
value_p->value = ecma_copy_value (value);
return value_prop_p;
}
-#endif /* JERRY_ESNEXT */
if (ecma_compare_ecma_string_to_magic_id (property_name_p, LIT_MAGIC_STRING_PROTOTYPE)
&& ecma_get_object_type (object_p) == ECMA_OBJECT_TYPE_FUNCTION)
@@ -2026,7 +1953,6 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**<
const ecma_compiled_code_t *bytecode_data_p;
bytecode_data_p = ecma_op_function_get_compiled_code ((ecma_extended_object_t *) object_p);
-#if JERRY_ESNEXT
if (!(bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE)
&& CBC_FUNCTION_GET_TYPE (bytecode_data_p->status_flags) == CBC_FUNCTION_NORMAL)
{
@@ -2037,22 +1963,6 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**<
value_p->value = is_arguments ? ECMA_VALUE_NULL : ECMA_VALUE_UNDEFINED;
return value_prop_p;
}
-#else /* !JERRY_ESNEXT */
- if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE)
- {
- ecma_object_t *thrower_p = ecma_builtin_get (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER);
-
- ecma_property_t *caller_prop_p;
- /* The property_name_p argument contains the name. */
- ecma_create_named_accessor_property (object_p,
- property_name_p,
- thrower_p,
- thrower_p,
- ECMA_PROPERTY_BUILT_IN_FIXED,
- &caller_prop_p);
- return caller_prop_p;
- }
-#endif /* JERRY_ESNEXT */
}
return NULL;
@@ -2109,7 +2019,6 @@ ecma_op_bound_function_try_to_lazy_instantiate_property (ecma_object_t *object_p
args_length = ecma_get_integer_from_value (args_len_or_this);
}
-#if JERRY_ESNEXT
if (ECMA_GET_FIRST_BIT_FROM_POINTER_TAG (bound_func_p->header.u.bound_function.target_function))
{
return NULL;
@@ -2117,24 +2026,6 @@ ecma_op_bound_function_try_to_lazy_instantiate_property (ecma_object_t *object_p
length_attributes = ECMA_PROPERTY_BUILT_IN_CONFIGURABLE;
length = ecma_get_number_from_value (bound_func_p->target_length) - (args_length - 1);
-#else /* !JERRY_ESNEXT */
- length_attributes = ECMA_PROPERTY_BUILT_IN_FIXED;
-
- ecma_object_t *target_func_p;
- target_func_p =
- ECMA_GET_NON_NULL_POINTER_FROM_POINTER_TAG (ecma_object_t, bound_func_p->header.u.bound_function.target_function);
-
- if (ecma_object_get_class_name (target_func_p) == LIT_MAGIC_STRING_FUNCTION_UL)
- {
- /* The property_name_p argument contains the 'length' string. */
- ecma_value_t get_len_value = ecma_op_object_get (target_func_p, property_name_p);
-
- JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (get_len_value));
- JERRY_ASSERT (ecma_is_value_integer_number (get_len_value));
-
- length = (ecma_number_t) (ecma_get_integer_from_value (get_len_value) - (args_length - 1));
- }
-#endif /* JERRY_ESNEXT */
if (length < 0)
{
@@ -2149,29 +2040,9 @@ ecma_op_bound_function_try_to_lazy_instantiate_property (ecma_object_t *object_p
return len_prop_p;
}
-#if !JERRY_ESNEXT
- if (ecma_compare_ecma_string_to_magic_id (property_name_p, LIT_MAGIC_STRING_CALLER)
- || ecma_compare_ecma_string_to_magic_id (property_name_p, LIT_MAGIC_STRING_ARGUMENTS))
- {
- ecma_object_t *thrower_p = ecma_builtin_get (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER);
-
- ecma_property_t *caller_prop_p;
- /* The string_p argument contans the name. */
- ecma_create_named_accessor_property (object_p,
- property_name_p,
- thrower_p,
- thrower_p,
- ECMA_PROPERTY_BUILT_IN_FIXED,
- &caller_prop_p);
- return caller_prop_p;
- }
-#endif /* !JERRY_ESNEXT */
-
return NULL;
} /* ecma_op_bound_function_try_to_lazy_instantiate_property */
-#if JERRY_ESNEXT
-
/**
* Delete configurable properties of functions.
*/
@@ -2211,8 +2082,6 @@ ecma_op_bound_function_delete_built_in_property (ecma_object_t *object_p, /**< o
ECMA_SET_FIRST_BIT_TO_POINTER_TAG (bound_func_p->header.u.bound_function.target_function);
} /* ecma_op_bound_function_delete_built_in_property */
-#endif /* JERRY_ESNEXT */
-
/**
* List names of a Function object's lazy instantiated properties,
* adding them to corresponding string collections
@@ -2234,7 +2103,6 @@ ecma_op_function_list_lazy_property_names (ecma_object_t *object_p, /**< functio
const ecma_compiled_code_t *bytecode_data_p;
bytecode_data_p = ecma_op_function_get_compiled_code ((ecma_extended_object_t *) object_p);
-#if JERRY_ESNEXT
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
if (!ECMA_GET_FIRST_BIT_FROM_POINTER_TAG (ext_func_p->u.function.scope_cp))
@@ -2251,25 +2119,14 @@ ecma_op_function_list_lazy_property_names (ecma_object_t *object_p, /**< functio
ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_NAME));
prop_counter_p->string_named_props++;
}
-#else /* !JERRY_ESNEXT */
- /* 'length' property is non-enumerable (ECMA-262 v5, 13.2.5) */
- ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH));
- prop_counter_p->string_named_props++;
-#endif /* JERRY_ESNEXT */
-#if JERRY_ESNEXT
if (!CBC_FUNCTION_HAS_PROTOTYPE (bytecode_data_p->status_flags)
|| (CBC_FUNCTION_GET_TYPE (bytecode_data_p->status_flags) == CBC_FUNCTION_CONSTRUCTOR))
{
return;
}
- bool append_caller_and_arguments = !(bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE);
-#else /* !JERRY_ESNEXT */
- bool append_caller_and_arguments = (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE);
-#endif /* JERRY_ESNEXT */
-
- if (append_caller_and_arguments)
+ if (!(bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE))
{
/* 'arguments' property is non-enumerable (ECMA-262 v5, 13.2.5) */
ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_ARGUMENTS));
@@ -2329,7 +2186,6 @@ ecma_op_bound_function_list_lazy_property_names (ecma_object_t *object_p, /**< b
return;
}
-#if JERRY_ESNEXT
/* Unintialized 'length' property is non-enumerable (ECMA-262 v6, 19.2.4.1) */
ecma_bound_function_t *bound_func_p = (ecma_bound_function_t *) object_p;
if (!ECMA_GET_FIRST_BIT_FROM_POINTER_TAG (bound_func_p->header.u.bound_function.target_function))
@@ -2337,12 +2193,6 @@ ecma_op_bound_function_list_lazy_property_names (ecma_object_t *object_p, /**< b
ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH));
prop_counter_p->string_named_props++;
}
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (object_p);
- /* 'length' property is non-enumerable (ECMA-262 v5, 13.2.5) */
- ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH));
- prop_counter_p->string_named_props++;
-#endif /* JERRY_ESNEXT */
/* 'caller' property is non-enumerable (ECMA-262 v5, 13.2.5) */
ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_CALLER));
diff --git a/jerry-core/ecma/operations/ecma-function-object.h b/jerry-core/ecma/operations/ecma-function-object.h
index 3f9c602d..08300f57 100644
--- a/jerry-core/ecma/operations/ecma-function-object.h
+++ b/jerry-core/ecma/operations/ecma-function-object.h
@@ -29,9 +29,7 @@
* @{
*/
-#if JERRY_ESNEXT
ecma_value_t ecma_op_function_form_name (ecma_string_t *prop_name_p, char *prefix_p, lit_utf8_size_t prefix_size);
-#endif /* JERRY_ESNEXT */
bool ecma_op_is_callable (ecma_value_t value);
#if JERRY_BUILTIN_PROXY
@@ -67,7 +65,6 @@ ecma_value_t ecma_op_create_dynamic_function (const ecma_value_t *arguments_list
uint32_t arguments_list_len,
ecma_parse_opts_t opts);
-#if JERRY_ESNEXT
ecma_value_t ecma_op_function_get_super_constructor (ecma_object_t *func_obj_p);
ecma_object_t *ecma_op_create_any_function_object (ecma_object_t *scope_p, const ecma_compiled_code_t *bytecode_data_p);
@@ -78,8 +75,6 @@ ecma_object_t *ecma_op_create_arrow_function_object (ecma_object_t *scope_p,
ecma_object_t *ecma_op_create_native_handler (ecma_native_handler_id_t id, size_t object_size);
-#endif /* JERRY_ESNEXT */
-
ecma_object_t *ecma_op_get_prototype_from_constructor (ecma_object_t *ctor_obj_p, ecma_builtin_id_t default_proto_id);
ecma_value_t ecma_op_function_has_instance (ecma_object_t *func_obj_p, ecma_value_t value);
@@ -108,11 +103,9 @@ ecma_property_t *ecma_op_external_function_try_to_lazy_instantiate_property (ecm
ecma_property_t *ecma_op_bound_function_try_to_lazy_instantiate_property (ecma_object_t *object_p,
ecma_string_t *property_name_p);
-#if JERRY_ESNEXT
void ecma_op_function_delete_built_in_property (ecma_object_t *object_p, ecma_string_t *property_name_p);
void ecma_op_bound_function_delete_built_in_property (ecma_object_t *object_p, ecma_string_t *property_name_p);
-#endif /* JERRY_ESNEXT */
void ecma_op_function_list_lazy_property_names (ecma_object_t *object_p,
ecma_collection_t *prop_names_p,
diff --git a/jerry-core/ecma/operations/ecma-get-put-value.c b/jerry-core/ecma/operations/ecma-get-put-value.c
index 41bdf37d..39d4d373 100644
--- a/jerry-core/ecma/operations/ecma-get-put-value.c
+++ b/jerry-core/ecma/operations/ecma-get-put-value.c
@@ -62,18 +62,15 @@ ecma_op_get_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
*ref_base_lex_env_p = lex_env_p;
ecma_property_value_t *property_value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (property_value_p->value == ECMA_VALUE_UNINITIALIZED))
{
return ecma_raise_reference_error (ECMA_ERR_LET_CONST_NOT_INITIALIZED);
}
-#endif /* JERRY_ESNEXT */
return ecma_fast_copy_value (property_value_p->value);
}
break;
}
-#if JERRY_ESNEXT
case ECMA_LEXICAL_ENVIRONMENT_CLASS:
{
#if JERRY_MODULE_SYSTEM
@@ -102,7 +99,6 @@ ecma_op_get_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
#endif /* JERRY_MODULE_SYSTEM */
break;
}
-#endif /* JERRY_ESNEXT */
default:
{
JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
@@ -188,12 +184,10 @@ ecma_op_get_value_object_base (ecma_value_t base_value, /**< base value */
id = ECMA_BUILTIN_ID_NUMBER_PROTOTYPE;
#endif /* JERRY_BUILTIN_NUMBER */
}
-#if JERRY_ESNEXT
else if (ecma_is_value_symbol (base_value))
{
id = ECMA_BUILTIN_ID_SYMBOL_PROTOTYPE;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT
else if (ecma_is_value_bigint (base_value))
{
@@ -234,7 +228,6 @@ ecma_op_put_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
{
switch (ecma_get_lex_env_type (lex_env_p))
{
-#if JERRY_ESNEXT
case ECMA_LEXICAL_ENVIRONMENT_CLASS:
{
if (!ECMA_LEX_ENV_CLASS_IS_MODULE (lex_env_p))
@@ -243,14 +236,12 @@ ecma_op_put_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
}
/* FALLTHRU */
}
-#endif /* JERRY_ESNEXT */
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
ecma_property_t *property_p = ecma_find_named_property (lex_env_p, name_p);
if (property_p != NULL)
{
-#if JERRY_ESNEXT
ecma_property_value_t *property_value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
JERRY_ASSERT (!(*property_p & ECMA_PROPERTY_FLAG_WRITABLE) || (*property_p & ECMA_PROPERTY_FLAG_DATA));
@@ -260,14 +251,6 @@ ecma_op_put_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
ecma_named_data_property_assign_value (lex_env_p, property_value_p, value);
return ECMA_VALUE_EMPTY;
}
-#else /* JERRY_ESNEXT */
- if (ecma_is_property_writable (*property_p))
- {
- ecma_property_value_t *property_value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
- ecma_named_data_property_assign_value (lex_env_p, property_value_p, value);
- return ECMA_VALUE_EMPTY;
- }
-#endif /* JERRY_ESNEXT */
return ecma_op_raise_set_binding_error (property_p, is_strict);
}
diff --git a/jerry-core/ecma/operations/ecma-iterator-object.c b/jerry-core/ecma/operations/ecma-iterator-object.c
index 21d88724..3e8ef7ea 100644
--- a/jerry-core/ecma/operations/ecma-iterator-object.c
+++ b/jerry-core/ecma/operations/ecma-iterator-object.c
@@ -36,8 +36,6 @@
* @{
*/
-#if JERRY_ESNEXT
-
/**
* Implementation of 'CreateArrayFromList' specialized for iterators
*
@@ -715,8 +713,6 @@ ecma_async_from_sync_iterator_unwrap_cb (ecma_object_t *function_obj_p, /**< fun
return ecma_create_iter_result_object (arg, done);
} /* ecma_async_from_sync_iterator_unwrap_cb */
-#endif /* JERRY_ESNEXT */
-
/**
* @}
* @}
diff --git a/jerry-core/ecma/operations/ecma-iterator-object.h b/jerry-core/ecma/operations/ecma-iterator-object.h
index f0903508..0963b03f 100644
--- a/jerry-core/ecma/operations/ecma-iterator-object.h
+++ b/jerry-core/ecma/operations/ecma-iterator-object.h
@@ -18,8 +18,6 @@
#include "ecma-globals.h"
-#if JERRY_ESNEXT
-
/** \addtogroup ecma ECMA
* @{
*
@@ -78,8 +76,6 @@ ecma_value_t ecma_async_from_sync_iterator_unwrap_cb (ecma_object_t *function_ob
const ecma_value_t args_p[],
const uint32_t args_count);
-#endif /* JERRY_ESNEXT */
-
/**
* @}
* @}
diff --git a/jerry-core/ecma/operations/ecma-jobqueue.c b/jerry-core/ecma/operations/ecma-jobqueue.c
index 990e3b7a..3cccfa9b 100644
--- a/jerry-core/ecma/operations/ecma-jobqueue.c
+++ b/jerry-core/ecma/operations/ecma-jobqueue.c
@@ -26,8 +26,6 @@
#include "opcodes.h"
#include "vm-stack.h"
-#if JERRY_ESNEXT
-
/**
* Mask for job queue type.
*/
@@ -637,4 +635,3 @@ ecma_free_all_enqueued_jobs (void)
* @}
* @}
*/
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/operations/ecma-jobqueue.h b/jerry-core/ecma/operations/ecma-jobqueue.h
index 72128c2e..b56027ca 100644
--- a/jerry-core/ecma/operations/ecma-jobqueue.h
+++ b/jerry-core/ecma/operations/ecma-jobqueue.h
@@ -18,8 +18,6 @@
#include "ecma-globals.h"
-#if JERRY_ESNEXT
-
/** \addtogroup ecma ECMA
* @{
*
@@ -61,5 +59,5 @@ ecma_value_t ecma_process_all_enqueued_jobs (void);
* @}
* @}
*/
-#endif /* JERRY_ESNEXT */
+
#endif /* !ECMA_JOB_QUEUE_H */
diff --git a/jerry-core/ecma/operations/ecma-lex-env.c b/jerry-core/ecma/operations/ecma-lex-env.c
index ea1e8e29..0b04a38f 100644
--- a/jerry-core/ecma/operations/ecma-lex-env.c
+++ b/jerry-core/ecma/operations/ecma-lex-env.c
@@ -69,7 +69,6 @@ ecma_get_global_environment (ecma_object_t *global_object_p) /**< global object
return ECMA_GET_NON_NULL_POINTER (ecma_object_t, ((ecma_global_object_t *) global_object_p)->global_env_cp);
} /* ecma_get_global_environment */
-#if JERRY_ESNEXT
/**
* Create the global lexical block on top of the global environment.
*/
@@ -88,7 +87,6 @@ ecma_create_global_lexical_block (ecma_object_t *global_object_p) /**< global ob
ecma_deref_object (global_scope_p);
}
} /* ecma_create_global_lexical_block */
-#endif /* JERRY_ESNEXT */
/**
* Raise the appropriate error when setting a binding is failed
@@ -101,7 +99,6 @@ ecma_op_raise_set_binding_error (ecma_property_t *property_p, /**< property */
{
JERRY_UNUSED (property_p);
-#if JERRY_ESNEXT
const ecma_property_t expected_bits = (ECMA_PROPERTY_FLAG_DATA | ECMA_PROPERTY_FLAG_ENUMERABLE);
if ((*property_p & expected_bits) == expected_bits)
@@ -117,7 +114,6 @@ ecma_op_raise_set_binding_error (ecma_property_t *property_p, /**< property */
return ecma_raise_type_error (ECMA_ERR_CONSTANT_BINDINGS_CANNOT_BE_REASSIGNED);
}
-#endif /* JERRY_ESNEXT */
if (is_strict)
{
@@ -135,12 +131,8 @@ ecma_op_raise_set_binding_error (ecma_property_t *property_p, /**< property */
ecma_object_t *
ecma_get_global_scope (ecma_object_t *global_object_p) /**< global object */
{
-#if JERRY_ESNEXT
JERRY_ASSERT (global_object_p != NULL && ecma_builtin_is_global (global_object_p));
return ECMA_GET_NON_NULL_POINTER (ecma_object_t, ((ecma_global_object_t *) global_object_p)->global_scope_cp);
-#else /* !JERRY_ESNEXT */
- return ecma_get_global_environment (global_object_p);
-#endif /* !JERRY_ESNEXT */
} /* ecma_get_global_scope */
/**
@@ -164,7 +156,6 @@ ecma_op_has_binding (ecma_object_t *lex_env_p, /**< lexical environment */
switch (lex_env_type)
{
-#if JERRY_ESNEXT
case ECMA_LEXICAL_ENVIRONMENT_CLASS:
{
if (!ECMA_LEX_ENV_CLASS_IS_MODULE (lex_env_p))
@@ -173,7 +164,6 @@ ecma_op_has_binding (ecma_object_t *lex_env_p, /**< lexical environment */
}
/* FALLTHRU */
}
-#endif /* JERRY_ESNEXT */
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
ecma_property_t *property_p = ecma_find_named_property (lex_env_p, name_p);
@@ -294,7 +284,6 @@ ecma_op_set_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environment
switch (ecma_get_lex_env_type (lex_env_p))
{
-#if JERRY_ESNEXT
case ECMA_LEXICAL_ENVIRONMENT_CLASS:
{
if (!ECMA_LEX_ENV_CLASS_IS_MODULE (lex_env_p))
@@ -303,7 +292,6 @@ ecma_op_set_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environment
}
/* FALLTHRU */
}
-#endif /* JERRY_ESNEXT */
case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE:
{
ecma_property_t *property_p = ecma_find_named_property (lex_env_p, name_p);
@@ -502,7 +490,6 @@ ecma_op_create_immutable_binding (ecma_object_t *lex_env_p, /**< lexical environ
prop_value_p->value = ecma_copy_value_if_not_object (value);
} /* ecma_op_create_immutable_binding */
-#if JERRY_ESNEXT
/**
* InitializeBinding operation.
*
@@ -650,8 +637,6 @@ ecma_op_get_this_binding (ecma_object_t *lex_env_p) /**< lexical environment */
return this_value;
} /* ecma_op_get_this_binding */
-#endif /* JERRY_ESNEXT */
-
/**
* @}
* @}
diff --git a/jerry-core/ecma/operations/ecma-lex-env.h b/jerry-core/ecma/operations/ecma-lex-env.h
index 5b59559c..e71d729f 100644
--- a/jerry-core/ecma/operations/ecma-lex-env.h
+++ b/jerry-core/ecma/operations/ecma-lex-env.h
@@ -35,9 +35,7 @@ void ecma_init_global_environment (void);
void ecma_finalize_global_environment (void);
ecma_object_t *ecma_get_global_environment (ecma_object_t *global_object_p);
ecma_object_t *ecma_get_global_scope (ecma_object_t *global_object_p);
-#if JERRY_ESNEXT
void ecma_create_global_lexical_block (ecma_object_t *global_object_p);
-#endif /* JERRY_ESNEXT */
ecma_value_t ecma_op_raise_set_binding_error (ecma_property_t *property_p, bool is_strict);
#if JERRY_MODULE_SYSTEM
@@ -70,7 +68,6 @@ ecma_value_t ecma_op_implicit_this_value (ecma_object_t *lex_env_p);
/* ECMA-262 v5, Table 18. Additional methods of Declarative Environment Records */
void ecma_op_create_immutable_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p, ecma_value_t value);
-#if JERRY_ESNEXT
void ecma_op_initialize_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p, ecma_value_t value);
void ecma_op_create_environment_record (ecma_object_t *lex_env_p, ecma_value_t this_binding, ecma_object_t *func_obj_p);
@@ -79,7 +76,6 @@ ecma_environment_record_t *ecma_op_get_environment_record (ecma_object_t *lex_en
bool ecma_op_this_binding_is_initialized (ecma_environment_record_t *environment_record_p);
void ecma_op_bind_this_value (ecma_environment_record_t *environment_record_p, ecma_value_t this_binding);
ecma_value_t ecma_op_get_this_binding (ecma_object_t *lex_env_p);
-#endif /* JERRY_ESNEXT */
/**
* @}
diff --git a/jerry-core/ecma/operations/ecma-number-object.c b/jerry-core/ecma/operations/ecma-number-object.c
index 4160e765..548f2f73 100644
--- a/jerry-core/ecma/operations/ecma-number-object.c
+++ b/jerry-core/ecma/operations/ecma-number-object.c
@@ -61,7 +61,7 @@ ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Numb
proto_id = ECMA_BUILTIN_ID_OBJECT_PROTOTYPE;
#endif /* JERRY_BUILTIN_NUMBER */
ecma_object_t *prototype_obj_p = ecma_builtin_get (proto_id);
-#if JERRY_ESNEXT
+
ecma_object_t *new_target = JERRY_CONTEXT (current_new_target_p);
if (new_target)
{
@@ -71,7 +71,7 @@ ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Numb
return ECMA_VALUE_ERROR;
}
}
-#endif /* JERRY_ESNEXT */
+
ecma_object_t *object_p =
ecma_create_object (prototype_obj_p, sizeof (ecma_extended_object_t), ECMA_OBJECT_TYPE_CLASS);
@@ -80,12 +80,12 @@ ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Numb
/* Pass reference (no need to free conv_to_num_completion). */
ext_object_p->u.cls.u3.value = conv_to_num_completion;
-#if JERRY_ESNEXT
+
if (new_target)
{
ecma_deref_object (prototype_obj_p);
}
-#endif /* JERRY_ESNEXT */
+
return ecma_make_object_value (object_p);
} /* ecma_op_create_number_object */
diff --git a/jerry-core/ecma/operations/ecma-objects-general.c b/jerry-core/ecma/operations/ecma-objects-general.c
index a6c8f036..eef9f134 100644
--- a/jerry-core/ecma/operations/ecma-objects-general.c
+++ b/jerry-core/ecma/operations/ecma-objects-general.c
@@ -131,7 +131,6 @@ ecma_op_general_object_delete (ecma_object_t *obj_p, /**< the object */
if (property & ECMA_PROPERTY_FLAG_BUILT_IN)
{
-#if JERRY_ESNEXT
switch (type)
{
case ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION:
@@ -172,17 +171,6 @@ ecma_op_general_object_delete (ecma_object_t *obj_p, /**< the object */
break;
}
}
-#else /* !JERRY_ESNEXT */
- if (type == ECMA_OBJECT_TYPE_CLASS)
- {
- JERRY_ASSERT (ecma_object_class_is (obj_p, ECMA_OBJECT_CLASS_ARGUMENTS));
- ecma_op_arguments_delete_built_in_property (obj_p, property_name_p);
- }
- else
- {
- ecma_builtin_delete_built_in_property (obj_p, property_name_p);
- }
-#endif /* JERRY_ESNEXT */
}
/* b. */
@@ -205,7 +193,6 @@ static const lit_magic_string_id_t to_primitive_non_string_hint_method_names[2]
LIT_MAGIC_STRING_TO_STRING_UL, /**< toString operation */
};
-#if JERRY_ESNEXT
/**
* Hints for the ecma general object's toPrimitve operation
*/
@@ -214,7 +201,6 @@ static const lit_magic_string_id_t hints[3] = {
LIT_MAGIC_STRING_NUMBER, /**< "number" hint */
LIT_MAGIC_STRING_STRING, /**< "string" hint */
};
-#endif /* JERRY_ESNEXT */
/**
* [[DefaultValue]] ecma general object's operation
@@ -232,7 +218,6 @@ ecma_op_general_object_default_value (ecma_object_t *obj_p, /**< the object */
{
JERRY_ASSERT (obj_p != NULL && !ecma_is_lexical_environment (obj_p));
-#if JERRY_ESNEXT
ecma_value_t obj_value = ecma_make_object_value (obj_p);
ecma_value_t exotic_to_prim = ecma_op_get_method_by_symbol_id (obj_value, LIT_GLOBAL_SYMBOL_TO_PRIMITIVE);
@@ -267,19 +252,6 @@ ecma_op_general_object_default_value (ecma_object_t *obj_p, /**< the object */
{
hint = ECMA_PREFERRED_TYPE_NUMBER;
}
-#else /* !JERRY_ESNEXT */
- if (hint == ECMA_PREFERRED_TYPE_NO)
- {
- hint = ECMA_PREFERRED_TYPE_NUMBER;
-
-#if JERRY_BUILTIN_DATE
- if (ecma_object_class_is (obj_p, ECMA_OBJECT_CLASS_DATE))
- {
- hint = ECMA_PREFERRED_TYPE_STRING;
- }
-#endif /* JERRY_BUILTIN_DATE */
- }
-#endif /* JERRY_ESNEXT */
return ecma_op_general_object_ordinary_value (obj_p, hint);
} /* ecma_op_general_object_default_value */
@@ -637,7 +609,6 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
return ECMA_VALUE_TRUE;
} /* ecma_op_general_object_define_own_property */
-#if JERRY_ESNEXT
/**
* The IsCompatiblePropertyDescriptor method for Proxy object internal methods
*
@@ -775,7 +746,6 @@ ecma_op_to_complete_property_descriptor (ecma_property_descriptor_t *desc_p) /**
desc_p->flags |= (JERRY_PROP_IS_GET_DEFINED | JERRY_PROP_IS_SET_DEFINED);
}
} /* ecma_op_to_complete_property_descriptor */
-#endif /* JERRY_ESNEXT */
/**
* @}
diff --git a/jerry-core/ecma/operations/ecma-objects-general.h b/jerry-core/ecma/operations/ecma-objects-general.h
index aea9959d..210f176c 100644
--- a/jerry-core/ecma/operations/ecma-objects-general.h
+++ b/jerry-core/ecma/operations/ecma-objects-general.h
@@ -36,13 +36,11 @@ ecma_value_t ecma_op_general_object_define_own_property (ecma_object_t *object_p
ecma_string_t *property_name_p,
const ecma_property_descriptor_t *property_desc_p);
-#if JERRY_ESNEXT
void ecma_op_to_complete_property_descriptor (ecma_property_descriptor_t *desc_p);
bool ecma_op_is_compatible_property_descriptor (const ecma_property_descriptor_t *desc_p,
const ecma_property_descriptor_t *current_p,
bool is_extensible);
-#endif /* JERRY_ESNEXT */
/**
* @}
diff --git a/jerry-core/ecma/operations/ecma-objects.c b/jerry-core/ecma/operations/ecma-objects.c
index 59b8ecde..dfe7215e 100644
--- a/jerry-core/ecma/operations/ecma-objects.c
+++ b/jerry-core/ecma/operations/ecma-objects.c
@@ -315,34 +315,6 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */
}
case ECMA_OBJECT_TYPE_FUNCTION:
{
-#if !JERRY_ESNEXT
- if (ecma_string_is_length (property_name_p))
- {
- if (options & ECMA_PROPERTY_GET_VALUE)
- {
- /* Get length virtual property. */
- ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
- const ecma_compiled_code_t *bytecode_data_p = ecma_op_function_get_compiled_code (ext_func_p);
-
- uint32_t len;
- if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
- {
- cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) bytecode_data_p;
- len = args_p->argument_end;
- }
- else
- {
- cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) bytecode_data_p;
- len = args_p->argument_end;
- }
-
- property_ref_p->virtual_value = ecma_make_uint32_value (len);
- }
-
- return ECMA_PROPERTY_VIRTUAL;
- }
-#endif /* !JERRY_ESNEXT */
-
/* Get prototype physical property. */
property_p = ecma_op_function_try_to_lazy_instantiate_property (object_p, property_name_p);
break;
@@ -690,29 +662,6 @@ ecma_op_object_find_own (ecma_value_t base_value, /**< base value */
}
case ECMA_OBJECT_TYPE_FUNCTION:
{
-#if !JERRY_ESNEXT
- if (ecma_string_is_length (property_name_p))
- {
- /* Get length virtual property. */
- ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
- const ecma_compiled_code_t *bytecode_data_p = ecma_op_function_get_compiled_code (ext_func_p);
-
- uint32_t len;
- if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
- {
- cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) bytecode_data_p;
- len = args_p->argument_end;
- }
- else
- {
- cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) bytecode_data_p;
- len = args_p->argument_end;
- }
-
- return ecma_make_uint32_value (len);
- }
-#endif /* !JERRY_ESNEXT */
-
/* Get prototype physical property. */
property_p = ecma_op_function_try_to_lazy_instantiate_property (object_p, property_name_p);
break;
@@ -966,8 +915,6 @@ ecma_op_object_get_by_magic_id (ecma_object_t *object_p, /**< the object */
return ecma_op_object_get (object_p, ecma_get_magic_string (property_id));
} /* ecma_op_object_get_by_magic_id */
-#if JERRY_ESNEXT
-
/**
* Descriptor string for each global symbol
*/
@@ -1064,7 +1011,7 @@ ecma_op_object_get_by_symbol_id (ecma_object_t *object_p, /**< the object */
*/
static ecma_value_t
ecma_op_get_method (ecma_value_t value, /**< ecma value */
- ecma_string_t *prop_name_p) /** property name */
+ ecma_string_t *prop_name_p) /**< property name */
{
/* 2. */
ecma_value_t obj_value = ecma_op_to_object (value);
@@ -1142,7 +1089,6 @@ ecma_op_get_method_by_magic_id (ecma_value_t value, /**< ecma value */
{
return ecma_op_get_method (value, ecma_get_magic_string (magic_id));
} /* ecma_op_get_method_by_magic_id */
-#endif /* JERRY_ESNEXT */
/**
* [[Put]] ecma general object's operation specialized for property index
@@ -1201,7 +1147,6 @@ ecma_op_object_put (ecma_object_t *object_p, /**< the object */
is_throw);
} /* ecma_op_object_put */
-#if JERRY_ESNEXT
/**
* [[Set]] ( P, V, Receiver) operation part for ordinary objects
*
@@ -1302,7 +1247,6 @@ ecma_op_object_put_apply_receiver (ecma_value_t receiver, /**< receiver */
return ECMA_VALUE_TRUE;
} /* ecma_op_object_put_apply_receiver */
-#endif /* JERRY_ESNEXT */
/**
* [[Put]] ecma general object's operation with given receiver
@@ -1503,9 +1447,7 @@ ecma_op_object_put_with_receiver (ecma_object_t *object_p, /**< the object */
if (ecma_string_is_length (property_name_p))
{
/* Uninitialized 'length' property is non-writable (ECMA-262 v6, 19.2.4.1) */
-#if JERRY_ESNEXT
if (!ECMA_GET_FIRST_BIT_FROM_POINTER_TAG (((ecma_extended_object_t *) object_p)->u.function.scope_cp))
-#endif /* JERRY_ESNEXT */
{
return ecma_raise_readonly_assignment (property_name_p, is_throw);
}
@@ -1542,12 +1484,10 @@ ecma_op_object_put_with_receiver (ecma_object_t *object_p, /**< the object */
{
if (ecma_is_property_writable (*property_p))
{
-#if JERRY_ESNEXT
if (ecma_make_object_value (object_p) != receiver)
{
return ecma_op_object_put_apply_receiver (receiver, property_name_p, value, is_throw);
}
-#endif /* JERRY_ESNEXT */
/* There is no need for special casing arrays here because changing the
* value of an existing property never changes the length of an array. */
@@ -1652,9 +1592,7 @@ ecma_op_object_put_with_receiver (ecma_object_t *object_p, /**< the object */
}
}
-#if JERRY_ESNEXT
return ecma_op_object_put_apply_receiver (receiver, property_name_p, value, is_throw);
-#endif /* JERRY_ESNEXT */
ecma_property_value_t *new_prop_value_p;
new_prop_value_p = ecma_create_named_data_property (object_p,
@@ -2374,9 +2312,7 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */
uint32_t array_index_named_props = 0;
uint32_t string_named_props = 0;
-#if JERRY_ESNEXT
uint32_t symbol_named_props = 0;
-#endif /* JERRY_ESNEXT */
while (counter_prop_iter_cp != JMEM_CP_NULL)
{
@@ -2407,7 +2343,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */
{
array_index_named_props++;
}
-#if JERRY_ESNEXT
else if (ecma_prop_name_is_symbol (name_p))
{
if (!(name_p->u.hash & ECMA_SYMBOL_FLAG_PRIVATE_KEY))
@@ -2415,7 +2350,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */
symbol_named_props++;
}
}
-#endif /* JERRY_ESNEXT */
else
{
string_named_props++;
@@ -2439,7 +2373,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */
string_named_props = 0;
}
-#if JERRY_ESNEXT
if (filter & JERRY_PROPERTY_FILTER_EXCLUDE_SYMBOLS)
{
JERRY_ASSERT (prop_counter.symbol_named_props == 0);
@@ -2447,9 +2380,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */
}
uint32_t total = array_index_named_props + string_named_props + symbol_named_props;
-#else /* !JERRY_ESNEXT */
- uint32_t total = array_index_named_props + string_named_props;
-#endif /* JERRY_ESNEXT */
if (total == 0)
{
@@ -2463,7 +2393,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */
ecma_value_t *array_index_current_p = buffer_p + array_index_named_props + prop_counter.array_index_named_props;
ecma_value_t *string_current_p = array_index_current_p + string_named_props + prop_counter.string_named_props;
-#if JERRY_ESNEXT
ecma_value_t *symbol_current_p = string_current_p + symbol_named_props + prop_counter.symbol_named_props;
if (prop_counter.symbol_named_props > 0 && (array_index_named_props + string_named_props) > 0)
@@ -2472,7 +2401,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */
(void *) (buffer_p + prop_counter.array_index_named_props + prop_counter.string_named_props),
prop_counter.symbol_named_props * sizeof (ecma_value_t));
}
-#endif /* JERRY_ESNEXT */
if (prop_counter.string_named_props > 0 && array_index_named_props > 0)
{
@@ -2514,7 +2442,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */
continue;
}
}
-#if JERRY_ESNEXT
else if (ecma_prop_name_is_symbol (name_p))
{
if (!(filter & JERRY_PROPERTY_FILTER_EXCLUDE_SYMBOLS) && !(name_p->u.hash & ECMA_SYMBOL_FLAG_PRIVATE_KEY))
@@ -2523,7 +2450,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */
continue;
}
}
-#endif /* JERRY_ESNEXT */
else
{
if (!(filter & JERRY_PROPERTY_FILTER_EXCLUDE_STRINGS))
@@ -2606,7 +2532,6 @@ ecma_op_object_enumerate (ecma_object_t *obj_p) /**< object */
{
ecma_collection_t *keys = ecma_op_object_own_property_keys (obj_p, JERRY_PROPERTY_FILTER_EXCLUDE_SYMBOLS);
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (keys == NULL))
{
ecma_collection_free (return_names_p);
@@ -2614,19 +2539,16 @@ ecma_op_object_enumerate (ecma_object_t *obj_p) /**< object */
ecma_deref_object (obj_p);
return keys;
}
-#endif /* JERRY_ESNEXT */
for (uint32_t i = 0; i < keys->item_count; i++)
{
ecma_value_t prop_name = keys->buffer_p[i];
ecma_string_t *name_p = ecma_get_prop_name_from_value (prop_name);
-#if JERRY_ESNEXT
if (ecma_prop_name_is_symbol (name_p))
{
continue;
}
-#endif /* JERRY_ESNEXT */
ecma_property_descriptor_t prop_desc;
ecma_value_t get_desc = ecma_op_object_get_own_property_descriptor (obj_p, name_p, &prop_desc);
@@ -2767,7 +2689,6 @@ ecma_object_check_class_name_is_object (ecma_object_t *obj_p) /**< object */
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_BIGUINT64ARRAY_PROTOTYPE)
#endif /* JERRY_BUILTIN_BIGINT */
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ARRAY_PROTOTYPE_UNSCOPABLES)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ARRAY_ITERATOR_PROTOTYPE)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ITERATOR_PROTOTYPE)
@@ -2787,16 +2708,13 @@ ecma_object_check_class_name_is_object (ecma_object_t *obj_p) /**< object */
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_SYMBOL_PROTOTYPE)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ASYNC_FUNCTION_PROTOTYPE)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_PROMISE_PROTOTYPE)
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_CONTAINER
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_MAP_PROTOTYPE)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_SET_PROTOTYPE)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_WEAKMAP_PROTOTYPE)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_WEAKSET_PROTOTYPE)
-#if JERRY_ESNEXT
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_MAP_ITERATOR_PROTOTYPE)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_SET_ITERATOR_PROTOTYPE)
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_BUILTIN_CONTAINER */
#if JERRY_BUILTIN_WEAKREF
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_WEAKREF_PROTOTYPE)
@@ -2825,8 +2743,7 @@ static const uint16_t ecma_class_object_magic_string_id[] = {
LIT_MAGIC_STRING_MODULE_UL, /**< magic string id of ECMA_OBJECT_CLASS_MODULE_NAMESPACE */
#endif /* JERRY_MODULE_SYSTEM */
-/* These objects are marked by Garbage Collector. */
-#if JERRY_ESNEXT
+ /* These objects are marked by Garbage Collector. */
LIT_MAGIC_STRING_GENERATOR_UL, /**< magic string id of ECMA_OBJECT_CLASS_GENERATOR */
LIT_MAGIC_STRING_ASYNC_GENERATOR_UL, /**< magic string id of ECMA_OBJECT_CLASS_ASYNC_GENERATOR */
LIT_MAGIC_STRING_ARRAY_ITERATOR_UL, /**< magic string id of ECMA_OBJECT_CLASS_ARRAY_ITERATOR */
@@ -2835,15 +2752,12 @@ static const uint16_t ecma_class_object_magic_string_id[] = {
#if JERRY_BUILTIN_REGEXP
LIT_MAGIC_STRING_REGEXP_STRING_ITERATOR_UL, /**< magic string id of ECMA_OBJECT_CLASS_REGEXP_STRING_ITERATOR */
#endif /* JERRY_BUILTIN_REGEXP */
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
LIT_MAGIC_STRING_MODULE_UL, /**< magic string id of ECMA_OBJECT_CLASS_MODULE */
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_PROMISE_UL, /**< magic string id of ECMA_OBJECT_CLASS_PROMISE */
LIT_MAGIC_STRING_OBJECT_UL, /**< magic string id of ECMA_OBJECT_CLASS_PROMISE_CAPABILITY */
LIT_MAGIC_STRING_OBJECT_UL, /**< magic string id of ECMA_OBJECT_CLASS_ASYNC_FROM_SYNC_ITERATOR */
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_DATAVIEW
LIT_MAGIC_STRING_DATAVIEW_UL, /**< magic string id of ECMA_OBJECT_CLASS_DATAVIEW */
#endif /* JERRY_BUILTIN_DATAVIEW */
@@ -2865,10 +2779,8 @@ static const uint16_t ecma_class_object_magic_string_id[] = {
#if JERRY_BUILTIN_REGEXP
LIT_MAGIC_STRING_REGEXP_UL, /**< magic string id of ECMA_OBJECT_CLASS_REGEXP */
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_SYMBOL_UL, /**< magic string id of ECMA_OBJECT_CLASS_SYMBOL */
LIT_MAGIC_STRING_STRING_ITERATOR_UL, /**< magic string id of ECMA_OBJECT_CLASS_STRING_ITERATOR */
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_ARRAY_BUFFER_UL, /**< magic string id of ECMA_OBJECT_CLASS_ARRAY_BUFFER */
#endif /* JERRY_BUILTIN_TYPEDARRAY */
@@ -2972,7 +2884,6 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */
return LIT_MAGIC_STRING_REFLECT_UL;
}
#endif /* JERRY_BUILTIN_REFLECT */
-#if JERRY_ESNEXT
case ECMA_BUILTIN_ID_GENERATOR:
{
return LIT_MAGIC_STRING_GENERATOR_UL;
@@ -2981,7 +2892,6 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */
{
return LIT_MAGIC_STRING_ASYNC_GENERATOR_UL;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_JSON
case ECMA_BUILTIN_ID_JSON:
{
@@ -2994,20 +2904,6 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */
return LIT_MAGIC_STRING_ATOMICS_U;
}
#endif /* JERRY_BUILTIN_ATOMICS */
-#if !JERRY_ESNEXT
-#if JERRY_BUILTIN_ERRORS
- case ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE:
- case ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE:
- case ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE:
- case ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE:
- case ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE:
- case ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE:
-#endif /* JERRY_BUILTIN_ERRORS */
- case ECMA_BUILTIN_ID_ERROR_PROTOTYPE:
- {
- return LIT_MAGIC_STRING_ERROR_UL;
- }
-#endif /* !JERRY_ESNEXT */
default:
{
break;
@@ -3041,7 +2937,6 @@ ecma_object_is_regexp_object (ecma_value_t arg) /**< argument */
} /* ecma_object_is_regexp_object */
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_ESNEXT
/**
* Object's IsConcatSpreadable operation, used for Array.prototype.concat
* It checks the argument's [Symbol.isConcatSpreadable] property value
@@ -3187,7 +3082,6 @@ ecma_op_invoke_by_symbol_id (ecma_value_t object, /**< Object value */
return ret_value;
} /* ecma_op_invoke_by_symbol_id */
-#endif /* JERRY_ESNEXT */
/**
* 7.3.18 Abstract operation Invoke when property name is a magic string
@@ -3225,13 +3119,7 @@ ecma_op_invoke (ecma_value_t object, /**< Object value */
ecma_object_t *object_p = ecma_get_object_from_value (object_value);
-#if JERRY_ESNEXT
- ecma_value_t this_arg = object;
-#else /* !JERRY_ESNEXT */
- ecma_value_t this_arg = object_value;
-#endif /* JERRY_ESNEXT */
-
- ecma_value_t func = ecma_op_object_get_with_receiver (object_p, property_name_p, this_arg);
+ ecma_value_t func = ecma_op_object_get_with_receiver (object_p, property_name_p, object);
if (ECMA_IS_VALUE_ERROR (func))
{
@@ -3240,7 +3128,7 @@ ecma_op_invoke (ecma_value_t object, /**< Object value */
}
/* 4. */
- ecma_value_t call_result = ecma_op_function_validated_call (func, this_arg, args_p, args_len);
+ ecma_value_t call_result = ecma_op_function_validated_call (func, object, args_p, args_len);
ecma_free_value (func);
ecma_deref_object (object_p);
diff --git a/jerry-core/ecma/operations/ecma-objects.h b/jerry-core/ecma/operations/ecma-objects.h
index 31c51faf..87e25388 100644
--- a/jerry-core/ecma/operations/ecma-objects.h
+++ b/jerry-core/ecma/operations/ecma-objects.h
@@ -69,13 +69,11 @@ ecma_op_object_get_with_receiver (ecma_object_t *object_p, ecma_string_t *proper
ecma_value_t ecma_op_object_get_length (ecma_object_t *object_p, ecma_length_t *length_p);
ecma_value_t ecma_op_object_get_by_index (ecma_object_t *object_p, ecma_length_t index);
ecma_value_t ecma_op_object_get_by_magic_id (ecma_object_t *object_p, lit_magic_string_id_t property_id);
-#if JERRY_ESNEXT
ecma_string_t *ecma_op_get_global_symbol (lit_magic_string_id_t property_id);
bool ecma_op_compare_string_to_global_symbol (ecma_string_t *string_p, lit_magic_string_id_t property_id);
ecma_value_t ecma_op_object_get_by_symbol_id (ecma_object_t *object_p, lit_magic_string_id_t property_id);
ecma_value_t ecma_op_get_method_by_symbol_id (ecma_value_t value, lit_magic_string_id_t symbol_id);
ecma_value_t ecma_op_get_method_by_magic_id (ecma_value_t value, lit_magic_string_id_t magic_id);
-#endif /* JERRY_ESNEXT */
ecma_value_t ecma_op_object_put_with_receiver (ecma_object_t *object_p,
ecma_string_t *property_name_p,
ecma_value_t value,
@@ -112,7 +110,6 @@ lit_magic_string_id_t ecma_object_get_class_name (ecma_object_t *obj_p);
#if JERRY_BUILTIN_REGEXP
bool ecma_object_is_regexp_object (ecma_value_t arg);
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_ESNEXT
ecma_value_t ecma_op_is_concat_spreadable (ecma_value_t arg);
ecma_value_t ecma_op_is_regexp (ecma_value_t arg);
ecma_value_t ecma_op_species_constructor (ecma_object_t *this_value, ecma_builtin_id_t default_constructor_id);
@@ -120,7 +117,6 @@ ecma_value_t ecma_op_invoke_by_symbol_id (ecma_value_t object,
lit_magic_string_id_t magic_string_id,
ecma_value_t *args_p,
uint32_t args_len);
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_WEAKREF || JERRY_BUILTIN_CONTAINER
void ecma_op_object_set_weak (ecma_object_t *object_p, ecma_object_t *target_p);
void ecma_op_object_unref_weak (ecma_object_t *object_p, ecma_value_t ref_holder);
diff --git a/jerry-core/ecma/operations/ecma-promise-object.c b/jerry-core/ecma/operations/ecma-promise-object.c
index 746a841e..092ed773 100644
--- a/jerry-core/ecma/operations/ecma-promise-object.c
+++ b/jerry-core/ecma/operations/ecma-promise-object.c
@@ -31,8 +31,6 @@
#include "jcontext.h"
-#if JERRY_ESNEXT
-
/** \addtogroup ecma ECMA
* @{
*
@@ -1331,4 +1329,3 @@ ecma_promise_perform_then (ecma_value_t promise, /**< the promise which call 'th
* @}
* @}
*/
-#endif /* JERRY_ESNEXT */
diff --git a/jerry-core/ecma/operations/ecma-promise-object.h b/jerry-core/ecma/operations/ecma-promise-object.h
index 54c88d9a..8cfaa454 100644
--- a/jerry-core/ecma/operations/ecma-promise-object.h
+++ b/jerry-core/ecma/operations/ecma-promise-object.h
@@ -18,8 +18,6 @@
#include "ecma-globals.h"
-#if JERRY_ESNEXT
-
/** \addtogroup ecma ECMA
* @{
*
@@ -46,8 +44,8 @@ typedef enum
*/
typedef struct
{
- ecma_extended_object_t header;
- ecma_value_t promise;
+ ecma_extended_object_t header; /**< extended object part */
+ ecma_value_t promise; /**< [[Promise]] internal slot */
} ecma_promise_resolver_t;
/**
@@ -145,5 +143,4 @@ ecma_value_t ecma_promise_perform_then (ecma_value_t promise,
* @}
*/
-#endif /* JERRY_ESNEXT */
#endif /* !ECMA_PROMISE_OBJECT_H */
diff --git a/jerry-core/ecma/operations/ecma-reference.c b/jerry-core/ecma/operations/ecma-reference.c
index d5e970b2..bf279440 100644
--- a/jerry-core/ecma/operations/ecma-reference.c
+++ b/jerry-core/ecma/operations/ecma-reference.c
@@ -72,8 +72,6 @@ ecma_op_resolve_reference_base (ecma_object_t *lex_env_p, /**< starting lexical
}
} /* ecma_op_resolve_reference_base */
-#if JERRY_ESNEXT
-
/**
* Check if the passed lexical environment is a global lexical environment
*
@@ -192,8 +190,6 @@ ecma_op_is_prop_unscopable (ecma_object_t *binding_obj_p, /**< binding object */
return ECMA_VALUE_FALSE;
} /* ecma_op_is_prop_unscopable */
-#endif /* JERRY_ESNEXT */
-
/**
* Helper method for HasBindig operation
*
@@ -244,9 +240,7 @@ ecma_op_object_bound_environment_resolve_reference_value (ecma_object_t *lex_env
return found_binding;
}
-#if JERRY_ESNEXT
if (JERRY_LIKELY (ecma_op_is_global_environment (lex_env_p)))
-#endif /* JERRY_ESNEXT */
{
return found_binding;
}
@@ -254,7 +248,6 @@ ecma_op_object_bound_environment_resolve_reference_value (ecma_object_t *lex_env
}
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_ESNEXT
ecma_value_t blocked = ecma_op_is_prop_unscopable (binding_obj_p, name_p);
if (ecma_is_value_false (blocked))
@@ -276,7 +269,6 @@ ecma_op_object_bound_environment_resolve_reference_value (ecma_object_t *lex_env
#endif /* JERRY_BUILTIN_PROXY */
return ECMA_IS_VALUE_ERROR (blocked) ? blocked : ECMA_VALUE_NOT_FOUND;
-#endif /* JERRY_ESNEXT */
} /* ecma_op_object_bound_environment_resolve_reference_value */
/**
@@ -305,16 +297,13 @@ ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, /**< starting lexical
ecma_property_value_t *property_value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (property_value_p->value == ECMA_VALUE_UNINITIALIZED))
{
return ecma_raise_reference_error (ECMA_ERR_LET_CONST_NOT_INITIALIZED);
}
-#endif /* JERRY_ESNEXT */
return ecma_fast_copy_value (property_value_p->value);
}
-#if JERRY_ESNEXT
case ECMA_LEXICAL_ENVIRONMENT_CLASS:
{
#if JERRY_MODULE_SYSTEM
@@ -344,17 +333,11 @@ ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, /**< starting lexical
#endif /* JERRY_MODULE_SYSTEM */
break;
}
-#endif /* JERRY_ESNEXT */
default:
{
JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
-#if JERRY_ESNEXT
- bool lcache_lookup_allowed = ecma_op_is_global_environment (lex_env_p);
-#else /* !JERRY_ESNEXT*/
- bool lcache_lookup_allowed = true;
-#endif /* JERRY_ESNEXT */
- if (lcache_lookup_allowed)
+ if (ecma_op_is_global_environment (lex_env_p))
{
#if JERRY_LCACHE
ecma_object_t *binding_obj_p = ecma_get_lex_env_binding_object (lex_env_p);
diff --git a/jerry-core/ecma/operations/ecma-reference.h b/jerry-core/ecma/operations/ecma-reference.h
index ece9b497..e1d4ae79 100644
--- a/jerry-core/ecma/operations/ecma-reference.h
+++ b/jerry-core/ecma/operations/ecma-reference.h
@@ -30,9 +30,7 @@
ecma_object_t *ecma_op_resolve_reference_base (ecma_object_t *lex_env_p, ecma_string_t *name_p);
ecma_value_t ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, ecma_string_t *name_p);
ecma_value_t ecma_op_object_bound_environment_resolve_reference_value (ecma_object_t *lex_env_p, ecma_string_t *name_p);
-#if JERRY_ESNEXT
ecma_value_t ecma_op_resolve_super_base (ecma_object_t *lex_env_p);
-#endif /* JERRY_ESNEXT */
/**
* @}
diff --git a/jerry-core/ecma/operations/ecma-regexp-object.c b/jerry-core/ecma/operations/ecma-regexp-object.c
index 31a479cb..e5b276ae 100644
--- a/jerry-core/ecma/operations/ecma-regexp-object.c
+++ b/jerry-core/ecma/operations/ecma-regexp-object.c
@@ -98,13 +98,11 @@ ecma_regexp_parse_flags (ecma_string_t *flags_str_p, /**< Input string with flag
flag = RE_FLAG_UNICODE;
break;
}
-#if JERRY_ESNEXT
case 's':
{
flag = RE_FLAG_DOTALL;
break;
}
-#endif /* JERRY_ESNEXT */
default:
{
flag = RE_FLAG_EMPTY;
@@ -127,81 +125,6 @@ ecma_regexp_parse_flags (ecma_string_t *flags_str_p, /**< Input string with flag
return ret_value;
} /* ecma_regexp_parse_flags */
-#if !JERRY_ESNEXT
-/*
- * Create the properties of a RegExp instance.
- */
-static void
-ecma_regexp_create_props (ecma_object_t *re_object_p, /**< RegExp object */
- ecma_string_t *source_p, /**< source string */
- uint16_t flags) /**< flags */
-{
- ecma_property_value_t *prop_value_p;
-
- prop_value_p = ecma_create_named_data_property (re_object_p,
- ecma_get_magic_string (LIT_MAGIC_STRING_SOURCE),
- ECMA_PROPERTY_FIXED,
- NULL);
-
- ecma_ref_ecma_string (source_p);
- prop_value_p->value = ecma_make_string_value (source_p);
-
- prop_value_p = ecma_create_named_data_property (re_object_p,
- ecma_get_magic_string (LIT_MAGIC_STRING_GLOBAL),
- ECMA_PROPERTY_FIXED,
- NULL);
-
- prop_value_p->value = ecma_make_boolean_value (flags & RE_FLAG_GLOBAL);
-
- prop_value_p = ecma_create_named_data_property (re_object_p,
- ecma_get_magic_string (LIT_MAGIC_STRING_IGNORECASE_UL),
- ECMA_PROPERTY_FIXED,
- NULL);
-
- prop_value_p->value = ecma_make_boolean_value (flags & RE_FLAG_IGNORE_CASE);
-
- prop_value_p = ecma_create_named_data_property (re_object_p,
- ecma_get_magic_string (LIT_MAGIC_STRING_MULTILINE),
- ECMA_PROPERTY_FIXED,
- NULL);
-
- prop_value_p->value = ecma_make_boolean_value (flags & RE_FLAG_MULTILINE);
-} /* ecma_regexp_create_props */
-
-/*
- * Update the properties of a RegExp instance.
- */
-static void
-ecma_regexp_update_props (ecma_object_t *re_object_p, /**< RegExp object */
- ecma_string_t *source_p, /**< source string */
- uint16_t flags) /**< flags */
-{
- ecma_property_t *prop_p;
-
- prop_p = ecma_find_named_property (re_object_p, ecma_get_magic_string (LIT_MAGIC_STRING_SOURCE));
- JERRY_ASSERT (prop_p != NULL);
- ecma_property_value_t *prop_value_p = ECMA_PROPERTY_VALUE_PTR (prop_p);
- ecma_free_value (prop_value_p->value);
- ecma_ref_ecma_string (source_p);
- prop_value_p->value = ecma_make_string_value (source_p);
-
- prop_p = ecma_find_named_property (re_object_p, ecma_get_magic_string (LIT_MAGIC_STRING_GLOBAL));
- JERRY_ASSERT (prop_p != NULL);
- prop_value_p = ECMA_PROPERTY_VALUE_PTR (prop_p);
- prop_value_p->value = ecma_make_boolean_value (flags & RE_FLAG_GLOBAL);
-
- prop_p = ecma_find_named_property (re_object_p, ecma_get_magic_string (LIT_MAGIC_STRING_IGNORECASE_UL));
- JERRY_ASSERT (prop_p != NULL);
- prop_value_p = ECMA_PROPERTY_VALUE_PTR (prop_p);
- prop_value_p->value = ecma_make_boolean_value (flags & RE_FLAG_IGNORE_CASE);
-
- prop_p = ecma_find_named_property (re_object_p, ecma_get_magic_string (LIT_MAGIC_STRING_MULTILINE));
- JERRY_ASSERT (prop_p != NULL);
- prop_value_p = ECMA_PROPERTY_VALUE_PTR (prop_p);
- prop_value_p->value = ecma_make_boolean_value (flags & RE_FLAG_MULTILINE);
-} /* ecma_regexp_update_props */
-#endif /* !JERRY_ESNEXT */
-
/**
* RegExpAlloc method
*
@@ -216,7 +139,6 @@ ecma_regexp_update_props (ecma_object_t *re_object_p, /**< RegExp object */
ecma_object_t *
ecma_op_regexp_alloc (ecma_object_t *ctr_obj_p) /**< constructor object pointer */
{
-#if JERRY_ESNEXT
if (ctr_obj_p == NULL)
{
ctr_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_REGEXP);
@@ -229,17 +151,10 @@ ecma_op_regexp_alloc (ecma_object_t *ctr_obj_p) /**< constructor object pointer
return proto_obj_p;
}
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (ctr_obj_p);
- ecma_object_t *proto_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_REGEXP_PROTOTYPE);
-#endif /* JERRY_ESNEXT */
-
ecma_object_t *new_object_p =
ecma_create_object (proto_obj_p, sizeof (ecma_extended_object_t), ECMA_OBJECT_TYPE_CLASS);
-#if JERRY_ESNEXT
ecma_deref_object (proto_obj_p);
-#endif /* JERRY_ESNEXT */
ecma_extended_object_t *regexp_obj_p = (ecma_extended_object_t *) new_object_p;
@@ -259,31 +174,11 @@ ecma_op_regexp_alloc (ecma_object_t *ctr_obj_p) /**< constructor object pointer
/**
* Helper method for initializing an aready existing RegExp object.
*/
-static void
+static inline void JERRY_ATTR_ALWAYS_INLINE
ecma_op_regexp_initialize (ecma_object_t *regexp_obj_p, /**< RegExp object */
- const re_compiled_code_t *bc_p, /**< bytecode */
- ecma_string_t *pattern_str_p, /**< pattern */
- uint16_t flags) /**< flags */
+ const re_compiled_code_t *bc_p) /**< bytecode */
{
ecma_extended_object_t *ext_obj_p = (ecma_extended_object_t *) regexp_obj_p;
-
-#if !JERRY_ESNEXT
- if (ext_obj_p->u.cls.type == ECMA_OBJECT_CLASS__MAX)
- {
- /* This instance has not been initialized before. */
- ecma_regexp_create_props (regexp_obj_p, pattern_str_p, flags);
- }
- else
- {
- ecma_regexp_update_props (regexp_obj_p, pattern_str_p, flags);
- }
-#endif /* !JERRY_ESNEXT */
-
-#if JERRY_ESNEXT
- JERRY_UNUSED (pattern_str_p);
- JERRY_UNUSED (flags);
-#endif /* JERRY_ESNEXT */
-
ext_obj_p->u.cls.type = ECMA_OBJECT_CLASS_REGEXP;
ECMA_SET_INTERNAL_VALUE_POINTER (ext_obj_p->u.cls.u3.value, bc_p);
} /* ecma_op_regexp_initialize */
@@ -339,7 +234,7 @@ ecma_op_create_regexp_from_pattern (ecma_object_t *regexp_obj_p, /**< RegExp obj
return ECMA_VALUE_ERROR;
}
- ecma_op_regexp_initialize (regexp_obj_p, bc_p, pattern_str_p, flags);
+ ecma_op_regexp_initialize (regexp_obj_p, bc_p);
ecma_deref_ecma_string (pattern_str_p);
return ecma_make_object_value (regexp_obj_p);
@@ -358,10 +253,8 @@ ecma_op_create_regexp_from_bytecode (ecma_object_t *regexp_obj_p, /**< RegExp ob
re_compiled_code_t *bc_p) /**< bytecode */
{
ecma_bytecode_ref ((ecma_compiled_code_t *) bc_p);
- ecma_string_t *pattern_str_p = ecma_get_string_from_value (bc_p->source);
- uint16_t flags = bc_p->header.status_flags;
- ecma_op_regexp_initialize (regexp_obj_p, bc_p, pattern_str_p, flags);
+ ecma_op_regexp_initialize (regexp_obj_p, bc_p);
return ecma_make_object_value (regexp_obj_p);
} /* ecma_op_create_regexp_from_bytecode */
@@ -394,7 +287,7 @@ ecma_op_create_regexp_with_flags (ecma_object_t *regexp_obj_p, /**< RegExp objec
return ECMA_VALUE_ERROR;
}
- ecma_op_regexp_initialize (regexp_obj_p, bc_p, pattern_str_p, flags);
+ ecma_op_regexp_initialize (regexp_obj_p, bc_p);
return ecma_make_object_value (regexp_obj_p);
} /* ecma_op_create_regexp_with_flags */
@@ -408,7 +301,6 @@ lit_code_point_t
ecma_regexp_canonicalize_char (lit_code_point_t ch, /**< character */
bool unicode) /**< unicode */
{
-#if JERRY_ESNEXT
if (unicode)
{
/* In unicode mode the mappings contained in the CaseFolding.txt file should be used to canonicalize the character.
@@ -432,7 +324,6 @@ ecma_regexp_canonicalize_char (lit_code_point_t ch, /**< character */
return ch;
}
-#endif /* !JERRY_ESNEXT */
JERRY_UNUSED (unicode);
lit_code_point_t cu = lit_char_to_upper_case (ch, NULL);
@@ -520,7 +411,6 @@ ecma_regexp_advance (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context */
JERRY_ASSERT (str_p != NULL);
lit_code_point_t cp = lit_cesu8_read_next (str_p);
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (re_ctx_p->flags & RE_FLAG_UNICODE) && lit_is_code_point_utf16_high_surrogate ((ecma_char_t) cp)
&& *str_p < re_ctx_p->input_end_p)
{
@@ -531,12 +421,10 @@ ecma_regexp_advance (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context */
*str_p += LIT_UTF8_MAX_BYTES_IN_CODE_UNIT;
}
}
-#endif /* JERRY_ESNEXT */
return ecma_regexp_canonicalize (cp, re_ctx_p->flags);
} /* ecma_regexp_advance */
-#if JERRY_ESNEXT
/**
* Helper function to get current full unicode code point and advance the string pointer.
*
@@ -563,7 +451,6 @@ ecma_regexp_unicode_advance (const lit_utf8_byte_t **str_p, /**< reference to st
*str_p = current_p;
return ch;
} /* ecma_regexp_unicode_advance */
-#endif /* JERRY_ESNEXT */
/**
* Helper function to revert the string pointer to the previous code point.
@@ -575,17 +462,14 @@ ecma_regexp_step_back (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context */
const lit_utf8_byte_t *str_p) /**< reference to string pointer */
{
JERRY_ASSERT (str_p != NULL);
-#if JERRY_ESNEXT
+
lit_code_point_t ch = lit_cesu8_read_prev (&str_p);
if (JERRY_UNLIKELY (re_ctx_p->flags & RE_FLAG_UNICODE) && lit_is_code_point_utf16_low_surrogate (ch)
&& lit_is_code_point_utf16_high_surrogate (lit_cesu8_peek_prev (str_p)))
{
str_p -= LIT_UTF8_MAX_BYTES_IN_CODE_UNIT;
}
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (re_ctx_p);
- lit_utf8_decr (&str_p);
-#endif /* !JERRY_ESNEXT */
+
return str_p;
} /* ecma_regexp_step_back */
@@ -606,7 +490,6 @@ ecma_regexp_is_word_boundary (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context *
{
left_cp = LIT_INVALID_CP;
}
-#if JERRY_ESNEXT
else if (JERRY_UNLIKELY ((re_ctx_p->flags & (RE_FLAG_UNICODE | RE_FLAG_IGNORE_CASE))
== (RE_FLAG_UNICODE | RE_FLAG_IGNORE_CASE)))
{
@@ -614,7 +497,6 @@ ecma_regexp_is_word_boundary (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context *
left_cp = ecma_regexp_advance (re_ctx_p, &prev_p);
JERRY_ASSERT (prev_p == str_p);
}
-#endif /* JERRY_ESNEXT */
else
{
left_cp = str_p[-1];
@@ -624,13 +506,11 @@ ecma_regexp_is_word_boundary (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context *
{
right_cp = LIT_INVALID_CP;
}
-#if JERRY_ESNEXT
else if (JERRY_UNLIKELY ((re_ctx_p->flags & (RE_FLAG_UNICODE | RE_FLAG_IGNORE_CASE))
== (RE_FLAG_UNICODE | RE_FLAG_IGNORE_CASE)))
{
right_cp = ecma_regexp_advance (re_ctx_p, &str_p);
}
-#endif /* JERRY_ESNEXT */
else
{
right_cp = str_p[0];
@@ -1494,7 +1374,6 @@ class_found:
bc_p = bc_p + escape_count + chars_size + ranges_size;
continue;
}
-#if JERRY_ESNEXT
case RE_OP_UNICODE_PERIOD:
{
if (str_curr_p >= re_ctx_p->input_end_p)
@@ -1512,7 +1391,6 @@ class_found:
continue;
}
-#endif /* JERRY_ESNEXT */
case RE_OP_PERIOD:
{
if (str_curr_p >= re_ctx_p->input_end_p)
@@ -1521,13 +1399,8 @@ class_found:
}
const ecma_char_t ch = lit_cesu8_read_next (&str_curr_p);
-#if !JERRY_ESNEXT
- bool has_dot_all_flag = false;
-#else /* JERRY_ESNEXT */
- bool has_dot_all_flag = (re_ctx_p->flags & RE_FLAG_DOTALL) != 0;
-#endif /* !JERRY_ESNEXT */
- if (!has_dot_all_flag && lit_char_is_line_terminator (ch))
+ if (!(re_ctx_p->flags & RE_FLAG_DOTALL) && lit_char_is_line_terminator (ch))
{
goto fail;
}
@@ -1744,24 +1617,8 @@ ecma_regexp_exec_helper (ecma_object_t *regexp_object_p, /**< RegExp object */
ecma_length_t index = 0;
ecma_value_t lastindex_value = ecma_op_object_get_by_magic_id (regexp_object_p, LIT_MAGIC_STRING_LASTINDEX_UL);
-#if JERRY_ESNEXT
ret_value = ecma_op_to_length (lastindex_value, &index);
ecma_free_value (lastindex_value);
-#else /* !JERRY_ESNEXT */
- ecma_number_t lastindex_num = 0.0f;
- ret_value = ecma_op_to_integer (lastindex_value, &lastindex_num);
- ecma_free_value (lastindex_value);
-
- /* The ToInteger operation might have thrown an error, however in that case lastindex_num will still be zero,
- * and the error will be handled later after the uint32 coercion. */
- if ((re_ctx.flags & RE_FLAG_GLOBAL) && lastindex_num < 0.0f)
- {
- JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (ret_value));
- goto fail_put_lastindex;
- }
-
- index = ecma_number_to_uint32 (lastindex_num);
-#endif /* JERRY_ESNEXT */
if (ECMA_IS_VALUE_ERROR (ret_value))
{
@@ -1814,13 +1671,11 @@ ecma_regexp_exec_helper (ecma_object_t *regexp_object_p, /**< RegExp object */
goto match_found;
}
-#if JERRY_ESNEXT
/* 12.c.i */
if (re_ctx.flags & RE_FLAG_STICKY)
{
goto fail_put_lastindex;
}
-#endif /* JERRY_ESNEXT */
/* 12.a */
if (input_curr_p >= input_end_p)
@@ -1838,7 +1693,6 @@ ecma_regexp_exec_helper (ecma_object_t *regexp_object_p, /**< RegExp object */
/* 12.c.ii */
index++;
-#if JERRY_ESNEXT
if (re_ctx.flags & RE_FLAG_UNICODE)
{
const lit_code_point_t cp = ecma_regexp_unicode_advance (&input_curr_p, input_end_p);
@@ -1850,7 +1704,6 @@ ecma_regexp_exec_helper (ecma_object_t *regexp_object_p, /**< RegExp object */
continue;
}
-#endif /* JERRY_ESNEXT */
lit_utf8_incr (&input_curr_p);
}
@@ -2075,7 +1928,6 @@ ecma_regexp_split_helper (ecma_value_t this_arg, /**< this value */
ecma_value_t string_arg, /**< string value */
ecma_value_t limit_arg) /**< limit value */
{
-#if JERRY_ESNEXT
/* 2. */
if (!ecma_is_value_object (this_arg))
{
@@ -2389,169 +2241,6 @@ cleanup_string:
ecma_deref_ecma_string (string_p);
return result;
-#else /* !JERRY_ESNEXT */
- ecma_value_t result = ECMA_VALUE_ERROR;
-
- /* 2. */
- ecma_string_t *string_p = ecma_op_to_string (string_arg);
- if (JERRY_UNLIKELY (string_p == NULL))
- {
- return result;
- }
-
- /* 5. */
- uint32_t limit = UINT32_MAX;
- if (!ecma_is_value_undefined (limit_arg))
- {
- if (ECMA_IS_VALUE_ERROR (ecma_op_to_length (limit_arg, &limit)))
- {
- goto cleanup_string;
- }
- }
-
- /* 15. */
- ecma_object_t *const array_p = ecma_op_new_array_object (0);
- ecma_value_t array = ecma_make_object_value (array_p);
-
- /* 21. */
- if (limit == 0)
- {
- result = array;
- goto cleanup_string;
- }
-
- uint32_t array_length = 0;
-
- ecma_object_t *const regexp_p = ecma_get_object_from_value (this_arg);
- ecma_extended_object_t *const ext_object_p = (ecma_extended_object_t *) regexp_p;
- re_compiled_code_t *const bc_p = ECMA_GET_INTERNAL_VALUE_POINTER (re_compiled_code_t, ext_object_p->u.cls.u3.value);
-
- lit_utf8_size_t string_size;
- lit_utf8_size_t string_length;
- uint8_t string_flags = ECMA_STRING_FLAG_IS_ASCII;
- const lit_utf8_byte_t *string_buffer_p =
- ecma_string_get_chars (string_p, &string_size, &string_length, NULL, &string_flags);
-
- const lit_utf8_byte_t *current_str_p = string_buffer_p;
- const lit_utf8_byte_t *previous_str_p = string_buffer_p;
- const lit_utf8_byte_t *const string_end_p = string_buffer_p + string_size;
-
- ecma_regexp_ctx_t re_ctx;
- ecma_regexp_initialize_context (&re_ctx, bc_p, string_buffer_p, string_buffer_p + string_size);
-
- uint8_t *const bc_start_p = (uint8_t *) (bc_p + 1);
-
- if (string_length == 0)
- {
- const lit_utf8_byte_t *const matched_p = ecma_regexp_match (&re_ctx, bc_start_p, current_str_p);
-
- if (ECMA_RE_STACK_LIMIT_REACHED (matched_p))
- {
- result = ecma_raise_range_error (ECMA_ERR_STACK_LIMIT_EXCEEDED);
- goto cleanup_array;
- }
-
- if (matched_p == NULL)
- {
- result = ecma_builtin_helper_def_prop_by_index (array_p,
- array_length,
- ecma_make_string_value (string_p),
- ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE);
- JERRY_ASSERT (ecma_is_value_true (result));
- }
-
- result = array;
- goto cleanup_context;
- }
-
- /* 13. */
- while (current_str_p < string_end_p)
- {
- /* 13.a. */
- const lit_utf8_byte_t *const matched_p = ecma_regexp_match (&re_ctx, bc_start_p, current_str_p);
-
- if (ECMA_RE_STACK_LIMIT_REACHED (matched_p))
- {
- result = ecma_raise_range_error (ECMA_ERR_STACK_LIMIT_EXCEEDED);
- goto cleanup_array;
- }
-
- if (matched_p == NULL || matched_p == previous_str_p)
- {
- lit_utf8_incr (&current_str_p);
- continue;
- }
-
- /* 13.c.iii.1. */
- ecma_string_t *const str_p =
- ecma_new_ecma_string_from_utf8 (previous_str_p, (lit_utf8_size_t) (current_str_p - previous_str_p));
-
- result = ecma_builtin_helper_def_prop_by_index (array_p,
- array_length++,
- ecma_make_string_value (str_p),
- ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE);
- JERRY_ASSERT (ecma_is_value_true (result));
- ecma_deref_ecma_string (str_p);
-
- if (array_length == limit)
- {
- result = array;
- goto cleanup_context;
- }
-
- /* 13.c.iii.5. */
- previous_str_p = matched_p;
-
- uint32_t index = 1;
- while (index < re_ctx.captures_count)
- {
- const ecma_value_t capture = ecma_regexp_get_capture_value (re_ctx.captures_p + index);
- result = ecma_builtin_helper_def_prop_by_index (array_p,
- array_length++,
- capture,
- ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE);
- JERRY_ASSERT (ecma_is_value_true (result));
- ecma_free_value (capture);
-
- if (array_length == limit)
- {
- result = array;
- goto cleanup_context;
- }
-
- index++;
- }
-
- /* 13.c.iii.8. */
- current_str_p = matched_p;
- }
-
- ecma_string_t *const str_p =
- ecma_new_ecma_string_from_utf8 (previous_str_p, (lit_utf8_size_t) (string_end_p - previous_str_p));
-
- result = ecma_builtin_helper_def_prop_by_index (array_p,
- array_length++,
- ecma_make_string_value (str_p),
- ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE);
- JERRY_ASSERT (ecma_is_value_true (result));
- ecma_deref_ecma_string (str_p);
-
- result = array;
- goto cleanup_context;
-
-cleanup_array:
- ecma_deref_object (array_p);
-cleanup_context:
- ecma_regexp_cleanup_context (&re_ctx);
- if (string_flags & ECMA_STRING_FLAG_MUST_BE_FREED)
- {
- jmem_heap_free_block ((void *) string_buffer_p, string_size);
- }
-cleanup_string:
- ecma_deref_ecma_string (string_p);
-
- return result;
-#endif /* JERRY_ESNEXT */
} /* ecma_regexp_split_helper */
/**
@@ -2606,7 +2295,6 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont
goto cleanup_context;
}
-#if JERRY_ESNEXT
/* Only non-global sticky matches use the lastIndex value, otherwise the starting index is 0. */
if (JERRY_UNLIKELY ((ctx_p->flags & RE_FLAG_GLOBAL) == 0 && (re_ctx.flags & RE_FLAG_STICKY) != 0))
{
@@ -2641,7 +2329,6 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont
}
}
else
-#endif /* JERRY_ESNEXT */
{
index = 0;
}
@@ -2723,7 +2410,6 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont
if (!(ctx_p->flags & RE_FLAG_GLOBAL))
{
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY ((re_ctx.flags & RE_FLAG_STICKY) != 0))
{
ecma_value_t index_value = ecma_make_length_value (index);
@@ -2739,7 +2425,6 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont
goto cleanup_builder;
}
}
-#endif /* JERRY_ESNEXT */
break;
}
@@ -2750,7 +2435,6 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont
continue;
}
}
-#if JERRY_ESNEXT
else if (JERRY_UNLIKELY ((re_ctx.flags & RE_FLAG_STICKY) != 0))
{
result = ecma_op_object_put ((ecma_object_t *) re_obj_p,
@@ -2765,14 +2449,12 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont
break;
}
-#endif /* JERRY_ESNEXT */
if (current_p >= string_end_p)
{
break;
}
-#if JERRY_ESNEXT
if ((ctx_p->flags & RE_FLAG_UNICODE) != 0)
{
index++;
@@ -2785,7 +2467,6 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont
continue;
}
-#endif /* JERRY_ESNEXT */
index++;
lit_utf8_incr (&current_p);
@@ -2873,14 +2554,11 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */
ecma_free_value (result);
-#if JERRY_ESNEXT
const lit_utf8_size_t string_length = ecma_string_get_length (string_p);
-#endif /* JERRY_ESNEXT */
/* 10. */
if (replace_ctx.flags & RE_FLAG_GLOBAL)
{
-#if JERRY_ESNEXT
result = ecma_op_object_get_by_magic_id (this_obj_p, LIT_MAGIC_STRING_UNICODE);
if (ECMA_IS_VALUE_ERROR (result))
{
@@ -2893,7 +2571,6 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */
}
ecma_free_value (result);
-#endif /* JERRY_ESNEXT */
result = ecma_op_object_put (this_obj_p,
ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL),
@@ -2907,11 +2584,6 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */
JERRY_ASSERT (ecma_is_value_boolean (result));
}
-#if !JERRY_ESNEXT
- result = ecma_regexp_replace_helper_fast (&replace_ctx, (ecma_extended_object_t *) this_obj_p, string_p, replace_arg);
-
- goto cleanup_replace;
-#else /* JERRY_ESNEXT */
result = ecma_op_object_get_by_magic_id (this_obj_p, LIT_MAGIC_STRING_EXEC);
if (ECMA_IS_VALUE_ERROR (result))
@@ -3276,7 +2948,6 @@ cleanup_chars:
cleanup_results:
ecma_collection_free (results_p);
-#endif /* !JERRY_ESNEXT */
cleanup_replace:
if (replace_ctx.replace_str_p != NULL)
@@ -3336,7 +3007,6 @@ ecma_regexp_match_helper (ecma_value_t this_arg, /**< this argument */
return result;
}
-#if JERRY_ESNEXT
ecma_value_t full_unicode_value = ecma_op_object_get_by_magic_id (obj_p, LIT_MAGIC_STRING_UNICODE);
if (ECMA_IS_VALUE_ERROR (full_unicode_value))
@@ -3348,7 +3018,6 @@ ecma_regexp_match_helper (ecma_value_t this_arg, /**< this argument */
bool full_unicode = ecma_op_to_boolean (full_unicode_value);
ecma_free_value (full_unicode_value);
-#endif /* JERRY_ESNEXT */
ecma_value_t set_status =
ecma_op_object_put (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL), ecma_make_uint32_value (0), true);
@@ -3421,7 +3090,6 @@ ecma_regexp_match_helper (ecma_value_t this_arg, /**< this argument */
goto result_cleanup;
}
-#if JERRY_ESNEXT
ecma_length_t index;
ecma_value_t length_value = ecma_op_to_length (last_index, &index);
@@ -3437,15 +3105,7 @@ ecma_regexp_match_helper (ecma_value_t this_arg, /**< this argument */
last_index = ecma_make_length_value (index);
ecma_value_t next_set_status =
ecma_op_object_put (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL), last_index, true);
-#else /* !JERRY_ESNEXT */
- ecma_number_t index = ecma_get_number_from_value (last_index);
- ecma_free_value (last_index);
-
- last_index = ecma_make_number_value (index + 1);
- ecma_value_t next_set_status =
- ecma_op_object_put (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL), last_index, true);
-#endif /* JERRY_ESNEXT */
ecma_free_value (last_index);
if (ECMA_IS_VALUE_ERROR (next_set_status))
@@ -3478,7 +3138,6 @@ ecma_op_regexp_exec (ecma_value_t this_arg, /**< this argument */
{
ecma_object_t *arg_obj_p = ecma_get_object_from_value (this_arg);
-#if JERRY_ESNEXT
ecma_value_t exec = ecma_op_object_get_by_magic_id (arg_obj_p, LIT_MAGIC_STRING_EXEC);
if (ECMA_IS_VALUE_ERROR (exec))
@@ -3512,7 +3171,6 @@ ecma_op_regexp_exec (ecma_value_t this_arg, /**< this argument */
{
ecma_free_value (exec);
}
-#endif /* JERRY_ESNEXT */
if (!ecma_object_is_regexp_object (this_arg))
{
diff --git a/jerry-core/ecma/operations/ecma-regexp-object.h b/jerry-core/ecma/operations/ecma-regexp-object.h
index 5c97049f..89815897 100644
--- a/jerry-core/ecma/operations/ecma-regexp-object.h
+++ b/jerry-core/ecma/operations/ecma-regexp-object.h
@@ -164,10 +164,7 @@ typedef struct
ecma_value_t iterated_string; /**< [[IteratedString]] internal slot */
} ecma_regexp_string_iterator_t;
-#if JERRY_ESNEXT
lit_code_point_t ecma_regexp_unicode_advance (const lit_utf8_byte_t **str_p, const lit_utf8_byte_t *end_p);
-#endif /* JERRY_ESNEXT */
-
ecma_object_t *ecma_op_regexp_alloc (ecma_object_t *new_target_obj_p);
ecma_value_t ecma_regexp_exec_helper (ecma_object_t *regexp_object_p, ecma_string_t *input_string_p);
ecma_string_t *ecma_regexp_read_pattern_str_helper (ecma_value_t pattern_arg);
diff --git a/jerry-core/ecma/operations/ecma-string-object.c b/jerry-core/ecma/operations/ecma-string-object.c
index 72f7f3aa..597d1868 100644
--- a/jerry-core/ecma/operations/ecma-string-object.c
+++ b/jerry-core/ecma/operations/ecma-string-object.c
@@ -70,7 +70,7 @@ ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of
proto_id = ECMA_BUILTIN_ID_OBJECT_PROTOTYPE;
#endif /* JERRY_BUILTIN_STRING */
ecma_object_t *prototype_obj_p = ecma_builtin_get (proto_id);
-#if JERRY_ESNEXT
+
ecma_object_t *new_target = JERRY_CONTEXT (current_new_target_p);
if (new_target)
{
@@ -80,7 +80,7 @@ ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of
return ECMA_VALUE_ERROR;
}
}
-#endif /* JERRY_ESNEXT */
+
ecma_object_t *object_p =
ecma_create_object (prototype_obj_p, sizeof (ecma_extended_object_t), ECMA_OBJECT_TYPE_CLASS);
@@ -88,12 +88,11 @@ ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of
ext_object_p->u.cls.type = ECMA_OBJECT_CLASS_STRING;
ext_object_p->u.cls.u3.value = prim_value;
-#if JERRY_ESNEXT
if (new_target)
{
ecma_deref_object (prototype_obj_p);
}
-#endif /* JERRY_ESNEXT */
+
return ecma_make_object_value (object_p);
} /* ecma_op_create_string_object */
diff --git a/jerry-core/ecma/operations/ecma-symbol-object.c b/jerry-core/ecma/operations/ecma-symbol-object.c
index 99d62562..adf84367 100644
--- a/jerry-core/ecma/operations/ecma-symbol-object.c
+++ b/jerry-core/ecma/operations/ecma-symbol-object.c
@@ -26,8 +26,6 @@
#include "lit-char-helpers.h"
-#if JERRY_ESNEXT
-
/** \addtogroup ecma ECMA
* @{
*
@@ -172,7 +170,6 @@ ecma_symbol_this_value (ecma_value_t this_arg) /**< this argument value */
/* 3. */
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_SYMBOL);
} /* ecma_symbol_this_value */
-#endif /* JERRY_ESNEXT */
/**
* @}
diff --git a/jerry-core/ecma/operations/ecma-symbol-object.h b/jerry-core/ecma/operations/ecma-symbol-object.h
index 1ca59930..4f27e02a 100644
--- a/jerry-core/ecma/operations/ecma-symbol-object.h
+++ b/jerry-core/ecma/operations/ecma-symbol-object.h
@@ -18,8 +18,6 @@
#include "ecma-globals.h"
-#if JERRY_ESNEXT
-
/** \addtogroup ecma ECMA
* @{
*
@@ -39,7 +37,6 @@ ecma_value_t ecma_symbol_this_value (ecma_value_t this_arg);
ecma_value_t ecma_get_symbol_descriptive_string (ecma_value_t symbol_value);
-#endif /* JERRY_ESNEXT */
/**
* @}
* @}
diff --git a/jerry-core/jcontext/jcontext.h b/jerry-core/jcontext/jcontext.h
index de49d97b..397863a7 100644
--- a/jerry-core/jcontext/jcontext.h
+++ b/jerry-core/jcontext/jcontext.h
@@ -131,16 +131,12 @@ struct jerry_context_t
const lit_utf8_size_t *lit_magic_string_ex_sizes; /**< external magic string lengths */
jmem_cpointer_t ecma_gc_objects_cp; /**< List of currently alive objects. */
jmem_cpointer_t string_list_first_cp; /**< first item of the literal string list */
-#if JERRY_ESNEXT
jmem_cpointer_t symbol_list_first_cp; /**< first item of the global symbol list */
-#endif /* JERRY_ESNEXT */
jmem_cpointer_t number_list_first_cp; /**< first item of the literal number list */
#if JERRY_BUILTIN_BIGINT
jmem_cpointer_t bigint_list_first_cp; /**< first item of the literal bigint list */
#endif /* JERRY_BUILTIN_BIGINT */
-#if JERRY_ESNEXT
jmem_cpointer_t global_symbols_cp[ECMA_BUILTIN_GLOBAL_SYMBOL_COUNT]; /**< global symbols */
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
ecma_module_t *module_current_p; /**< current module context */
@@ -182,8 +178,6 @@ struct jerry_context_t
#if JERRY_BUILTIN_REGEXP
uint8_t re_cache_idx; /**< evicted item index when regex cache is full (round-robin) */
#endif /* JERRY_BUILTIN_REGEXP */
-
-#if JERRY_ESNEXT
ecma_job_queue_item_t *job_queue_head_p; /**< points to the head item of the job queue */
ecma_job_queue_item_t *job_queue_tail_p; /**< points to the tail item of the job queue */
#if JERRY_PROMISE_CALLBACK
@@ -191,7 +185,6 @@ struct jerry_context_t
void *promise_callback_user_p; /**< user pointer for promise callback */
jerry_promise_event_cb_t promise_callback; /**< user function for tracking Promise object operations */
#endif /* JERRY_PROMISE_CALLBACK */
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
uint32_t arraybuffer_compact_allocation_limit; /**< maximum size of compact allocation */
@@ -247,14 +240,12 @@ struct jerry_context_t
ecma_lcache_hash_entry_t lcache[ECMA_LCACHE_HASH_ROWS_COUNT][ECMA_LCACHE_HASH_ROW_LENGTH];
#endif /* JERRY_LCACHE */
-#if JERRY_ESNEXT
/**
* Allowed values and it's meaning:
* * NULL (0x0): the current "new.target" is undefined, that is the execution is inside a normal method.
* * Any other valid function object pointer: the current "new.target" is valid and it is constructor call.
*/
ecma_object_t *current_new_target_p;
-#endif /* JERRY_ESNEXT */
};
#if JERRY_EXTERNAL_CONTEXT
diff --git a/jerry-core/lit/lit-char-helpers.c b/jerry-core/lit/lit-char-helpers.c
index b99136db..ca36a488 100644
--- a/jerry-core/lit/lit-char-helpers.c
+++ b/jerry-core/lit/lit-char-helpers.c
@@ -19,17 +19,13 @@
#include "config.h"
#include "lit-strings.h"
-#include "lit-unicode-ranges.inc.h"
-#if JERRY_ESNEXT
#include "lit-unicode-ranges-sup.inc.h"
-#endif /* JERRY_ESNEXT */
+#include "lit-unicode-ranges.inc.h"
#if JERRY_UNICODE_CASE_CONVERSION
-#include "lit-unicode-conversions.inc.h"
-#if JERRY_ESNEXT
#include "lit-unicode-conversions-sup.inc.h"
+#include "lit-unicode-conversions.inc.h"
#include "lit-unicode-folding.inc.h"
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_UNICODE_CASE_CONVERSION */
#define NUM_OF_ELEMENTS(array) (sizeof (array) / sizeof ((array)[0]))
@@ -74,9 +70,7 @@
LIT_SEARCH_CHAR_IN_ARRAY_FN (lit_search_char_in_array, ecma_char_t, uint16_t)
-#if JERRY_ESNEXT
LIT_SEARCH_CHAR_IN_ARRAY_FN (lit_search_codepoint_in_array, lit_code_point_t, uint32_t)
-#endif /* JERRY_ESNEXT */
/**
* Binary search algorithm that searches a character in the given intervals.
@@ -120,9 +114,7 @@ LIT_SEARCH_CHAR_IN_ARRAY_FN (lit_search_codepoint_in_array, lit_code_point_t, ui
LIT_SEARCH_CHAR_IN_INTERVAL_ARRAY_FN (lit_search_char_in_interval_array, ecma_char_t, uint16_t, uint8_t)
-#if JERRY_ESNEXT
LIT_SEARCH_CHAR_IN_INTERVAL_ARRAY_FN (lit_search_codepoint_in_interval_array, lit_code_point_t, uint32_t, uint16_t)
-#endif /* JERRY_ESNEXT */
/**
* Check if specified character is one of the Whitespace characters including those that fall into
@@ -139,12 +131,7 @@ lit_char_is_white_space (lit_code_point_t c) /**< code point */
return (c == LIT_CHAR_SP || (c >= LIT_CHAR_TAB && c <= LIT_CHAR_CR));
}
- if (c == LIT_CHAR_BOM
-#if !JERRY_ESNEXT
- /* Mongolian Vowel Separator (u180e) used to be a whitespace character. */
- || c == LIT_CHAR_MVS
-#endif /* !JERRY_ESNEXT */
- || c == LIT_CHAR_LS || c == LIT_CHAR_PS)
+ if (c == LIT_CHAR_BOM || c == LIT_CHAR_LS || c == LIT_CHAR_PS)
{
return true;
}
@@ -181,7 +168,6 @@ lit_char_is_line_terminator (ecma_char_t c) /**< code unit */
static bool
lit_char_is_unicode_id_start (lit_code_point_t code_point) /**< code unit */
{
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (code_point >= LIT_UTF8_4_BYTE_CODE_POINT_MIN))
{
return (lit_search_codepoint_in_interval_array (code_point,
@@ -192,10 +178,6 @@ lit_char_is_unicode_id_start (lit_code_point_t code_point) /**< code unit */
lit_unicode_id_start_chars_sup,
NUM_OF_ELEMENTS (lit_unicode_id_start_chars_sup)));
}
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (code_point < LIT_UTF8_4_BYTE_CODE_POINT_MIN);
-#endif /* JERRY_ESNEXT */
-
ecma_char_t c = (ecma_char_t) code_point;
return (lit_search_char_in_interval_array (c,
@@ -223,7 +205,6 @@ lit_char_is_unicode_id_continue (lit_code_point_t code_point) /**< code unit */
return true;
}
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (code_point >= LIT_UTF8_4_BYTE_CODE_POINT_MIN))
{
return (lit_search_codepoint_in_interval_array (code_point,
@@ -234,10 +215,6 @@ lit_char_is_unicode_id_continue (lit_code_point_t code_point) /**< code unit */
lit_unicode_id_continue_chars_sup,
NUM_OF_ELEMENTS (lit_unicode_id_continue_chars_sup)));
}
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (code_point < LIT_UTF8_4_BYTE_CODE_POINT_MIN);
-#endif /* JERRY_ESNEXT */
-
ecma_char_t c = (ecma_char_t) code_point;
return (
@@ -322,7 +299,6 @@ lit_char_is_hex_digit (ecma_char_t c) /**< code unit */
&& LEXER_TO_ASCII_LOWERCASE (c) <= LIT_CHAR_ASCII_LOWERCASE_LETTERS_HEX_END));
} /* lit_char_is_hex_digit */
-#if JERRY_ESNEXT
/**
* Check if specified character is one of BinaryDigits characters (ECMA-262 v6, 11.8.3)
*
@@ -333,7 +309,6 @@ lit_char_is_binary_digit (ecma_char_t c) /** code unit */
{
return (c == LIT_CHAR_0 || c == LIT_CHAR_1);
} /* lit_char_is_binary_digit */
-#endif /* JERRY_ESNEXT */
/**
* @return radix value
@@ -347,7 +322,6 @@ lit_char_to_radix (lit_utf8_byte_t c) /** code unit */
{
return 16;
}
-#if JERRY_ESNEXT
case LIT_CHAR_LOWERCASE_O:
{
return 8;
@@ -356,7 +330,6 @@ lit_char_to_radix (lit_utf8_byte_t c) /** code unit */
{
return 2;
}
-#endif /* JERRY_ESNEXT */
default:
{
return 10;
@@ -595,14 +568,13 @@ lit_search_in_bidirectional_conversion_tables (lit_code_point_t cp, /**< code po
{
/* 1, Check if the specified character is part of the lit_unicode_character_case_ranges_{sup} table. */
int number_of_case_ranges;
-#if JERRY_ESNEXT
bool is_supplementary = cp > LIT_UTF16_CODE_UNIT_MAX;
+
if (is_supplementary)
{
number_of_case_ranges = NUM_OF_ELEMENTS (lit_unicode_character_case_ranges_sup);
}
else
-#endif /* JERRY_ESNEXT */
{
number_of_case_ranges = NUM_OF_ELEMENTS (lit_unicode_character_case_ranges);
}
@@ -618,14 +590,13 @@ lit_search_in_bidirectional_conversion_tables (lit_code_point_t cp, /**< code po
size_t range_length;
lit_code_point_t start_point;
-#if JERRY_ESNEXT
+
if (is_supplementary)
{
range_length = lit_unicode_character_case_range_lengths_sup[conv_counter];
start_point = lit_unicode_character_case_ranges_sup[i];
}
else
-#endif /* JERRY_ESNEXT */
{
range_length = lit_unicode_character_case_range_lengths[conv_counter];
start_point = lit_unicode_character_case_ranges[i];
@@ -657,13 +628,11 @@ lit_search_in_bidirectional_conversion_tables (lit_code_point_t cp, /**< code po
offset = i - 1;
}
-#if JERRY_ESNEXT
if (is_supplementary)
{
start_point = lit_unicode_character_case_ranges_sup[offset];
}
else
-#endif /* JERRY_ESNEXT */
{
start_point = lit_unicode_character_case_ranges[offset];
}
@@ -673,12 +642,10 @@ lit_search_in_bidirectional_conversion_tables (lit_code_point_t cp, /**< code po
/* Note: After this point based on the latest unicode standard(13.0.0.6) no conversion characters are
defined for supplementary planes */
-#if JERRY_ESNEXT
if (is_supplementary)
{
return cp;
}
-#endif /* JERRY_ESNEXT */
/* 2, Check if the specified character is part of the character_pair_ranges table. */
int bottom = 0;
@@ -948,7 +915,6 @@ lit_char_to_upper_case (lit_code_point_t cp, /**< code point */
#endif /* JERRY_UNICODE_CASE_CONVERSION */
} /* lit_char_to_upper_case */
-#if JERRY_ESNEXT
/*
* Look up whether the character should be folded to the lowercase variant.
*
@@ -994,7 +960,6 @@ lit_char_fold_to_upper (lit_code_point_t cp) /**< code point */
return false;
#endif /* JERRY_UNICODE_CASE_CONVERSION */
} /* lit_char_fold_to_upper */
-#endif /* JERRY_ESNEXT */
/**
* Helper method to find a specific character in a string
diff --git a/jerry-core/lit/lit-char-helpers.h b/jerry-core/lit/lit-char-helpers.h
index 1be89da4..9b696177 100644
--- a/jerry-core/lit/lit-char-helpers.h
+++ b/jerry-core/lit/lit-char-helpers.h
@@ -226,9 +226,7 @@ bool lit_code_point_is_identifier_part (lit_code_point_t code_point);
bool lit_char_is_octal_digit (ecma_char_t c);
bool lit_char_is_decimal_digit (ecma_char_t c);
bool lit_char_is_hex_digit (ecma_char_t c);
-#if JERRY_ESNEXT
bool lit_char_is_binary_digit (ecma_char_t c);
-#endif /* JERRY_ESNEXT */
uint8_t lit_char_to_radix (lit_utf8_byte_t c);
void lit_char_unicode_escape (ecma_stringbuilder_t *builder_p, ecma_char_t c);
uint32_t lit_char_hex_to_int (ecma_char_t c);
@@ -256,9 +254,7 @@ bool lit_char_is_word_char (lit_code_point_t c);
lit_code_point_t lit_char_to_lower_case (lit_code_point_t cp, ecma_stringbuilder_t *builder_p);
lit_code_point_t lit_char_to_upper_case (lit_code_point_t cp, ecma_stringbuilder_t *builder_p);
-#if JERRY_ESNEXT
bool lit_char_fold_to_lower (lit_code_point_t cp);
bool lit_char_fold_to_upper (lit_code_point_t cp);
-#endif /* JERRY_ESNEXT */
#endif /* !LIT_CHAR_HELPERS_H */
diff --git a/jerry-core/lit/lit-magic-strings.inc.h b/jerry-core/lit/lit-magic-strings.inc.h
index b6eabcf1..30849a6d 100644
--- a/jerry-core/lit/lit-magic-strings.inc.h
+++ b/jerry-core/lit/lit-magic-strings.inc.h
@@ -17,9 +17,7 @@
* from lit-magic-strings.ini. Do not edit! */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING__EMPTY, "")
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SPACE_CHAR, " ")
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ASTERIX_CHAR, "*")
#endif /* JERRY_MODULE_SYSTEM */
@@ -30,25 +28,16 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COMMA_CHAR, ",")
#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_E_U, "E")
#endif /* JERRY_BUILTIN_MATH */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LEFT_SQUARE_CHAR, "[")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RIGHT_SQUARE_CHAR, "]")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PI_U, "PI")
#endif /* JERRY_BUILTIN_MATH */
-#if JERRY_BUILTIN_ARRAY || JERRY_BUILTIN_STRING || JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_AT, "at")
-#endif /* JERRY_BUILTIN_ARRAY \
-|| JERRY_BUILTIN_STRING \
-|| JERRY_BUILTIN_TYPEDARRAY \
-|| JERRY_ESNEXT */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS, "is")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_ARRAY && JERRY_ESNEXT || JERRY_BUILTIN_TYPEDARRAY
+#if JERRY_BUILTIN_ARRAY || JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_OF, "of")
-#endif /* JERRY_BUILTIN_ARRAY && JERRY_ESNEXT \
+#endif /* JERRY_BUILTIN_ARRAY \
|| JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_ATOMICS
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATOMICS_OR, "or")
@@ -56,15 +45,9 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATOMICS_OR, "or")
#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LN2_U, "LN2")
#endif /* JERRY_BUILTIN_MATH */
-#if JERRY_BUILTIN_CONTAINER || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MAP_UL, "Map")
-#endif /* JERRY_BUILTIN_CONTAINER \
-|| JERRY_ESNEXT */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NAN, "NaN")
-#if JERRY_BUILTIN_CONTAINER || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UL, "Set")
-#endif /* JERRY_BUILTIN_CONTAINER \
-|| JERRY_ESNEXT */
#if JERRY_BUILTIN_DATE
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UTC_U, "UTC")
#endif /* JERRY_BUILTIN_DATE */
@@ -75,22 +58,16 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ABS, "abs")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ADD, "add")
#endif /* JERRY_BUILTIN_ATOMICS \
|| JERRY_BUILTIN_CONTAINER */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ALL, "all")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_ATOMICS
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATOMICS_AND, "and")
#endif /* JERRY_BUILTIN_ATOMICS */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ANY, "any")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COS, "cos")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EXP, "exp")
#endif /* JERRY_BUILTIN_MATH */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FOR, "for")
-#endif /* JERRY_ESNEXT */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET, "get")
#if JERRY_BUILTIN_CONTAINER || JERRY_BUILTIN_PROXY || JERRY_BUILTIN_REFLECT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_HAS, "has")
@@ -117,9 +94,7 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_POP, "pop")
#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_POW, "pow")
#endif /* JERRY_BUILTIN_MATH */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RAW, "raw")
-#endif /* JERRY_ESNEXT */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET, "set")
#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SIN, "sin")
@@ -136,10 +111,7 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATOMICS_XOR, "xor")
#if JERRY_BUILTIN_REGEXP
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP, "(?:)")
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_BUILTIN_DATE || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DATE_UL, "Date")
-#endif /* JERRY_BUILTIN_DATE \
-|| JERRY_ESNEXT */
#if JERRY_BUILTIN_JSON
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_JSON_U, "JSON")
#endif /* JERRY_BUILTIN_JSON */
@@ -155,62 +127,46 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATAN, "atan")
#endif /* JERRY_BUILTIN_MATH */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BIND, "bind")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CALL, "call")
-#if JERRY_BUILTIN_MATH && JERRY_ESNEXT
-LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CBRT, "cbrt")
-#endif /* JERRY_BUILTIN_MATH && JERRY_ESNEXT */
#if JERRY_BUILTIN_MATH
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CBRT, "cbrt")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CEIL, "ceil")
-#endif /* JERRY_BUILTIN_MATH */
-#if JERRY_BUILTIN_MATH && JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COSH, "cosh")
-#endif /* JERRY_BUILTIN_MATH && JERRY_ESNEXT */
-#if JERRY_ESNEXT
+#endif /* JERRY_BUILTIN_MATH */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DONE, "done")
-#endif /* JERRY_ESNEXT */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EVAL, "eval")
#if JERRY_BUILTIN_REGEXP
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EXEC, "exec")
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FILL, "fill")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FIND, "find")
-#endif /* JERRY_BUILTIN_TYPEDARRAY \
-|| JERRY_ESNEXT */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FLAT, "flat")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_ARRAY && JERRY_ESNEXT || JERRY_BUILTIN_TYPEDARRAY
+#if JERRY_BUILTIN_ARRAY || JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FROM, "from")
-#endif /* JERRY_BUILTIN_ARRAY && JERRY_ESNEXT \
+#endif /* JERRY_BUILTIN_ARRAY \
|| JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_BUILTIN_MATH && JERRY_ESNEXT
+#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IMUL, "imul")
-#endif /* JERRY_BUILTIN_MATH && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_MATH */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_JOIN, "join")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_KEYS, "keys")
#if JERRY_BUILTIN_ATOMICS
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATOMICS_LOAD, "load")
#endif /* JERRY_BUILTIN_ATOMICS */
-#if JERRY_BUILTIN_MATH && JERRY_ESNEXT
+#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LOG2, "log2")
-#endif /* JERRY_BUILTIN_MATH && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_MATH */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NAME, "name")
-#if JERRY_BUILTIN_CONTAINER || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NEXT, "next")
-#endif /* JERRY_BUILTIN_CONTAINER \
-|| JERRY_ESNEXT */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NULL, "null")
#if JERRY_BUILTIN_ARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PUSH, "push")
#endif /* JERRY_BUILTIN_ARRAY */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RACE, "race")
-#endif /* JERRY_ESNEXT */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SEAL, "seal")
-#if JERRY_BUILTIN_MATH && JERRY_ESNEXT
+#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SIGN, "sign")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SINH, "sinh")
-#endif /* JERRY_BUILTIN_MATH && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_MATH */
#if JERRY_BUILTIN_CONTAINER
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SIZE, "size")
#endif /* JERRY_BUILTIN_CONTAINER */
@@ -221,16 +177,12 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SORT, "sort")
|| JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SQRT, "sqrt")
-#endif /* JERRY_BUILTIN_MATH */
-#if JERRY_BUILTIN_MATH && JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TANH, "tanh")
-#endif /* JERRY_BUILTIN_MATH && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_MATH */
#if JERRY_BUILTIN_REGEXP
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TEST, "test")
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_THEN, "then")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TRIM, "trim")
#endif /* JERRY_BUILTIN_STRING */
@@ -248,29 +200,21 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PROXY_UL, "Proxy")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SQRT2_U, "SQRT2")
-#endif /* JERRY_BUILTIN_MATH */
-#if JERRY_BUILTIN_MATH && JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ACOSH, "acosh")
-#endif /* JERRY_BUILTIN_MATH && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_MATH */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_APPLY, "apply")
-#if JERRY_BUILTIN_MATH && JERRY_ESNEXT
-LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ASINH, "asinh")
-#endif /* JERRY_BUILTIN_MATH && JERRY_ESNEXT */
#if JERRY_BUILTIN_MATH
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ASINH, "asinh")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATAN2, "atan2")
-#endif /* JERRY_BUILTIN_MATH */
-#if JERRY_BUILTIN_MATH && JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATANH, "atanh")
-#endif /* JERRY_BUILTIN_MATH && JERRY_ESNEXT */
-#if JERRY_ESNEXT
+#endif /* JERRY_BUILTIN_MATH */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CATCH, "catch")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_CONTAINER
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CLEAR, "clear")
#endif /* JERRY_BUILTIN_CONTAINER */
-#if JERRY_BUILTIN_MATH && JERRY_ESNEXT
+#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CLZ32, "clz32")
-#endif /* JERRY_BUILTIN_MATH && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_MATH */
#if JERRY_BUILTIN_WEAKREF
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DEREF, "deref")
#endif /* JERRY_BUILTIN_WEAKREF */
@@ -278,32 +222,27 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DEREF, "deref")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EVERY, "every")
#endif /* JERRY_BUILTIN_ARRAY \
|| JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_BUILTIN_MATH && JERRY_ESNEXT
+#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EXPM1, "expm1")
-#endif /* JERRY_BUILTIN_MATH && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_MATH */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FALSE, "false")
-#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT
+#if JERRY_BUILTIN_REGEXP
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FLAGS, "flags")
-#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FLOOR, "floor")
-#endif /* JERRY_BUILTIN_MATH */
-#if JERRY_BUILTIN_MATH && JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_HYPOT, "hypot")
-#endif /* JERRY_BUILTIN_MATH && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_MATH */
#if JERRY_BUILTIN_REGEXP
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INDEX, "index")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INPUT, "input")
#endif /* JERRY_BUILTIN_REGEXP */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_NAN, "isNaN")
-#if JERRY_BUILTIN_MATH && JERRY_ESNEXT
+#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LOG10, "log10")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LOG1P, "log1p")
-#endif /* JERRY_BUILTIN_MATH && JERRY_ESNEXT */
-#if JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING || JERRY_ESNEXT
+#endif /* JERRY_BUILTIN_MATH */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MATCH, "match")
-#endif /* JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING \
-|| JERRY_ESNEXT */
#if JERRY_BUILTIN_DATE || JERRY_BUILTIN_JSON
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PARSE, "parse")
#endif /* JERRY_BUILTIN_DATE \
@@ -323,22 +262,17 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SLICE, "slice")
|| JERRY_BUILTIN_SHAREDARRAYBUFFER \
|| JERRY_BUILTIN_STRING \
|| JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_BUILTIN_STRING || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SPLIT, "split")
-#endif /* JERRY_BUILTIN_STRING \
-|| JERRY_ESNEXT */
#if JERRY_LINE_INFO
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STACK, "stack")
#endif /* JERRY_LINE_INFO */
#if JERRY_BUILTIN_ATOMICS
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATOMICS_STORE, "store")
#endif /* JERRY_BUILTIN_ATOMICS */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_THROW, "throw")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_MATH && JERRY_ESNEXT
+#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TRUNC, "trunc")
-#endif /* JERRY_BUILTIN_MATH && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_MATH */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_VALUE, "value")
#if JERRY_PARSER && JERRY_SOURCE_NAME
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SOURCE_NAME_EVAL, "<eval>")
@@ -354,18 +288,13 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MODULE_UL, "Module")
#endif /* JERRY_MODULE_SYSTEM */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NUMBER_UL, "Number")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_OBJECT_UL, "Object")
-#if JERRY_BUILTIN_REGEXP || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REGEXP_UL, "RegExp")
-#endif /* JERRY_BUILTIN_REGEXP \
-|| JERRY_ESNEXT */
#if JERRY_PARSER
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SCRIPT_UL, "Script")
#endif /* JERRY_PARSER */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STRING_UL, "String")
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SYMBOL_UL, "Symbol")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ASSIGN, "assign")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BIGINT, "bigint")
#endif /* JERRY_BUILTIN_BIGINT */
@@ -386,12 +315,10 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CREATE, "create")
#if JERRY_BUILTIN_CONTAINER
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DELETE, "delete")
#endif /* JERRY_BUILTIN_CONTAINER */
-#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT
+#if JERRY_BUILTIN_REGEXP
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DOTALL, "dotAll")
-#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */
-#if JERRY_ESNEXT
+#endif /* JERRY_BUILTIN_REGEXP */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ERRORS_UL, "errors")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_ANNEXB
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ESCAPE, "escape")
#endif /* JERRY_BUILTIN_ANNEXB */
@@ -400,106 +327,81 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FILTER, "filter")
#endif /* JERRY_BUILTIN_ARRAY \
|| JERRY_BUILTIN_TYPEDARRAY */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FREEZE, "freeze")
-#if JERRY_BUILTIN_MATH && JERRY_ESNEXT
+#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FROUND, "fround")
-#endif /* JERRY_BUILTIN_MATH && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_MATH */
#if JERRY_BUILTIN_DATE
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_DAY_UL, "getDay")
#endif /* JERRY_BUILTIN_DATE */
#if JERRY_BUILTIN_REGEXP
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GLOBAL, "global")
#endif /* JERRY_BUILTIN_REGEXP */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_HAS_OWN_UL, "hasOwn")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_VIEW_UL, "isView")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_KEY_FOR, "keyFor")
-#endif /* JERRY_ESNEXT */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LENGTH, "length")
#if JERRY_BUILTIN_ATOMICS
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATOMICS_NOTIFY, "notify")
#endif /* JERRY_BUILTIN_ATOMICS */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NUMBER, "number")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_OBJECT, "object")
-#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
+#if JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PAD_END, "padEnd")
-#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_STRING */
#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RANDOM, "random")
#endif /* JERRY_BUILTIN_MATH */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REASON, "reason")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_ARRAY || JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REDUCE, "reduce")
#endif /* JERRY_BUILTIN_ARRAY \
|| JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REJECT, "reject")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
+#if JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REPEAT, "repeat")
-#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
-#if JERRY_ESNEXT
+#endif /* JERRY_BUILTIN_STRING */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RETURN, "return")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REVOKE, "revoke")
#endif /* JERRY_BUILTIN_PROXY */
-#if JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SEARCH, "search")
-#endif /* JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING \
-|| JERRY_ESNEXT */
#if JERRY_BUILTIN_REGEXP
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SOURCE, "source")
#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_BUILTIN_ARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SPLICE, "splice")
#endif /* JERRY_BUILTIN_ARRAY */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STATUS, "status")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT
+#if JERRY_BUILTIN_REGEXP
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STICKY, "sticky")
-#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_REGEXP */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STRING, "string")
#if JERRY_BUILTIN_ANNEXB && JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SUBSTR, "substr")
#endif /* JERRY_BUILTIN_ANNEXB && JERRY_BUILTIN_STRING */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SYMBOL, "symbol")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_DATE || JERRY_BUILTIN_JSON
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_JSON_UL, "toJSON")
#endif /* JERRY_BUILTIN_DATE \
|| JERRY_BUILTIN_JSON */
-#if JERRY_BUILTIN_CONTAINER || JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_VALUES, "values")
-#endif /* JERRY_BUILTIN_CONTAINER \
-|| JERRY_BUILTIN_TYPEDARRAY \
-|| JERRY_ESNEXT */
#if JERRY_BUILTIN_ATOMICS
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATOMICS_U, "Atomics")
#endif /* JERRY_BUILTIN_ATOMICS */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BOOLEAN_UL, "Boolean")
-#if JERRY_BUILTIN_NUMBER && JERRY_ESNEXT
+#if JERRY_BUILTIN_NUMBER
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EPSILON_U, "EPSILON")
-#endif /* JERRY_BUILTIN_NUMBER && JERRY_ESNEXT */
-#if JERRY_ESNEXT
+#endif /* JERRY_BUILTIN_NUMBER */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PROMISE_UL, "Promise")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_REFLECT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REFLECT_UL, "Reflect")
#endif /* JERRY_BUILTIN_REFLECT */
#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SQRT1_2_U, "SQRT1_2")
#endif /* JERRY_BUILTIN_MATH */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SYMBOL_DOT_UL, "Symbol.")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_CONTAINER
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_WEAKMAP_UL, "WeakMap")
#endif /* JERRY_BUILTIN_CONTAINER */
@@ -513,19 +415,10 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BOOLEAN, "boolean")
#if JERRY_BUILTIN_ANNEXB && JERRY_BUILTIN_REGEXP
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COMPILE, "compile")
#endif /* JERRY_BUILTIN_ANNEXB && JERRY_BUILTIN_REGEXP */
-#if JERRY_ESNEXT || JERRY_MODULE_SYSTEM
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DEFAULT, "default")
-#endif /* JERRY_ESNEXT \
-|| JERRY_MODULE_SYSTEM */
-#if JERRY_BUILTIN_CONTAINER || JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ENTRIES, "entries")
-#endif /* JERRY_BUILTIN_CONTAINER \
-|| JERRY_BUILTIN_TYPEDARRAY \
-|| JERRY_ESNEXT */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FINALLY, "finally")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FLATMAP, "flatMap")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_ARRAY || JERRY_BUILTIN_CONTAINER || JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FOR_EACH_UL, "forEach")
#endif /* JERRY_BUILTIN_ARRAY \
@@ -556,13 +449,8 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MESSAGE, "message")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_OWN_KEYS_UL, "ownKeys")
#endif /* JERRY_BUILTIN_PROXY \
|| JERRY_BUILTIN_REFLECT */
-#if JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REPLACE, "replace")
-#endif /* JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING \
-|| JERRY_ESNEXT */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RESOLVE, "resolve")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_ARRAY || JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REVERSE, "reverse")
#endif /* JERRY_BUILTIN_ARRAY \
@@ -579,18 +467,14 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_TIME_UL, "setTime")
#if JERRY_BUILTIN_ANNEXB && JERRY_BUILTIN_DATE
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_YEAR_UL, "setYear")
#endif /* JERRY_BUILTIN_ANNEXB && JERRY_BUILTIN_DATE */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SPECIES, "species")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_NUMBER
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_FIXED_UL, "toFixed")
#endif /* JERRY_BUILTIN_NUMBER */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TRIM_END, "trimEnd")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT
+#if JERRY_BUILTIN_REGEXP
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UNICODE, "unicode")
-#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_BUILTIN_ARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UNSHIFT, "unshift")
#endif /* JERRY_BUILTIN_ARRAY */
@@ -604,9 +488,9 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INFINITY_UL, "Infinity")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_URI_ERROR_UL, "URIError")
#endif /* JERRY_BUILTIN_ERRORS */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_OBJECT_TO_STRING_UL, "[object ")
-#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
+#if JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ENDS_WITH, "endsWith")
-#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_STRING */
#if JERRY_BUILTIN_ATOMICS
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATOMICS_EXCHANGE, "exchange")
#endif /* JERRY_BUILTIN_ATOMICS */
@@ -624,24 +508,17 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_MONTH_UL, "getMonth")
#if JERRY_BUILTIN_DATAVIEW
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UINT8_UL, "getUint8")
#endif /* JERRY_BUILTIN_DATAVIEW */
-#if JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INCLUDES, "includes")
-#endif /* JERRY_BUILTIN_TYPEDARRAY \
-|| JERRY_ESNEXT */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_FINITE, "isFinite")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_FROZEN_UL, "isFrozen")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_SEALED_UL, "isSealed")
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ITERATOR, "iterator")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MATCH_ALL, "matchAll")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
+#if JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PAD_START, "padStart")
-#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_STRING */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PARSE_INT, "parseInt")
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REJECTED, "rejected")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_DATE
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_HOURS_UL, "setHours")
#endif /* JERRY_BUILTIN_DATE */
@@ -659,9 +536,9 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UINT8_UL, "setUint8")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SUBARRAY, "subarray")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_STRING_UL, "toString")
-#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
+#if JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TRIM_LEFT, "trimLeft")
-#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_STRING */
#if JERRY_BUILTIN_ANNEXB
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UNESCAPE, "unescape")
#endif /* JERRY_BUILTIN_ANNEXB */
@@ -671,9 +548,7 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ARGUMENTS_UL, "Arguments")
#if JERRY_BUILTIN_ERRORS
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EVAL_ERROR_UL, "EvalError")
#endif /* JERRY_BUILTIN_ERRORS */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GENERATOR_UL, "Generator")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INT8_ARRAY_UL, "Int8Array")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
@@ -686,9 +561,7 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TYPE_ERROR_UL, "TypeError")
#endif /* JERRY_BUILTIN_ERRORS */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UNDEFINED_UL, "Undefined")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING__PROTO__, "__proto__")
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ANONYMOUS, "anonymous")
-#endif /* JERRY_ESNEXT */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ARGUMENTS, "arguments")
#if JERRY_BUILTIN_PROXY || JERRY_BUILTIN_REFLECT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CONSTRUCT, "construct")
@@ -696,13 +569,8 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CONSTRUCT, "construct")
|| JERRY_BUILTIN_REFLECT */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DECODE_URI, "decodeURI")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ENCODE_URI, "encodeURI")
-#if JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FIND_INDEX, "findIndex")
-#endif /* JERRY_BUILTIN_TYPEDARRAY \
-|| JERRY_ESNEXT */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FULFILLED, "fulfilled")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_DATE
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_DAY_UL, "getUTCDay")
#endif /* JERRY_BUILTIN_DATE */
@@ -710,13 +578,8 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_DAY_UL, "getUTCDay")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UINT16_UL, "getUint16")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UINT32_UL, "getUint32")
#endif /* JERRY_BUILTIN_DATAVIEW */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_INTEGER, "isInteger")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_REGEXP || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LASTINDEX_UL, "lastIndex")
-#endif /* JERRY_BUILTIN_REGEXP \
-|| JERRY_ESNEXT */
#if JERRY_BUILTIN_REGEXP
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MULTILINE, "multiline")
#endif /* JERRY_BUILTIN_REGEXP */
@@ -733,13 +596,9 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STRINGIFY, "stringify")
#endif /* JERRY_BUILTIN_JSON */
#if JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SUBSTRING, "substring")
-#endif /* JERRY_BUILTIN_STRING */
-#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TRIM_RIGHT, "trimRight")
-#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
-#if JERRY_ESNEXT
+#endif /* JERRY_BUILTIN_STRING */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TRIM_START, "trimStart")
-#endif /* JERRY_ESNEXT */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UNDEFINED, "undefined")
#if JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INT16_ARRAY_UL, "Int16Array")
@@ -752,9 +611,7 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RANGE_ERROR_UL, "RangeError")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TYPED_ARRAY_UL, "TypedArray")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UINT8_ARRAY_UL, "Uint8Array")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ALLSETTLED, "allSettled")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_DATAVIEW || JERRY_BUILTIN_SHAREDARRAYBUFFER || JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BYTE_LENGTH_UL, "byteLength")
#endif /* JERRY_BUILTIN_DATAVIEW \
@@ -767,10 +624,7 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BYTE_OFFSET_UL, "byteOffset")
#if JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CHAR_CODE_AT_UL, "charCodeAt")
#endif /* JERRY_BUILTIN_STRING */
-#if JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COPY_WITHIN, "copyWithin")
-#endif /* JERRY_BUILTIN_TYPEDARRAY \
-|| JERRY_ESNEXT */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ENUMERABLE, "enumerable")
#if JERRY_BUILTIN_DATAVIEW
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_FLOAT_32_UL, "getFloat32")
@@ -793,9 +647,9 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IGNORECASE_UL, "ignoreCase")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATOMICS_ISLOCKFREE, "isLockFree")
#endif /* JERRY_BUILTIN_ATOMICS */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PARSE_FLOAT, "parseFloat")
-#if JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING && JERRY_ESNEXT
+#if JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REPLACE_ALL, "replaceAll")
-#endif /* JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING */
#if JERRY_BUILTIN_DATAVIEW
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_FLOAT_32_UL, "setFloat32")
#endif /* JERRY_BUILTIN_DATAVIEW */
@@ -807,9 +661,9 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_MINUTES_UL, "setMinutes")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_SECONDS_UL, "setSeconds")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UTC_DATE_UL, "setUTCDate")
#endif /* JERRY_BUILTIN_DATE */
-#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
+#if JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STARTS_WITH, "startsWith")
-#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_STRING */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SOURCE_NAME_ANON, "<anonymous>")
#if JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ARRAY_BUFFER_UL, "ArrayBuffer")
@@ -821,14 +675,12 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SYNTAX_ERROR_UL, "SyntaxError")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UINT16_ARRAY_UL, "Uint16Array")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UINT32_ARRAY_UL, "Uint32Array")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
+#if JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CODE_POINT_AT, "codePointAt")
-#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_STRING */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CONSTRUCTOR, "constructor")
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DESCRIPTION, "description")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_OBJECT_FROM_ENTRIES, "fromEntries")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_DATAVIEW
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_BIGINT64, "getBigInt64")
#endif /* JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_DATAVIEW */
@@ -837,9 +689,7 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_FULL_YEAR_UL, "getFullYear")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_HOURS_UL, "getUTCHours")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_MONTH_UL, "getUTCMonth")
#endif /* JERRY_BUILTIN_DATE */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_HAS_INSTANCE, "hasInstance")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_ARRAY || JERRY_BUILTIN_STRING || JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LAST_INDEX_OF_UL, "lastIndexOf")
#endif /* JERRY_BUILTIN_ARRAY \
@@ -869,35 +719,24 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_LOWER_CASE_UL, "toLowerCase")
#if JERRY_BUILTIN_NUMBER
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_PRECISION_UL, "toPrecision")
#endif /* JERRY_BUILTIN_NUMBER */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_PRIMITIVE, "toPrimitive")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_STRING_TAG, "toStringTag")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_DATE || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_UTC_STRING_UL, "toUTCString")
-#endif /* JERRY_BUILTIN_DATE \
-|| JERRY_ESNEXT */
#if JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_UPPER_CASE_UL, "toUpperCase")
#endif /* JERRY_BUILTIN_STRING */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UNSCOPABLES, "unscopables")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FLOAT32_ARRAY_UL, "Float32Array")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_TYPEDARRAY && JERRY_NUMBER_TYPE_FLOAT64
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FLOAT64_ARRAY_UL, "Float64Array")
#endif /* JERRY_BUILTIN_TYPEDARRAY && JERRY_NUMBER_TYPE_FLOAT64 */
-#if JERRY_BUILTIN_DATE || JERRY_ESNEXT
+#if JERRY_BUILTIN_DATE
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INVALID_DATE_UL, "Invalid Date")
-#endif /* JERRY_BUILTIN_DATE \
-|| JERRY_ESNEXT */
-#if JERRY_BUILTIN_CONTAINER || JERRY_ESNEXT
+#endif /* JERRY_BUILTIN_DATE */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MAP_ITERATOR_UL, "Map Iterator")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_ITERATOR_UL, "Set Iterator")
-#endif /* JERRY_BUILTIN_CONTAINER \
-|| JERRY_ESNEXT */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CONFIGURABLE, "configurable")
#if JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FROM_CHAR_CODE_UL, "fromCharCode")
@@ -913,26 +752,20 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_BIGUINT64, "setBigUint64")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_DATE_STRING_UL, "toDateString")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_TIME_STRING_UL, "toTimeString")
#endif /* JERRY_BUILTIN_DATE */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ASYNC_FUNCTION_UL, "AsyncFunction")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BIGINT64_ARRAY_UL, "BigInt64Array")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ASYNC_ITERATOR, "asyncIterator")
-#endif /* JERRY_ESNEXT */
-#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
+#if JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FROM_CODE_POINT_UL, "fromCodePoint")
-#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_STRING */
#if JERRY_BUILTIN_DATE
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_MINUTES_UL, "getUTCMinutes")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_SECONDS_UL, "getUTCSeconds")
#endif /* JERRY_BUILTIN_DATE */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_PROTOTYPE_OF_UL, "isPrototypeOf")
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_SAFE_INTEGER, "isSafeInteger")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LOCALE_COMPARE_UL, "localeCompare")
#endif /* JERRY_BUILTIN_STRING */
@@ -943,11 +776,9 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UTC_SECONDS_UL, "setUTCSeconds")
#if JERRY_BUILTIN_NUMBER
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_EXPONENTIAL_UL, "toExponential")
#endif /* JERRY_BUILTIN_NUMBER */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_AGGREGATE_ERROR_UL, "AggregateError")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ARRAY_ITERATOR_UL, "Array Iterator")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ASYNC_GENERATOR_UL, "AsyncGenerator")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BIGUINT64_ARRAY_UL, "BigUint64Array")
#endif /* JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY */
@@ -964,18 +795,12 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_PROTOTYPE_OF_UL, "getPrototypeOf")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_FULL_YEAR_UL, "getUTCFullYear")
#endif /* JERRY_BUILTIN_DATE */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_HAS_OWN_PROPERTY_UL, "hasOwnProperty")
-#if JERRY_BUILTIN_PROXY || JERRY_BUILTIN_REFLECT || JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_PROTOTYPE_OF_UL, "setPrototypeOf")
-#endif /* JERRY_BUILTIN_PROXY \
-|| JERRY_BUILTIN_REFLECT \
-|| JERRY_ESNEXT */
#if JERRY_BUILTIN_DATE
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UTC_FULL_YEAR_UL, "setUTCFullYear")
#endif /* JERRY_BUILTIN_DATE */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_LOCALE_STRING_UL, "toLocaleString")
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STRING_ITERATOR_UL, "String Iterator")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_ATOMICS
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATOMICS_COMPAREEXCHANGE, "compareExchange")
#endif /* JERRY_BUILTIN_ATOMICS */
@@ -983,23 +808,21 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATOMICS_COMPAREEXCHANGE, "compareExchange
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_MILLISECONDS_UL, "getMilliseconds")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_MILLISECONDS_UL, "setMilliseconds")
#endif /* JERRY_BUILTIN_DATE */
-#if JERRY_BUILTIN_NUMBER && JERRY_ESNEXT
+#if JERRY_BUILTIN_NUMBER
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MAX_SAFE_INTEGER_U, "MAX_SAFE_INTEGER")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MIN_SAFE_INTEGER_U, "MIN_SAFE_INTEGER")
-#endif /* JERRY_BUILTIN_NUMBER && JERRY_ESNEXT */
-#if JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB
+#endif /* JERRY_BUILTIN_NUMBER */
+#if JERRY_BUILTIN_ANNEXB
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DEFINE_GETTER, "__defineGetter__")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DEFINE_SETTER, "__defineSetter__")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LOOKUP_GETTER, "__lookupGetter__")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LOOKUP_SETTER, "__lookupSetter__")
-#endif /* JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB */
+#endif /* JERRY_BUILTIN_ANNEXB */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DEFINE_PROPERTIES_UL, "defineProperties")
#if JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U, "BYTES_PER_ELEMENT")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GENERATOR_FUNCTION_UL, "GeneratorFunction")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_NUMBER
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NEGATIVE_INFINITY_U, "NEGATIVE_INFINITY")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_POSITIVE_INFINITY_U, "POSITIVE_INFINITY")
@@ -1023,9 +846,7 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ENCODE_URI_COMPONENT, "encodeURIComponent
#if JERRY_BUILTIN_DATE
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_MILLISECONDS_UL, "getUTCMilliseconds")
#endif /* JERRY_BUILTIN_DATE */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_CONCAT_SPREADABLE, "isConcatSpreadable")
-#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_DATE
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UTC_MILLISECONDS_UL, "setUTCMilliseconds")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_LOCALE_DATE_STRING_UL, "toLocaleDateString")
@@ -1035,25 +856,21 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_LOCALE_TIME_STRING_UL, "toLocaleTimeSt
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FUNCTION_TO_STRING_ANON, "function anonymous(")
#endif /* JERRY_FUNCTION_TO_STRING */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_OWN_PROPERTY_NAMES_UL, "getOwnPropertyNames")
-#if JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING
+#if JERRY_FUNCTION_TO_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FUNCTION_TO_STRING_ANON_GENERATOR, "function* anonymous(")
-#endif /* JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING */
+#endif /* JERRY_FUNCTION_TO_STRING */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PROPERTY_IS_ENUMERABLE_UL, "propertyIsEnumerable")
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_OWN_PROPERTY_SYMBOLS_UL, "getOwnPropertySymbols")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ASYNC_GENERATOR_FUNCTION_UL, "AsyncGeneratorFunction")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REGEXP_STRING_ITERATOR_UL, "RegExp String Iterator")
-#endif /* JERRY_ESNEXT */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL, "getOwnPropertyDescriptor")
-#if JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING
+#if JERRY_FUNCTION_TO_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FUNCTION_TO_STRING_ANON_ASYNC, "async function anonymous(")
-#endif /* JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING */
-#if JERRY_ESNEXT
+#endif /* JERRY_FUNCTION_TO_STRING */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTORS_UL, "getOwnPropertyDescriptors")
-#endif /* JERRY_ESNEXT */
-#if JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING
+#if JERRY_FUNCTION_TO_STRING
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FUNCTION_TO_STRING_ANON_ASYNC_GENERATOR, "async function* anonymous(")
-#endif /* JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING */
+#endif /* JERRY_FUNCTION_TO_STRING */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FUNCTION_TO_STRING_NATIVE, "function () { [native code] }")
#if JERRY_SNAPSHOT_EXEC || !(JERRY_FUNCTION_TO_STRING)
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FUNCTION_TO_STRING_ECMA, "function () { /* ecmascript */ }")
@@ -1061,74 +878,22 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FUNCTION_TO_STRING_ECMA, "function () { /
|| !(JERRY_FUNCTION_TO_STRING) */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (0, LIT_MAGIC_STRING__EMPTY)
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (1, LIT_MAGIC_STRING_SPACE_CHAR)
-#elif JERRY_MODULE_SYSTEM
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (1, LIT_MAGIC_STRING_ASTERIX_CHAR)
-#elif JERRY_BUILTIN_ARRAY || JERRY_BUILTIN_TYPEDARRAY
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (1, LIT_MAGIC_STRING_COMMA_CHAR)
-#elif JERRY_BUILTIN_MATH
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (1, LIT_MAGIC_STRING_E_U)
-#elif JERRY_ESNEXT
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (1, LIT_MAGIC_STRING_LEFT_SQUARE_CHAR)
-#elif JERRY_BUILTIN_MATH
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (1, LIT_MAGIC_STRING_PI_U)
-#elif JERRY_BUILTIN_ARRAY || JERRY_BUILTIN_STRING || JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (1, LIT_MAGIC_STRING_AT)
-#elif JERRY_ESNEXT
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (1, LIT_MAGIC_STRING_IS)
-#elif JERRY_BUILTIN_ARRAY && JERRY_ESNEXT || JERRY_BUILTIN_TYPEDARRAY
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (1, LIT_MAGIC_STRING_OF)
-#elif JERRY_BUILTIN_ATOMICS
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (1, LIT_MAGIC_STRING_ATOMICS_OR)
-#elif JERRY_BUILTIN_MATH
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (1, LIT_MAGIC_STRING_LN2_U)
-#elif JERRY_BUILTIN_CONTAINER || JERRY_ESNEXT
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (1, LIT_MAGIC_STRING_MAP_UL)
-#else /* !(JERRY_BUILTIN_CONTAINER \
-|| JERRY_ESNEXT) */
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (1, LIT_MAGIC_STRING_NAN)
-#endif /* JERRY_BUILTIN_CONTAINER \
-|| JERRY_ESNEXT */
#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_PI_U)
-#elif JERRY_BUILTIN_ARRAY || JERRY_BUILTIN_STRING || JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT
+#else /* !(JERRY_BUILTIN_MATH) */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_AT)
-#elif JERRY_ESNEXT
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_IS)
-#elif JERRY_BUILTIN_ARRAY && JERRY_ESNEXT || JERRY_BUILTIN_TYPEDARRAY
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_OF)
-#elif JERRY_BUILTIN_ATOMICS
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_ATOMICS_OR)
-#elif JERRY_BUILTIN_MATH
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_LN2_U)
-#elif JERRY_BUILTIN_CONTAINER || JERRY_ESNEXT
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_MAP_UL)
-#else /* !(JERRY_BUILTIN_CONTAINER \
-|| JERRY_ESNEXT) */
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_NAN)
-#endif /* JERRY_BUILTIN_CONTAINER \
-|| JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_MATH */
#if JERRY_BUILTIN_MATH
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (3, LIT_MAGIC_STRING_LN2_U)
-#elif JERRY_BUILTIN_CONTAINER || JERRY_ESNEXT
+#else /* !(JERRY_BUILTIN_MATH) */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (3, LIT_MAGIC_STRING_MAP_UL)
-#else /* !(JERRY_BUILTIN_CONTAINER \
-|| JERRY_ESNEXT) */
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (3, LIT_MAGIC_STRING_NAN)
-#endif /* JERRY_BUILTIN_CONTAINER \
-|| JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_MATH */
#if JERRY_BUILTIN_REGEXP
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (4, LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP)
-#elif JERRY_BUILTIN_DATE || JERRY_ESNEXT
+#else /* !(JERRY_BUILTIN_REGEXP) */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (4, LIT_MAGIC_STRING_DATE_UL)
-#elif JERRY_BUILTIN_JSON
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (4, LIT_MAGIC_STRING_JSON_U)
-#elif JERRY_BUILTIN_MATH
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (4, LIT_MAGIC_STRING_LN10_U)
-#else /* !(JERRY_BUILTIN_MATH) */
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (4, LIT_MAGIC_STRING_NULL_UL)
-#endif /* JERRY_BUILTIN_MATH */
+#endif /* JERRY_BUILTIN_REGEXP */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (5, LIT_MAGIC_STRING_ARRAY_UL)
#if JERRY_PARSER && JERRY_SOURCE_NAME
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (6, LIT_MAGIC_STRING_SOURCE_NAME_EVAL)
@@ -1158,129 +923,59 @@ LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_INT16_ARRAY_UL)
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_RANGE_ERROR_UL)
#elif JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_TYPED_ARRAY_UL)
-#elif JERRY_ESNEXT
+#else /* !(JERRY_BUILTIN_TYPEDARRAY) */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_ALLSETTLED)
-#elif JERRY_BUILTIN_DATAVIEW || JERRY_BUILTIN_SHAREDARRAYBUFFER || JERRY_BUILTIN_TYPEDARRAY
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_BYTE_LENGTH_UL)
-#elif JERRY_BUILTIN_DATAVIEW || JERRY_BUILTIN_TYPEDARRAY
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_BYTE_OFFSET_UL)
-#elif JERRY_BUILTIN_STRING
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_CHAR_CODE_AT_UL)
-#elif JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_COPY_WITHIN)
-#else /* !(JERRY_BUILTIN_TYPEDARRAY \
-|| JERRY_ESNEXT) */
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_ENUMERABLE)
-#endif /* JERRY_BUILTIN_TYPEDARRAY \
-|| JERRY_ESNEXT */
+#endif /* JERRY_BUILTIN_TYPEDARRAY */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (11, LIT_MAGIC_STRING_SOURCE_NAME_ANON)
#if JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_FLOAT32_ARRAY_UL)
#elif JERRY_BUILTIN_TYPEDARRAY && JERRY_NUMBER_TYPE_FLOAT64
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_FLOAT64_ARRAY_UL)
-#elif JERRY_BUILTIN_DATE || JERRY_ESNEXT
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_INVALID_DATE_UL)
-#elif JERRY_BUILTIN_CONTAINER || JERRY_ESNEXT
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_MAP_ITERATOR_UL)
-#else /* !(JERRY_BUILTIN_CONTAINER \
-|| JERRY_ESNEXT) */
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_CONFIGURABLE)
-#endif /* JERRY_BUILTIN_CONTAINER \
-|| JERRY_ESNEXT */
-#if JERRY_ESNEXT
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (13, LIT_MAGIC_STRING_ASYNC_FUNCTION_UL)
-#elif JERRY_BUILTIN_TYPEDARRAY
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (13, LIT_MAGIC_STRING_BIGINT64_ARRAY_UL)
-#elif JERRY_ESNEXT
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (13, LIT_MAGIC_STRING_ASYNC_ITERATOR)
-#elif JERRY_BUILTIN_STRING && JERRY_ESNEXT
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (13, LIT_MAGIC_STRING_FROM_CODE_POINT_UL)
#elif JERRY_BUILTIN_DATE
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (13, LIT_MAGIC_STRING_GET_UTC_MINUTES_UL)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_INVALID_DATE_UL)
#else /* !(JERRY_BUILTIN_DATE) */
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (13, LIT_MAGIC_STRING_IS_PROTOTYPE_OF_UL)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_MAP_ITERATOR_UL)
#endif /* JERRY_BUILTIN_DATE */
-#if JERRY_ESNEXT
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (13, LIT_MAGIC_STRING_ASYNC_FUNCTION_UL)
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (14, LIT_MAGIC_STRING_AGGREGATE_ERROR_UL)
-#elif JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (14, LIT_MAGIC_STRING_BIGUINT64_ARRAY_UL)
-#elif JERRY_BUILTIN_ERRORS
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (14, LIT_MAGIC_STRING_REFERENCE_ERROR_UL)
-#else /* !(JERRY_BUILTIN_ERRORS) */
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (14, LIT_MAGIC_STRING_DEFINE_PROPERTY_UL)
-#endif /* JERRY_BUILTIN_ERRORS */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (15, LIT_MAGIC_STRING_STRING_ITERATOR_UL)
-#elif JERRY_BUILTIN_ATOMICS
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (15, LIT_MAGIC_STRING_ATOMICS_COMPAREEXCHANGE)
-#elif JERRY_BUILTIN_DATE
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (15, LIT_MAGIC_STRING_GET_MILLISECONDS_UL)
-#elif JERRY_BUILTIN_NUMBER && JERRY_ESNEXT
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (15, LIT_MAGIC_STRING_MAX_SAFE_INTEGER_U)
-#elif JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (15, LIT_MAGIC_STRING_DEFINE_GETTER)
-#else /* !(JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB) */
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (15, LIT_MAGIC_STRING_DEFINE_PROPERTIES_UL)
-#endif /* JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB */
-#if JERRY_BUILTIN_NUMBER && JERRY_ESNEXT
+#if JERRY_BUILTIN_NUMBER
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (16, LIT_MAGIC_STRING_MAX_SAFE_INTEGER_U)
-#elif JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB
+#elif JERRY_BUILTIN_ANNEXB
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (16, LIT_MAGIC_STRING_DEFINE_GETTER)
-#else /* !(JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB) */
+#else /* !(JERRY_BUILTIN_ANNEXB) */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (16, LIT_MAGIC_STRING_DEFINE_PROPERTIES_UL)
-#endif /* JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB */
+#endif /* JERRY_BUILTIN_ANNEXB */
#if JERRY_BUILTIN_TYPEDARRAY
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U)
-#elif JERRY_ESNEXT
+#else /* !(JERRY_BUILTIN_TYPEDARRAY) */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_GENERATOR_FUNCTION_UL)
-#elif JERRY_BUILTIN_NUMBER
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_NEGATIVE_INFINITY_U)
-#elif JERRY_BUILTIN_SHAREDARRAYBUFFER
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_SHARED_ARRAY_BUFFER_UL)
-#elif JERRY_BUILTIN_TYPEDARRAY
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL)
-#elif JERRY_BUILTIN_DATE
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_GET_TIMEZONE_OFFSET_UL)
-#else /* !(JERRY_BUILTIN_DATE) */
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_PREVENT_EXTENSIONS_UL)
-#endif /* JERRY_BUILTIN_DATE */
+#endif /* JERRY_BUILTIN_TYPEDARRAY */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (18, LIT_MAGIC_STRING_DECODE_URI_COMPONENT)
#if JERRY_FUNCTION_TO_STRING
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (19, LIT_MAGIC_STRING_FUNCTION_TO_STRING_ANON)
#else /* !(JERRY_FUNCTION_TO_STRING) */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (19, LIT_MAGIC_STRING_GET_OWN_PROPERTY_NAMES_UL)
#endif /* JERRY_FUNCTION_TO_STRING */
-#if JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING
+#if JERRY_FUNCTION_TO_STRING
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (20, LIT_MAGIC_STRING_FUNCTION_TO_STRING_ANON_GENERATOR)
-#else /* !(JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING) */
+#else /* !(JERRY_FUNCTION_TO_STRING) */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (20, LIT_MAGIC_STRING_PROPERTY_IS_ENUMERABLE_UL)
-#endif /* JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING */
-#if JERRY_ESNEXT
+#endif /* JERRY_FUNCTION_TO_STRING */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (21, LIT_MAGIC_STRING_GET_OWN_PROPERTY_SYMBOLS_UL)
-#else /* !(JERRY_ESNEXT) */
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (21, LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL)
-#endif /* JERRY_ESNEXT */
-#if JERRY_ESNEXT
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (22, LIT_MAGIC_STRING_ASYNC_GENERATOR_FUNCTION_UL)
-#else /* !(JERRY_ESNEXT) */
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (22, LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL)
-#endif /* JERRY_ESNEXT */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (23, LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL)
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (24, LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL)
-#if JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING
+#if JERRY_FUNCTION_TO_STRING
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (25, LIT_MAGIC_STRING_FUNCTION_TO_STRING_ANON_ASYNC)
-#elif JERRY_ESNEXT
+#else /* !(JERRY_FUNCTION_TO_STRING) */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (25, LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTORS_UL)
-#elif JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (25, LIT_MAGIC_STRING_FUNCTION_TO_STRING_ANON_ASYNC_GENERATOR)
-#else /* !(JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING) */
-LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (25, LIT_MAGIC_STRING_FUNCTION_TO_STRING_NATIVE)
-#endif /* JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING */
-#if JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING
+#endif /* JERRY_FUNCTION_TO_STRING */
+#if JERRY_FUNCTION_TO_STRING
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (26, LIT_MAGIC_STRING_FUNCTION_TO_STRING_ANON_ASYNC_GENERATOR)
-#else /* !(JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING) */
+#else /* !(JERRY_FUNCTION_TO_STRING) */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (26, LIT_MAGIC_STRING_FUNCTION_TO_STRING_NATIVE)
-#endif /* JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING */
+#endif /* JERRY_FUNCTION_TO_STRING */
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (27, LIT_MAGIC_STRING_FUNCTION_TO_STRING_NATIVE)
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (28, LIT_MAGIC_STRING_FUNCTION_TO_STRING_NATIVE)
LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (29, LIT_MAGIC_STRING_FUNCTION_TO_STRING_NATIVE)
diff --git a/jerry-core/parser/js/byte-code.h b/jerry-core/parser/js/byte-code.h
index 18d5325e..6538d095 100644
--- a/jerry-core/parser/js/byte-code.h
+++ b/jerry-core/parser/js/byte-code.h
@@ -63,19 +63,12 @@
#define CBC_HAS_POP_STACK_BYTE_ARG (CBC_HAS_BYTE_ARG | CBC_POP_STACK_BYTE_ARG)
-#if JERRY_ESNEXT
/**
* CBC_NO_RESULT_OPERATION for ext opcodes
*/
#define CBC_EXT_NO_RESULT_OPERATION(opcode) \
((opcode) >= PARSER_TO_EXT_OPCODE (CBC_EXT_ASSIGN_SUPER) \
&& (opcode) <= PARSER_TO_EXT_OPCODE (CBC_EXT_SPREAD_CALL_PROP_BLOCK))
-#else /* !JERRY_ESNEXT */
-/**
- * CBC_NO_RESULT_OPERATION for ext opcodes
- */
-#define CBC_EXT_NO_RESULT_OPERATION(opcode) false
-#endif /* JERRY_ESNEXT */
/* Debug macro. */
#define CBC_ARGS_EQ(op, types) ((cbc_flags[op] & CBC_ARG_TYPES) == (types))
diff --git a/jerry-core/parser/js/common.c b/jerry-core/parser/js/common.c
index 53b0a7f1..eafd1677 100644
--- a/jerry-core/parser/js/common.c
+++ b/jerry-core/parser/js/common.c
@@ -347,7 +347,6 @@ util_print_cbc (ecma_compiled_code_t *compiled_code_p) /**< compiled code */
JERRY_DEBUG_MSG (",no_lexical_env");
}
-#if JERRY_ESNEXT
switch (CBC_FUNCTION_GET_TYPE (compiled_code_p->status_flags))
{
case CBC_FUNCTION_CONSTRUCTOR:
@@ -386,7 +385,6 @@ util_print_cbc (ecma_compiled_code_t *compiled_code_p) /**< compiled code */
break;
}
}
-#endif /* JERRY_ESNEXT */
JERRY_DEBUG_MSG ("]\n");
@@ -396,7 +394,6 @@ util_print_cbc (ecma_compiled_code_t *compiled_code_p) /**< compiled code */
JERRY_DEBUG_MSG (" Const literal range end: %d\n", (int) const_literal_end);
JERRY_DEBUG_MSG (" Literal range end: %d\n\n", (int) literal_end);
-#if JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING
if (compiled_code_p->status_flags & CBC_CODE_FLAGS_HAS_EXTENDED_INFO)
{
uint8_t *extended_info_p = ecma_compiled_code_resolve_extended_info (compiled_code_p);
@@ -420,7 +417,6 @@ util_print_cbc (ecma_compiled_code_t *compiled_code_p) /**< compiled code */
size -= (size_t) (extended_info_start_p - extended_info_p);
}
-#endif /* JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING */
byte_code_start_p = (uint8_t *) compiled_code_p;
diff --git a/jerry-core/parser/js/common.h b/jerry-core/parser/js/common.h
index 00f3b6ed..2c03de0c 100644
--- a/jerry-core/parser/js/common.h
+++ b/jerry-core/parser/js/common.h
@@ -76,9 +76,7 @@ typedef enum
* (no need to allocate memory) */
LEXER_FLAG_LATE_INIT = (1 << 3), /**< initialize this variable after the byte code is freed */
LEXER_FLAG_ASCII = (1 << 4), /**< the literal contains only ascii characters */
-#if JERRY_ESNEXT
LEXER_FLAG_GLOBAL = (1 << 5), /**< this local identifier is not a let or const declaration */
-#endif /* JERRY_ESNEXT */
} lexer_literal_status_flags_t;
/**
diff --git a/jerry-core/parser/js/js-lexer.c b/jerry-core/parser/js/js-lexer.c
index 5de418fc..e9429f9f 100644
--- a/jerry-core/parser/js/js-lexer.c
+++ b/jerry-core/parser/js/js-lexer.c
@@ -93,8 +93,6 @@ lexer_hex_to_code_point (const uint8_t *source_p, /**< current source position *
return result;
} /* lexer_hex_to_code_point */
-#if JERRY_ESNEXT
-
/**
* Parse hexadecimal character sequence enclosed in braces
*
@@ -146,8 +144,6 @@ lexer_hex_in_braces_to_code_point (const uint8_t *source_p, /**< current source
return result;
} /* lexer_hex_in_braces_to_code_point */
-#endif /* JERRY_ESNEXT */
-
/**
* Parse hexadecimal character sequence
*
@@ -160,13 +156,11 @@ lexer_unchecked_hex_to_character (const uint8_t **source_p) /**< [in, out] curre
const uint8_t *char_p = *source_p;
uint32_t length = (char_p[-1] == LIT_CHAR_LOWERCASE_U) ? 4 : 2;
-#if JERRY_ESNEXT
if (char_p[0] == LIT_CHAR_LEFT_BRACE)
{
length = 0;
char_p++;
}
-#endif /* JERRY_ESNEXT */
while (true)
{
@@ -188,17 +182,16 @@ lexer_unchecked_hex_to_character (const uint8_t **source_p) /**< [in, out] curre
JERRY_ASSERT (result <= LIT_UNICODE_CODE_POINT_MAX);
-#if JERRY_ESNEXT
if (length == 0)
{
if (*char_p != LIT_CHAR_RIGHT_BRACE)
{
continue;
}
+
*source_p = char_p + 1;
return result;
}
-#endif /* JERRY_ESNEXT */
if (--length == 0)
{
@@ -388,8 +381,6 @@ lexer_skip_spaces (parser_context_t *context_p) /**< context */
}
} /* lexer_skip_spaces */
-#if JERRY_ESNEXT
-
/**
* Skip all the continuous empty statements.
*/
@@ -407,21 +398,12 @@ lexer_skip_empty_statements (parser_context_t *context_p) /**< context */
context_p->token.flags = (uint8_t) (context_p->token.flags | LEXER_NO_SKIP_SPACES);
} /* lexer_skip_empty_statements */
-#endif /* JERRY_ESNEXT */
-
-#if JERRY_ESNEXT
/**
* Checks whether the keyword has escape sequences.
*/
#define LEXER_CHECK_INVALID_KEYWORD(ident_start_p, buffer_p) \
(JERRY_UNLIKELY ((ident_start_p) == (buffer_p)) \
&& !(context_p->global_status_flags & ECMA_PARSE_INTERNAL_PRE_SCANNING))
-#else /* !JERRY_ESNEXT */
-/**
- * Checks whether the keyword has escape sequences.
- */
-#define LEXER_CHECK_INVALID_KEYWORD(ident_start_p, buffer_p) (JERRY_UNLIKELY ((ident_start_p) == (buffer_p)))
-#endif /* JERRY_ESNEXT */
/**
* Keyword data.
@@ -488,9 +470,7 @@ static const keyword_string_t keywords_with_length_4[] = {
* Keywords with 5 characters.
*/
static const keyword_string_t keywords_with_length_5[] = {
-#if JERRY_ESNEXT
LEXER_KEYWORD ("async", LEXER_KEYW_ASYNC), LEXER_KEYWORD ("await", LEXER_KEYW_AWAIT),
-#endif /* JERRY_ESNEXT */
LEXER_KEYWORD ("break", LEXER_KEYW_BREAK), LEXER_KEYWORD ("catch", LEXER_KEYW_CATCH),
LEXER_KEYWORD ("class", LEXER_KEYW_CLASS), LEXER_KEYWORD ("const", LEXER_KEYW_CONST),
LEXER_KEYWORD ("false", LEXER_LIT_FALSE), LEXER_KEYWORD ("super", LEXER_KEYW_SUPER),
@@ -605,7 +585,6 @@ lexer_parse_identifier (parser_context_t *context_p, /**< context */
status_flags = LEXER_LIT_LOCATION_HAS_ESCAPE;
-#if JERRY_ESNEXT
if (source_p + 5 <= source_end_p && source_p[1] == LIT_CHAR_LOWERCASE_U)
{
if (source_p[2] == LIT_CHAR_LEFT_BRACE)
@@ -617,12 +596,6 @@ lexer_parse_identifier (parser_context_t *context_p, /**< context */
code_point = lexer_hex_to_code_point (source_p + 2, 4);
}
}
-#else /* !JERRY_ESNEXT */
- if (source_p + 6 <= source_end_p && source_p[1] == LIT_CHAR_LOWERCASE_U)
- {
- code_point = lexer_hex_to_code_point (source_p + 2, 4);
- }
-#endif /* JERRY_ESNEXT */
if (code_point == UINT32_MAX)
{
@@ -659,7 +632,6 @@ lexer_parse_identifier (parser_context_t *context_p, /**< context */
{
status_flags &= (uint32_t) ~LEXER_LIT_LOCATION_IS_ASCII;
-#if JERRY_ESNEXT
utf8_length = lit_read_code_point_from_utf8 (source_p, (lit_utf8_size_t) (source_end_p - source_p), &code_point);
decoded_length = utf8_length;
@@ -686,18 +658,6 @@ lexer_parse_identifier (parser_context_t *context_p, /**< context */
context_p->global_status_flags |= ECMA_PARSE_INTERNAL_HAS_4_BYTE_MARKER;
#endif /* JERRY_FUNCTION_TO_STRING */
}
-#else /* !JERRY_ESNEXT */
- if (code_point < LIT_UTF8_4_BYTE_MARKER)
- {
- utf8_length =
- lit_read_code_point_from_utf8 (source_p, (lit_utf8_size_t) (source_end_p - source_p), &code_point);
- decoded_length = utf8_length;
- }
- else
- {
- code_point = 0;
- }
-#endif /* JERRY_ESNEXT */
}
if (length == 0)
@@ -778,7 +738,6 @@ lexer_parse_identifier (parser_context_t *context_p, /**< context */
if (JERRY_LIKELY (keyword_p->type < LEXER_FIRST_NON_RESERVED_KEYWORD))
{
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (keyword_p->type == LEXER_KEYW_AWAIT))
{
if (!(context_p->status_flags & (PARSER_IS_ASYNC_FUNCTION | PARSER_IS_CLASS_STATIC_BLOCK))
@@ -799,7 +758,6 @@ lexer_parse_identifier (parser_context_t *context_p, /**< context */
context_p->token.type = (uint8_t) LEXER_KEYW_AWAIT;
break;
}
-#endif /* JERRY_ESNEXT */
if (LEXER_CHECK_INVALID_KEYWORD (ident_start_p, buffer_p))
{
@@ -811,7 +769,6 @@ lexer_parse_identifier (parser_context_t *context_p, /**< context */
break;
}
-#if JERRY_ESNEXT
if (keyword_p->type == LEXER_KEYW_LET && (context_p->status_flags & PARSER_IS_STRICT))
{
if (LEXER_CHECK_INVALID_KEYWORD (ident_start_p, buffer_p))
@@ -842,7 +799,6 @@ lexer_parse_identifier (parser_context_t *context_p, /**< context */
{
parser_raise_error (context_p, PARSER_ERR_ARGUMENTS_IN_CLASS_FIELD);
}
-#endif /* JERRY_ESNEXT */
if (keyword_p->type >= LEXER_FIRST_FUTURE_STRICT_RESERVED_WORD && (context_p->status_flags & PARSER_IS_STRICT)
&& !(options & LEXER_PARSE_NO_STRICT_IDENT_ERROR))
@@ -881,11 +837,7 @@ void
lexer_parse_string (parser_context_t *context_p, /**< context */
lexer_string_options_t opts) /**< options */
{
-#if JERRY_ESNEXT
int32_t raw_length_adjust = 0;
-#else /* JERRY_ESNEXT */
- JERRY_UNUSED (opts);
-#endif /* JERRY_ESNEXT */
uint8_t str_end_character = context_p->source_p[0];
const uint8_t *source_p = context_p->source_p + 1;
@@ -898,12 +850,10 @@ lexer_parse_string (parser_context_t *context_p, /**< context */
size_t length = 0;
lexer_lit_location_flags_t status_flags = LEXER_LIT_LOCATION_IS_ASCII;
-#if JERRY_ESNEXT
if (str_end_character == LIT_CHAR_RIGHT_BRACE)
{
str_end_character = LIT_CHAR_GRAVE_ACCENT;
}
-#endif /* JERRY_ESNEXT */
while (true)
{
@@ -937,9 +887,7 @@ lexer_parse_string (parser_context_t *context_p, /**< context */
source_p++;
if (source_p < source_end_p && *source_p == LIT_CHAR_LF)
{
-#if JERRY_ESNEXT
raw_length_adjust--;
-#endif /* JERRY_ESNEXT */
source_p++;
}
@@ -962,7 +910,6 @@ lexer_parse_string (parser_context_t *context_p, /**< context */
continue;
}
-#if JERRY_ESNEXT
if (opts & LEXER_STRING_RAW)
{
if ((*source_p == LIT_CHAR_GRAVE_ACCENT) || (*source_p == LIT_CHAR_BACKSLASH))
@@ -973,7 +920,6 @@ lexer_parse_string (parser_context_t *context_p, /**< context */
}
continue;
}
-#endif /* JERRY_ESNEXT */
if (*source_p == LIT_CHAR_0 && source_p + 1 < source_end_p
&& (*(source_p + 1) < LIT_CHAR_0 || *(source_p + 1) > LIT_CHAR_9))
@@ -988,12 +934,10 @@ lexer_parse_string (parser_context_t *context_p, /**< context */
* converted to a character which has the same byte length. */
if (*source_p >= LIT_CHAR_0 && *source_p <= LIT_CHAR_3)
{
-#if JERRY_ESNEXT
if (str_end_character == LIT_CHAR_GRAVE_ACCENT)
{
parser_raise_error (context_p, PARSER_ERR_TEMPLATE_STR_OCTAL_ESCAPE);
}
-#endif /* JERRY_ESNEXT */
if (context_p->status_flags & PARSER_IS_STRICT)
{
@@ -1053,7 +997,6 @@ lexer_parse_string (parser_context_t *context_p, /**< context */
uint32_t escape_length = (*source_p == LIT_CHAR_LOWERCASE_X) ? 3 : 5;
lit_code_point_t code_point = UINT32_MAX;
-#if JERRY_ESNEXT
if (source_p + 4 <= source_end_p && source_p[0] == LIT_CHAR_LOWERCASE_U && source_p[1] == LIT_CHAR_LEFT_BRACE)
{
code_point = lexer_hex_in_braces_to_code_point (source_p + 2, source_end_p, &escape_length);
@@ -1061,14 +1004,11 @@ lexer_parse_string (parser_context_t *context_p, /**< context */
}
else
{
-#endif /* JERRY_ESNEXT */
if (source_p + escape_length <= source_end_p)
{
code_point = lexer_hex_to_code_point (source_p + 1, escape_length - 1);
}
-#if JERRY_ESNEXT
}
-#endif /* JERRY_ESNEXT */
if (code_point == UINT32_MAX)
{
@@ -1084,7 +1024,6 @@ lexer_parse_string (parser_context_t *context_p, /**< context */
continue;
}
}
-#if JERRY_ESNEXT
else if (str_end_character == LIT_CHAR_GRAVE_ACCENT && source_p[0] == LIT_CHAR_DOLLAR_SIGN
&& source_p + 1 < source_end_p && source_p[1] == LIT_CHAR_LEFT_BRACE)
{
@@ -1092,7 +1031,6 @@ lexer_parse_string (parser_context_t *context_p, /**< context */
source_p++;
break;
}
-#endif /* JERRY_ESNEXT */
if (*source_p >= LIT_UTF8_4_BYTE_MARKER)
{
@@ -1102,9 +1040,7 @@ lexer_parse_string (parser_context_t *context_p, /**< context */
length += 2 * 3;
status_flags = LEXER_LIT_LOCATION_HAS_ESCAPE;
source_p += 4;
-#if JERRY_ESNEXT
raw_length_adjust += 2;
-#endif /* JERRY_ESNEXT */
column++;
#if JERRY_FUNCTION_TO_STRING
context_p->global_status_flags |= ECMA_PARSE_INTERNAL_HAS_4_BYTE_MARKER;
@@ -1117,7 +1053,6 @@ lexer_parse_string (parser_context_t *context_p, /**< context */
/* Subtract -1 because column is increased below. */
column--;
}
-#if JERRY_ESNEXT
else if (*source_p == LEXER_NEWLINE_LS_PS_BYTE_1 && LEXER_NEWLINE_LS_PS_BYTE_23 (source_p))
{
source_p += 3;
@@ -1153,12 +1088,7 @@ lexer_parse_string (parser_context_t *context_p, /**< context */
continue;
}
}
-#endif /* JERRY_ESNEXT */
- else if (*source_p == LIT_CHAR_CR
-#if !JERRY_ESNEXT
- || (*source_p == LEXER_NEWLINE_LS_PS_BYTE_1 && LEXER_NEWLINE_LS_PS_BYTE_23 (source_p))
-#endif /* !JERRY_ESNEXT */
- || *source_p == LIT_CHAR_LF)
+ else if (*source_p == LIT_CHAR_CR || *source_p == LIT_CHAR_LF)
{
context_p->token.line = line;
context_p->token.column = column;
@@ -1176,23 +1106,17 @@ lexer_parse_string (parser_context_t *context_p, /**< context */
}
}
-#if JERRY_ESNEXT
if (opts & LEXER_STRING_RAW)
{
length = (size_t) ((source_p - string_start_p) + raw_length_adjust);
}
-#endif /* JERRY_ESNEXT */
if (length > PARSER_MAXIMUM_STRING_LENGTH)
{
parser_raise_error (context_p, PARSER_ERR_STRING_TOO_LONG);
}
-#if JERRY_ESNEXT
context_p->token.type = ((str_end_character != LIT_CHAR_GRAVE_ACCENT) ? LEXER_LITERAL : LEXER_TEMPLATE_LITERAL);
-#else /* !JERRY_ESNEXT */
- context_p->token.type = LEXER_LITERAL;
-#endif /* JERRY_ESNEXT */
/* Fill literal data. */
context_p->token.lit_location.char_p = string_start_p;
@@ -1215,17 +1139,12 @@ lexer_check_numbers (parser_context_t *context_p, /**< context */
const ecma_char_t digit_max, /**< maximum of the number range */
const bool is_legacy) /**< is legacy octal number */
{
-#if !JERRY_ESNEXT
- JERRY_UNUSED (context_p);
- JERRY_UNUSED (is_legacy);
-#endif /* !JERRY_ESNEXT */
while (true)
{
while (*source_p < source_end_p && *source_p[0] >= LIT_CHAR_0 && *source_p[0] <= digit_max)
{
*source_p += 1;
}
-#if JERRY_ESNEXT
if (*source_p != source_end_p && *source_p[0] == LIT_CHAR_UNDERSCORE)
{
*source_p += 1;
@@ -1236,7 +1155,6 @@ lexer_check_numbers (parser_context_t *context_p, /**< context */
}
continue;
}
-#endif /* JERRY_ESNEXT */
break;
}
@@ -1264,12 +1182,11 @@ lexer_parse_number (parser_context_t *context_p) /**< context */
if (source_p[0] == LIT_CHAR_0 && source_p + 1 < source_end_p)
{
-#if JERRY_ESNEXT
if (source_p[1] == LIT_CHAR_UNDERSCORE)
{
parser_raise_error (context_p, PARSER_ERR_INVALID_UNDERSCORE_IN_NUMBER);
}
-#endif /* JERRY_ESNEXT */
+
if (LEXER_TO_ASCII_LOWERCASE (source_p[1]) == LIT_CHAR_LOWERCASE_X)
{
context_p->token.extra_value = LEXER_NUMBER_HEXADECIMAL;
@@ -1283,7 +1200,6 @@ lexer_parse_number (parser_context_t *context_p) /**< context */
do
{
source_p++;
-#if JERRY_ESNEXT
if (source_p < source_end_p && source_p[0] == LIT_CHAR_UNDERSCORE)
{
source_p++;
@@ -1292,10 +1208,8 @@ lexer_parse_number (parser_context_t *context_p) /**< context */
parser_raise_error (context_p, PARSER_ERR_INVALID_UNDERSCORE_IN_NUMBER);
}
}
-#endif /* JERRY_ESNEXT */
} while (source_p < source_end_p && lit_char_is_hex_digit (source_p[0]));
}
-#if JERRY_ESNEXT
else if (LEXER_TO_ASCII_LOWERCASE (source_p[1]) == LIT_CHAR_LOWERCASE_O)
{
context_p->token.extra_value = LEXER_NUMBER_OCTAL;
@@ -1308,7 +1222,6 @@ lexer_parse_number (parser_context_t *context_p) /**< context */
lexer_check_numbers (context_p, &source_p, source_end_p, LIT_CHAR_7, false);
}
-#endif /* JERRY_ESNEXT */
else if (source_p[1] >= LIT_CHAR_0 && source_p[1] <= LIT_CHAR_9)
{
context_p->token.extra_value = LEXER_NUMBER_OCTAL;
@@ -1325,15 +1238,11 @@ lexer_parse_number (parser_context_t *context_p) /**< context */
if (source_p < source_end_p && source_p[0] >= LIT_CHAR_8 && source_p[0] <= LIT_CHAR_9)
{
-#if JERRY_ESNEXT
lexer_check_numbers (context_p, &source_p, source_end_p, LIT_CHAR_9, true);
context_p->token.extra_value = LEXER_NUMBER_DECIMAL;
-#else /* !JERRY_ESNEXT */
- parser_raise_error (context_p, PARSER_ERR_INVALID_NUMBER);
-#endif /* JERRY_ESNEXT */
}
}
-#if JERRY_ESNEXT
+
else if (LEXER_TO_ASCII_LOWERCASE (source_p[1]) == LIT_CHAR_LOWERCASE_B)
{
context_p->token.extra_value = LEXER_NUMBER_BINARY;
@@ -1357,7 +1266,6 @@ lexer_parse_number (parser_context_t *context_p) /**< context */
}
} while (source_p < source_end_p && lit_char_is_binary_digit (source_p[0]));
}
-#endif /* JERRY_ESNEXT */
else
{
can_be_float = true;
@@ -1379,12 +1287,11 @@ lexer_parse_number (parser_context_t *context_p) /**< context */
can_be_bigint = false;
#endif /* JERRY_BUILTIN_BIGINT */
-#if JERRY_ESNEXT
if (source_p < source_end_p && source_p[0] == LIT_CHAR_UNDERSCORE)
{
parser_raise_error (context_p, PARSER_ERR_INVALID_UNDERSCORE_IN_NUMBER);
}
-#endif /* JERRY_ESNEXT */
+
lexer_check_numbers (context_p, &source_p, source_end_p, LIT_CHAR_9, false);
}
@@ -1522,7 +1429,6 @@ lexer_parse_number (parser_context_t *context_p) /**< context */
* @param char4 fourth character
* @param type4 type of the fourth character
*/
-#if JERRY_ESNEXT
#define LEXER_TYPE_D_TOKEN(char1, type1, char2, type2, char3, type3, char4, type4) \
case (uint8_t) (char1): \
{ \
@@ -1553,10 +1459,6 @@ lexer_parse_number (parser_context_t *context_p) /**< context */
length = 1; \
break; \
}
-#else /* !JERRY_ESNEXT */
-#define LEXER_TYPE_D_TOKEN(char1, type1, char2, type2, char3, type3, char4, type4) \
- LEXER_TYPE_C_TOKEN (char1, type1, char2, type2, char3, type3)
-#endif /* JERRY_ESNEXT */
/**
* Get next token.
@@ -1566,10 +1468,10 @@ lexer_next_token (parser_context_t *context_p) /**< context */
{
size_t length;
-#if JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING
+#if JERRY_FUNCTION_TO_STRING
/* Needed by arrow functions with expression body */
context_p->function_end_p = context_p->source_p;
-#endif /* JERRY_ESNEXT && JERRY_FUNCTION_TO_STRING */
+#endif /* JERRY_FUNCTION_TO_STRING */
lexer_skip_spaces (context_p);
@@ -1605,9 +1507,7 @@ lexer_next_token (parser_context_t *context_p) /**< context */
LEXER_TYPE_A_TOKEN (LIT_CHAR_RIGHT_SQUARE, LEXER_RIGHT_SQUARE);
LEXER_TYPE_A_TOKEN (LIT_CHAR_SEMICOLON, LEXER_SEMICOLON);
LEXER_TYPE_A_TOKEN (LIT_CHAR_COMMA, LEXER_COMMA);
-#if JERRY_ESNEXT
LEXER_TYPE_A_TOKEN (LIT_CHAR_HASHMARK, LEXER_HASHMARK);
-#endif /* JERRY_ESNEXT */
case (uint8_t) LIT_CHAR_DOT:
{
@@ -1617,14 +1517,12 @@ lexer_next_token (parser_context_t *context_p) /**< context */
return;
}
-#if JERRY_ESNEXT
if (length >= 3 && context_p->source_p[1] == LIT_CHAR_DOT && context_p->source_p[2] == LIT_CHAR_DOT)
{
context_p->token.type = LEXER_THREE_DOTS;
length = 3;
break;
}
-#endif /* JERRY_ESNEXT */
context_p->token.type = LEXER_DOT;
length = 1;
@@ -1728,14 +1626,12 @@ lexer_next_token (parser_context_t *context_p) /**< context */
break;
}
-#if JERRY_ESNEXT
if (context_p->source_p[1] == (uint8_t) LIT_CHAR_GREATER_THAN)
{
context_p->token.type = LEXER_ARROW;
length = 2;
break;
}
-#endif /* JERRY_ESNEXT */
}
context_p->token.type = LEXER_ASSIGN;
@@ -1783,7 +1679,6 @@ lexer_next_token (parser_context_t *context_p) /**< context */
break;
}
-#if JERRY_ESNEXT
if (context_p->source_p[1] == (uint8_t) LIT_CHAR_ASTERISK)
{
if (length >= 3 && context_p->source_p[2] == (uint8_t) LIT_CHAR_EQUALS)
@@ -1797,7 +1692,6 @@ lexer_next_token (parser_context_t *context_p) /**< context */
length = 2;
break;
}
-#endif /* JERRY_ESNEXT */
}
context_p->token.type = LEXER_MULTIPLY;
@@ -1830,7 +1724,6 @@ lexer_next_token (parser_context_t *context_p) /**< context */
LEXER_TYPE_A_TOKEN (LIT_CHAR_TILDE, LEXER_BIT_NOT);
case (uint8_t) (LIT_CHAR_QUESTION):
{
-#if JERRY_ESNEXT
if (length >= 2)
{
if (context_p->source_p[1] == (uint8_t) LIT_CHAR_QUESTION)
@@ -1846,7 +1739,7 @@ lexer_next_token (parser_context_t *context_p) /**< context */
break;
}
}
-#endif /* JERRY_ESNEXT */
+
context_p->token.type = LEXER_QUESTION_MARK;
length = 1;
break;
@@ -1856,9 +1749,7 @@ lexer_next_token (parser_context_t *context_p) /**< context */
case LIT_CHAR_SINGLE_QUOTE:
case LIT_CHAR_DOUBLE_QUOTE:
-#if JERRY_ESNEXT
case LIT_CHAR_GRAVE_ACCENT:
-#endif /* JERRY_ESNEXT */
{
lexer_parse_string (context_p, LEXER_STRING_NO_OPTS);
return;
@@ -1963,9 +1854,7 @@ lexer_check_post_primary_exp (parser_context_t *context_p) /**< context */
case LIT_CHAR_DOT:
case LIT_CHAR_LEFT_PAREN:
case LIT_CHAR_LEFT_SQUARE:
-#if JERRY_ESNEXT
case LIT_CHAR_GRAVE_ACCENT:
-#endif /* JERRY_ESNEXT */
{
return true;
}
@@ -1975,20 +1864,16 @@ lexer_check_post_primary_exp (parser_context_t *context_p) /**< context */
return (!(context_p->token.flags & LEXER_WAS_NEWLINE) && context_p->source_p + 1 < context_p->source_end_p
&& context_p->source_p[1] == context_p->source_p[0]);
}
-#if JERRY_ESNEXT
case LIT_CHAR_ASTERISK:
{
return (context_p->source_p + 1 < context_p->source_end_p
&& context_p->source_p[1] == (uint8_t) LIT_CHAR_ASTERISK);
}
-#endif /* JERRY_ESNEXT */
}
return false;
} /* lexer_check_post_primary_exp */
-#if JERRY_ESNEXT
-
/**
* Checks whether the next token is a type used for detecting arrow functions.
*
@@ -2181,8 +2066,6 @@ lexer_scan_private_identifier (parser_context_t *context_p) /**< context */
return (context_p->source_p < context_p->source_end_p && lexer_parse_identifier (context_p, LEXER_PARSE_NO_OPTS));
} /* lexer_scan_private_identifier */
-#endif /* JERRY_ESNEXT */
-
/**
* Convert an ident with escapes to a utf8 string.
*/
@@ -2204,7 +2087,6 @@ lexer_convert_ident_to_cesu8 (uint8_t *destination_p, /**< destination string */
continue;
}
-#if JERRY_ESNEXT
if (*source_p >= LIT_UTF8_4_BYTE_MARKER)
{
lit_four_byte_utf8_char_to_cesu8 (destination_p, source_p);
@@ -2213,7 +2095,6 @@ lexer_convert_ident_to_cesu8 (uint8_t *destination_p, /**< destination string */
source_p += 4;
continue;
}
-#endif /* JERRY_ESNEXT */
*destination_p++ = *source_p++;
} while (destination_p < destination_end_p);
@@ -2258,17 +2139,12 @@ lexer_convert_literal_to_chars (parser_context_t *context_p, /**< context */
uint8_t str_end_character = source_p[-1];
-#if JERRY_ESNEXT
if (str_end_character == LIT_CHAR_RIGHT_BRACE)
{
str_end_character = LIT_CHAR_GRAVE_ACCENT;
}
bool is_raw = (opts & LEXER_STRING_RAW) != 0;
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (opts);
- bool is_raw = false;
-#endif /* JERRY_ESNEXT */
while (true)
{
@@ -2399,7 +2275,6 @@ lexer_convert_literal_to_chars (parser_context_t *context_p, /**< context */
continue;
}
}
-#if JERRY_ESNEXT
else if (str_end_character == LIT_CHAR_GRAVE_ACCENT)
{
if (source_p[0] == LIT_CHAR_DOLLAR_SIGN && source_p[1] == LIT_CHAR_LEFT_BRACE)
@@ -2429,7 +2304,6 @@ lexer_convert_literal_to_chars (parser_context_t *context_p, /**< context */
}
}
}
-#endif /* JERRY_ESNEXT */
if (*source_p >= LIT_UTF8_4_BYTE_MARKER)
{
@@ -2619,11 +2493,7 @@ lexer_construct_number_object (parser_context_t *context_p, /**< context */
{
#endif /* JERRY_BUILTIN_BIGINT */
ecma_number_t num;
- uint32_t options = 0;
-
-#if JERRY_ESNEXT
- options |= ECMA_CONVERSION_ALLOW_UNDERSCORE;
-#endif /* JERRY_ESNEXT */
+ uint32_t options = ECMA_CONVERSION_ALLOW_UNDERSCORE;
if (context_p->token.extra_value == LEXER_NUMBER_OCTAL)
{
@@ -2820,7 +2690,6 @@ lexer_construct_function_object (parser_context_t *context_p, /**< context */
parser_flush_cbc (context_p);
-#if JERRY_ESNEXT
if (JERRY_LIKELY (!(extra_status_flags & PARSER_IS_ARROW_FUNCTION)))
{
compiled_code_p = parser_parse_function (context_p, extra_status_flags);
@@ -2829,9 +2698,6 @@ lexer_construct_function_object (parser_context_t *context_p, /**< context */
{
compiled_code_p = parser_parse_arrow_function (context_p, extra_status_flags);
}
-#else /* !JERRY_ESNEXT */
- compiled_code_p = parser_parse_function (context_p, extra_status_flags);
-#endif /* JERRY_ESNEXT */
literal_p->u.bytecode_p = compiled_code_p;
literal_p->type = LEXER_FUNCTION_LITERAL;
@@ -2839,7 +2705,6 @@ lexer_construct_function_object (parser_context_t *context_p, /**< context */
return result_index;
} /* lexer_construct_function_object */
-#if JERRY_ESNEXT
/**
* Construct a class static block function literal object.
*
@@ -2864,7 +2729,6 @@ lexer_construct_class_static_block_function (parser_context_t *context_p) /**< c
return result_index;
} /* lexer_construct_class_static_block_function */
-#endif /* JERRY_ESNEXT */
/**
* Construct a regular expression object.
@@ -2987,12 +2851,10 @@ lexer_construct_regexp_object (parser_context_t *context_p, /**< context */
{
flag = RE_FLAG_STICKY;
}
-#if JERRY_ESNEXT
else if (source_p[0] == LIT_CHAR_LOWERCASE_S)
{
flag = RE_FLAG_DOTALL;
}
-#endif /* JERRY_ESNEXT */
if (flag == 0)
{
@@ -3126,8 +2988,6 @@ lexer_expect_identifier (parser_context_t *context_p, /**< context */
return;
}
#endif /* JERRY_MODULE_SYSTEM */
-
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_KEYW_YIELD)
{
parser_raise_error (context_p, PARSER_ERR_YIELD_NOT_ALLOWED);
@@ -3136,7 +2996,6 @@ lexer_expect_identifier (parser_context_t *context_p, /**< context */
{
parser_raise_error (context_p, PARSER_ERR_AWAIT_NOT_ALLOWED);
}
-#endif /* JERRY_ESNEXT */
parser_raise_error (context_p, PARSER_ERR_IDENTIFIER_EXPECTED);
} /* lexer_expect_identifier */
@@ -3175,12 +3034,9 @@ lexer_expect_object_literal_id (parser_context_t *context_p, /**< context */
lexer_skip_spaces (context_p);
context_p->token.flags = (uint8_t) (context_p->token.flags | LEXER_NO_SKIP_SPACES);
- if (context_p->source_p < context_p->source_end_p
-#if JERRY_ESNEXT
- && context_p->source_p[0] != LIT_CHAR_COMMA && context_p->source_p[0] != LIT_CHAR_RIGHT_BRACE
- && context_p->source_p[0] != LIT_CHAR_LEFT_PAREN && context_p->source_p[0] != LIT_CHAR_SEMICOLON
- && context_p->source_p[0] != LIT_CHAR_EQUALS
-#endif /* JERRY_ESNEXT */
+ if (context_p->source_p < context_p->source_end_p && context_p->source_p[0] != LIT_CHAR_COMMA
+ && context_p->source_p[0] != LIT_CHAR_RIGHT_BRACE && context_p->source_p[0] != LIT_CHAR_LEFT_PAREN
+ && context_p->source_p[0] != LIT_CHAR_SEMICOLON && context_p->source_p[0] != LIT_CHAR_EQUALS
&& context_p->source_p[0] != LIT_CHAR_COLON)
{
if (lexer_compare_literal_to_string (context_p, "get", 3))
@@ -3195,7 +3051,6 @@ lexer_expect_object_literal_id (parser_context_t *context_p, /**< context */
return;
}
-#if JERRY_ESNEXT
if (lexer_compare_literal_to_string (context_p, "async", 5))
{
context_p->token.type = LEXER_KEYW_ASYNC;
@@ -3210,18 +3065,15 @@ lexer_expect_object_literal_id (parser_context_t *context_p, /**< context */
}
return;
}
-#endif /* JERRY_ESNEXT */
}
}
create_literal_object = true;
}
-#if JERRY_ESNEXT
else if (ident_opts & LEXER_OBJ_IDENT_CLASS_PRIVATE)
{
parser_raise_error (context_p, PARSER_ERR_INVALID_CHARACTER);
}
-#endif /* JERRY_ESNEXT */
else
{
switch (context_p->source_p[0])
@@ -3233,7 +3085,6 @@ lexer_expect_object_literal_id (parser_context_t *context_p, /**< context */
create_literal_object = true;
break;
}
-#if JERRY_ESNEXT
case LIT_CHAR_LEFT_SQUARE:
{
#if JERRY_FUNCTION_TO_STRING
@@ -3276,7 +3127,6 @@ lexer_expect_object_literal_id (parser_context_t *context_p, /**< context */
break;
}
-#endif /* JERRY_ESNEXT */
case LIT_CHAR_LEFT_BRACE:
{
const uint32_t static_block_flags =
@@ -3302,7 +3152,6 @@ lexer_expect_object_literal_id (parser_context_t *context_p, /**< context */
lexer_consume_next_character (context_p);
return;
}
-#if JERRY_ESNEXT
case LIT_CHAR_DOT:
{
if (!(context_p->source_p + 1 >= context_p->source_end_p || lit_char_is_decimal_digit (context_p->source_p[1])))
@@ -3322,7 +3171,6 @@ lexer_expect_object_literal_id (parser_context_t *context_p, /**< context */
}
/* FALLTHRU */
}
-#endif /* JERRY_ESNEXT */
default:
{
const uint8_t *char_p = context_p->source_p;
@@ -3349,7 +3197,6 @@ lexer_expect_object_literal_id (parser_context_t *context_p, /**< context */
if (create_literal_object)
{
-#if JERRY_ESNEXT
if (ident_opts & LEXER_OBJ_IDENT_CLASS_IDENTIFIER)
{
return;
@@ -3360,7 +3207,6 @@ lexer_expect_object_literal_id (parser_context_t *context_p, /**< context */
parser_resolve_private_identifier (context_p);
return;
}
-#endif /* JERRY_ESNEXT */
lexer_construct_literal_object (context_p, &context_p->token.lit_location, LEXER_STRING_LITERAL);
return;
@@ -3405,12 +3251,9 @@ lexer_check_property_modifier (parser_context_t *context_p) /**< context */
lexer_skip_spaces (context_p);
context_p->token.flags = (uint8_t) (context_p->token.flags | LEXER_NO_SKIP_SPACES);
- if (context_p->source_p >= context_p->source_end_p
-#if JERRY_ESNEXT
- || context_p->source_p[0] == LIT_CHAR_COMMA || context_p->source_p[0] == LIT_CHAR_RIGHT_BRACE
- || context_p->source_p[0] == LIT_CHAR_LEFT_PAREN || context_p->source_p[0] == LIT_CHAR_EQUALS
-#endif /* JERRY_ESNEXT */
- || context_p->source_p[0] == LIT_CHAR_COLON)
+ if (context_p->source_p >= context_p->source_end_p || context_p->source_p[0] == LIT_CHAR_COMMA
+ || context_p->source_p[0] == LIT_CHAR_RIGHT_BRACE || context_p->source_p[0] == LIT_CHAR_LEFT_PAREN
+ || context_p->source_p[0] == LIT_CHAR_EQUALS || context_p->source_p[0] == LIT_CHAR_COLON)
{
return;
}
@@ -3427,13 +3270,11 @@ lexer_check_property_modifier (parser_context_t *context_p) /**< context */
return;
}
-#if JERRY_ESNEXT
if (lexer_compare_literal_to_string (context_p, "async", 5))
{
context_p->token.type = LEXER_KEYW_ASYNC;
return;
}
-#endif /* JERRY_ESNEXT */
} /* lexer_check_property_modifier */
/**
@@ -3632,8 +3473,6 @@ lexer_string_is_directive (parser_context_t *context_p) /**< context */
&& context_p->token.type != LEXER_DOT));
} /* lexer_string_is_directive */
-#if JERRY_ESNEXT
-
/**
* Compares the current token to an expected identifier.
*
@@ -3687,8 +3526,6 @@ lexer_token_is_async (parser_context_t *context_p) /**< context */
&& !(context_p->token.lit_location.status_flags & LEXER_LIT_LOCATION_HAS_ESCAPE));
} /* lexer_token_is_async */
-#endif /* JERRY_ESNEXT */
-
/**
* Compares the current identifier or string to an expected string.
*
@@ -3749,17 +3586,10 @@ lexer_convert_binary_lvalue_token_to_binary (uint8_t token) /**< binary lvalue t
JERRY_ASSERT (LEXER_IS_BINARY_LVALUE_OP_TOKEN (token));
JERRY_ASSERT (token != LEXER_ASSIGN);
-#if JERRY_ESNEXT
if (token <= LEXER_ASSIGN_EXPONENTIATION)
{
return (uint8_t) (LEXER_ADD + (token - LEXER_ASSIGN_ADD));
}
-#else /* !JERRY_ESNEXT */
- if (token <= LEXER_ASSIGN_MODULO)
- {
- return (uint8_t) (LEXER_ADD + (token - LEXER_ASSIGN_ADD));
- }
-#endif /* JERRY_ESNEXT */
if (token <= LEXER_ASSIGN_UNS_RIGHT_SHIFT)
{
diff --git a/jerry-core/parser/js/js-lexer.h b/jerry-core/parser/js/js-lexer.h
index 8d06baab..97e25d3d 100644
--- a/jerry-core/parser/js/js-lexer.h
+++ b/jerry-core/parser/js/js-lexer.h
@@ -55,10 +55,8 @@ typedef enum
LEXER_LIT_TRUE, /**< true (not a keyword!) */
LEXER_LIT_FALSE, /**< false (not a keyword!) */
LEXER_LIT_NULL, /**< null (not a keyword!) */
-#if JERRY_ESNEXT
LEXER_TEMPLATE_LITERAL, /**< multi segment template literal */
LEXER_THREE_DOTS, /**< ... (rest or spread operator) */
-#endif /* JERRY_ESNEXT */
/* Unary operators
* IMPORTANT: update CBC_UNARY_OP_TOKEN_TO_OPCODE and
@@ -72,9 +70,7 @@ typedef enum
LEXER_BIT_NOT, /**< "~" */
LEXER_KEYW_VOID, /**< void */
LEXER_KEYW_TYPEOF, /**< typeof */
-#if JERRY_ESNEXT
LEXER_KEYW_AWAIT, /**< await */
-#endif /* JERRY_ESNEXT */
LEXER_KEYW_DELETE, /**< delete */
LEXER_INCREASE, /**< "++" */
LEXER_DECREASE, /**< "--" */
@@ -87,17 +83,11 @@ typedef enum
* Index of first binary operation opcode.
*/
#define LEXER_FIRST_BINARY_OP LEXER_ASSIGN
-#if JERRY_ESNEXT
+
/**
* Index of last binary operation opcode.
*/
#define LEXER_LAST_BINARY_OP LEXER_EXPONENTIATION
-#else /* !JERRY_ESNEXT */
-/**
- * Index of last binary operation opcode.
- */
-#define LEXER_LAST_BINARY_OP LEXER_MODULO
-#endif /* JERRY_ESNEXT */
/**
* Checks whether the token is a binary operation token.
@@ -121,12 +111,10 @@ typedef enum
LEXER_ASSIGN_MULTIPLY, /**< "*=" (prec: 3) */
LEXER_ASSIGN_DIVIDE, /**< "/=" (prec: 3) */
LEXER_ASSIGN_MODULO, /**< "%=" (prec: 3) */
-#if JERRY_ESNEXT
LEXER_ASSIGN_EXPONENTIATION, /**< "**=" (prec: 3) */
LEXER_ASSIGN_NULLISH_COALESCING, /**< "??=" (prec: 3) */
LEXER_ASSIGN_LOGICAL_OR, /**< "||=" (prec: 3) */
LEXER_ASSIGN_LOGICAL_AND, /**< "&&=" (prec: 3) */
-#endif /* JERRY_ESNEXT */
LEXER_ASSIGN_LEFT_SHIFT, /**< "<<=" (prec: 3) */
LEXER_ASSIGN_RIGHT_SHIFT, /**< ">>=" (prec: 3) */
LEXER_ASSIGN_UNS_RIGHT_SHIFT, /**< ">>>=" (prec: 3) */
@@ -134,9 +122,7 @@ typedef enum
LEXER_ASSIGN_BIT_OR, /**< "|=" (prec: 3) */
LEXER_ASSIGN_BIT_XOR, /**< "^=" (prec: 3) */
LEXER_QUESTION_MARK, /**< "?" (prec: 4) */
-#if JERRY_ESNEXT
LEXER_NULLISH_COALESCING, /**< "??" (prec: 5) */
-#endif /* JERRY_ESNEXT */
LEXER_LOGICAL_OR, /**< "||" (prec: 6) */
LEXER_LOGICAL_AND, /**< "&&" (prec: 7) */
LEXER_BIT_OR, /**< "|" (prec: 8) */
@@ -160,10 +146,7 @@ typedef enum
LEXER_MULTIPLY, /**< "*" (prec: 15) */
LEXER_DIVIDE, /**< "/" (prec: 15) */
LEXER_MODULO, /**< "%" (prec: 15) */
-#if JERRY_ESNEXT
LEXER_EXPONENTIATION, /**< "**" (prec: 16) */
-#endif /* JERRY_ESNEXT */
-
LEXER_LEFT_BRACE, /**< "{" */
LEXER_LEFT_PAREN, /**< "(" */
LEXER_LEFT_SQUARE, /**< "[" */
@@ -174,10 +157,8 @@ typedef enum
LEXER_SEMICOLON, /**< ";" */
LEXER_COLON, /**< ":" */
LEXER_COMMA, /**< "," */
-#if JERRY_ESNEXT
LEXER_ARROW, /**< "=>" */
LEXER_HASHMARK, /**< "#" */
-#endif /* JERRY_ESNEXT */
LEXER_KEYW_BREAK, /**< break */
LEXER_KEYW_DO, /**< do */
@@ -215,18 +196,14 @@ typedef enum
LEXER_PROPERTY_GETTER, /**< property getter function */
LEXER_PROPERTY_SETTER, /**< property setter function */
LEXER_COMMA_SEP_LIST, /**< comma separated bracketed expression list */
-#if JERRY_ESNEXT
LEXER_ASSIGN_GROUP_EXPR, /**< indetifier for the assignment is located in a group expression */
LEXER_ASSIGN_CONST, /**< a const binding is reassigned */
LEXER_INVALID_PATTERN, /**< special value for invalid destructuring pattern */
LEXER_PRIVATE_PRIMARY_EXPR, /**< private field in primary expession position */
LEXER_ASSIGN_REFERENCE, /**< special value for reference assignment */
-#endif /* JERRY_ESNEXT */
-/* Keywords which are not keyword tokens. */
-#if JERRY_ESNEXT
+ /* Keywords which are not keyword tokens. */
LEXER_KEYW_ASYNC, /**< async */
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
LEXER_KEYW_META, /**< meta */
#endif /* JERRY_MODULE_SYSTEM */
diff --git a/jerry-core/parser/js/js-parser-expr.c b/jerry-core/parser/js/js-parser-expr.c
index 67b69d2c..d079d762 100644
--- a/jerry-core/parser/js/js-parser-expr.c
+++ b/jerry-core/parser/js/js-parser-expr.c
@@ -71,16 +71,12 @@ static const uint8_t parser_binary_precedence_table[] = {
3, /**< "&=" */
3, /**< "|=" */
3, /**< "^=" */
-#if JERRY_ESNEXT
3, /**< "**=" */
3, /**< "??=" */
3, /**< "||=" */
3, /**< "&&=" */
-#endif /* JERRY_ESNEXT */
4, /**< "?"*/
-#if JERRY_ESNEXT
5, /**< "??" */
-#endif /* JERRY_ESNEXT */
6, /**< "||" */
7, /**< "&&" */
8, /**< "|" */
@@ -104,18 +100,11 @@ static const uint8_t parser_binary_precedence_table[] = {
15, /**< "*" */
15, /**< "/" */
15, /**< "%" */
-#if JERRY_ESNEXT
16, /**< "**" */
-#endif /* JERRY_ESNEXT */
};
-#if JERRY_ESNEXT
JERRY_STATIC_ASSERT (sizeof (parser_binary_precedence_table) == 42,
parser_binary_precedence_table_should_have_39_values_in_es2015);
-#else /* !JERRY_ESNEXT */
-JERRY_STATIC_ASSERT (sizeof (parser_binary_precedence_table) == 36,
- parser_binary_precedence_table_should_have_36_values_in_es51);
-#endif /* JERRY_ESNEXT */
/**
* Generate byte code for operators with lvalue.
@@ -168,8 +157,6 @@ parser_check_invalid_assign (parser_context_t *context_p) /**< context */
}
} /* parser_check_invalid_assign */
-#if JERRY_ESNEXT
-
/**
* Check and throw an error if the "new.target" is invalid as a left-hand side expression.
*/
@@ -191,8 +178,6 @@ parser_check_invalid_new_target (parser_context_t *context_p, /**< parser contex
}
} /* parser_check_invalid_new_target */
-#endif /* JERRY_ESNEXT */
-
/**
* Emit identifier reference
*/
@@ -259,7 +244,6 @@ parser_emit_unary_lvalue_opcode (parser_context_t *context_p, /**< context */
parser_emit_ident_reference (context_p, unary_opcode);
-#if JERRY_ESNEXT
if (unary_opcode != CBC_DELETE_IDENT_PUSH_RESULT
&& scanner_literal_is_const_reg (context_p, context_p->last_cbc.literal_index))
{
@@ -267,7 +251,6 @@ parser_emit_unary_lvalue_opcode (parser_context_t *context_p, /**< context */
context_p->last_cbc_opcode = CBC_PUSH_LITERAL;
parser_emit_cbc_ext (context_p, CBC_EXT_THROW_ASSIGN_CONST_ERROR);
}
-#endif /* JERRY_ESNEXT */
return;
}
@@ -287,7 +270,6 @@ parser_emit_unary_lvalue_opcode (parser_context_t *context_p, /**< context */
/* Invalid LeftHandSide expression. */
if (opcode == CBC_DELETE_PUSH_RESULT)
{
-#if JERRY_ESNEXT
if (context_p->last_cbc_opcode == PARSER_TO_EXT_OPCODE (CBC_EXT_PUSH_PRIVATE_PROP_LITERAL))
{
parser_raise_error (context_p, PARSER_ERR_DELETE_PRIVATE_FIELD);
@@ -300,13 +282,12 @@ parser_emit_unary_lvalue_opcode (parser_context_t *context_p, /**< context */
parser_emit_cbc (context_p, CBC_POP);
return;
}
-#endif /* JERRY_ESNEXT */
+
parser_emit_cbc (context_p, CBC_POP);
parser_emit_cbc (context_p, CBC_PUSH_TRUE);
return;
}
-#if JERRY_ESNEXT
parser_check_invalid_new_target (context_p, opcode);
if (opcode == CBC_PRE_INCR || opcode == CBC_PRE_DECR)
{
@@ -316,9 +297,6 @@ parser_emit_unary_lvalue_opcode (parser_context_t *context_p, /**< context */
{
parser_raise_error (context_p, PARSER_ERR_INVALID_LHS_POSTFIX_OP);
}
-#else /* JERRY_ESNEXT */
- parser_emit_cbc_ext (context_p, CBC_EXT_THROW_REFERENCE_ERROR);
-#endif /* JERRY_ESNEXT */
}
parser_emit_cbc (context_p, (uint16_t) opcode);
@@ -358,7 +336,6 @@ parser_parse_array_literal (parser_context_t *context_p) /**< context */
}
else
{
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_THREE_DOTS)
{
opcode = (uint16_t) (PARSER_TO_EXT_OPCODE (CBC_EXT_SPREAD_ARRAY_APPEND));
@@ -366,7 +343,6 @@ parser_parse_array_literal (parser_context_t *context_p) /**< context */
lexer_next_token (context_p);
parser_emit_cbc_ext (context_p, CBC_EXT_PUSH_SPREAD_ELEMENT);
}
-#endif /* JERRY_ESNEXT */
parser_parse_expression (context_p, PARSE_EXPR_NO_COMMA);
@@ -388,111 +364,12 @@ parser_parse_array_literal (parser_context_t *context_p) /**< context */
if (pushed_items >= 64)
{
parser_emit_cbc_call (context_p, opcode, pushed_items);
-#if JERRY_ESNEXT
opcode = (uint16_t) CBC_ARRAY_APPEND;
-#endif /* JERRY_ESNEXT */
pushed_items = 0;
}
}
} /* parser_parse_array_literal */
-#if !JERRY_ESNEXT
-/**
- * Object literal item types.
- */
-typedef enum
-{
- PARSER_OBJECT_PROPERTY_START, /**< marks the start of the property list */
- PARSER_OBJECT_PROPERTY_VALUE, /**< value property */
- PARSER_OBJECT_PROPERTY_GETTER, /**< getter property */
- PARSER_OBJECT_PROPERTY_SETTER, /**< setter property */
- PARSER_OBJECT_PROPERTY_BOTH_ACCESSORS, /**< both getter and setter properties are set */
-} parser_object_literal_item_types_t;
-
-/**
- * Parse object literal.
- */
-static void
-parser_append_object_literal_item (parser_context_t *context_p, /**< context */
- uint16_t item_index, /**< index of the item name */
- parser_object_literal_item_types_t item_type) /**< type of the item */
-{
- parser_stack_iterator_t iterator;
- uint8_t *current_item_type_p;
-
- iterator.current_p = context_p->stack.first_p;
- iterator.current_position = context_p->stack.last_position;
-
- while (true)
- {
- current_item_type_p = iterator.current_p->bytes + iterator.current_position - 1;
-
- if (*current_item_type_p == PARSER_OBJECT_PROPERTY_START)
- {
- parser_stack_push_uint16 (context_p, item_index);
- parser_stack_push_uint8 (context_p, (uint8_t) item_type);
- return;
- }
-
- iterator.current_position--;
- if (iterator.current_position == 0)
- {
- iterator.current_p = iterator.current_p->next_p;
- iterator.current_position = PARSER_STACK_PAGE_SIZE;
- }
-
- uint32_t current_item_index = iterator.current_p->bytes[iterator.current_position - 1];
-
- iterator.current_position--;
- if (iterator.current_position == 0)
- {
- iterator.current_p = iterator.current_p->next_p;
- iterator.current_position = PARSER_STACK_PAGE_SIZE;
- }
-
- current_item_index |= ((uint32_t) iterator.current_p->bytes[iterator.current_position - 1]) << 8;
-
- iterator.current_position--;
- if (iterator.current_position == 0)
- {
- iterator.current_p = iterator.current_p->next_p;
- iterator.current_position = PARSER_STACK_PAGE_SIZE;
- }
-
- if (current_item_index == item_index)
- {
- if (item_type == PARSER_OBJECT_PROPERTY_VALUE && *current_item_type_p == PARSER_OBJECT_PROPERTY_VALUE
- && !(context_p->status_flags & PARSER_IS_STRICT))
- {
- return;
- }
-
- if (item_type == PARSER_OBJECT_PROPERTY_GETTER && *current_item_type_p == PARSER_OBJECT_PROPERTY_SETTER)
- {
- break;
- }
-
- if (item_type == PARSER_OBJECT_PROPERTY_SETTER && *current_item_type_p == PARSER_OBJECT_PROPERTY_GETTER)
- {
- break;
- }
-
- parser_raise_error (context_p, PARSER_ERR_OBJECT_PROPERTY_REDEFINED);
- }
- }
-
- uint8_t *last_page_p = context_p->stack.first_p->bytes;
-
- *current_item_type_p = PARSER_OBJECT_PROPERTY_BOTH_ACCESSORS;
-
- if (current_item_type_p == (last_page_p + context_p->stack.last_position - 1))
- {
- context_p->stack_top_uint8 = PARSER_OBJECT_PROPERTY_BOTH_ACCESSORS;
- }
-} /* parser_append_object_literal_item */
-#endif /* !JERRY_ESNEXT */
-
-#if JERRY_ESNEXT
/** Forward definition of parse array initializer. */
static void parser_parse_array_initializer (parser_context_t *context_p, parser_pattern_flags_t flags);
@@ -1271,9 +1148,7 @@ parser_parse_class (parser_context_t *context_p, /**< context */
lexer_next_token (context_p);
} /* parser_parse_class */
-#endif /* JERRY_ESNEXT */
-#if JERRY_ESNEXT
/**
* Parse object initializer method definition.
*
@@ -1326,7 +1201,6 @@ parser_reparse_as_common_identifier (parser_context_t *context_p, /**< context *
lexer_construct_literal_object (context_p, &context_p->token.lit_location, LEXER_IDENT_LITERAL);
} /* parser_reparse_as_common_identifier */
-#endif /* JERRY_ESNEXT */
/**
* Parse object literal.
@@ -1338,11 +1212,6 @@ parser_parse_object_literal (parser_context_t *context_p) /**< context */
parser_emit_cbc (context_p, CBC_CREATE_OBJECT);
-#if !JERRY_ESNEXT
- parser_stack_push_uint8 (context_p, PARSER_OBJECT_PROPERTY_START);
-#endif /* !JERRY_ESNEXT */
-
-#if JERRY_ESNEXT
bool proto_seen = false;
bool has_super_env = false;
@@ -1358,7 +1227,6 @@ parser_parse_object_literal (parser_context_t *context_p) /**< context */
scanner_release_next (context_p, sizeof (scanner_info_t));
}
-#endif /* JERRY_ESNEXT */
while (true)
{
@@ -1375,62 +1243,44 @@ parser_parse_object_literal (parser_context_t *context_p) /**< context */
{
uint32_t status_flags;
cbc_ext_opcode_t opcode;
-#if !JERRY_ESNEXT
- parser_object_literal_item_types_t item_type;
-#endif /* !JERRY_ESNEXT */
bool is_getter = context_p->token.type == LEXER_PROPERTY_GETTER;
if (is_getter)
{
status_flags = PARSER_FUNCTION_CLOSURE | PARSER_IS_PROPERTY_GETTER;
opcode = CBC_EXT_SET_GETTER;
-#if !JERRY_ESNEXT
- item_type = PARSER_OBJECT_PROPERTY_GETTER;
-#endif /* !JERRY_ESNEXT */
}
else
{
status_flags = PARSER_FUNCTION_CLOSURE | PARSER_IS_PROPERTY_SETTER;
opcode = CBC_EXT_SET_SETTER;
-#if !JERRY_ESNEXT
- item_type = PARSER_OBJECT_PROPERTY_SETTER;
-#endif /* !JERRY_ESNEXT */
}
-#if JERRY_ESNEXT
status_flags |= PARSER_ALLOW_SUPER;
-#endif /* !JERRY_ESNEXT */
lexer_expect_object_literal_id (context_p, LEXER_OBJ_IDENT_ONLY_IDENTIFIERS);
/* This assignment is a nop for computed getters/setters. */
uint16_t literal_index = context_p->lit_object.index;
-#if JERRY_ESNEXT
bool is_computed = context_p->token.type == LEXER_RIGHT_SQUARE;
if (is_computed)
{
opcode = ((opcode == CBC_EXT_SET_GETTER) ? CBC_EXT_SET_COMPUTED_GETTER : CBC_EXT_SET_COMPUTED_SETTER);
}
-#else /* !JERRY_ESNEXT */
- parser_append_object_literal_item (context_p, literal_index, item_type);
-#endif /* JERRY_ESNEXT */
uint16_t function_literal_index = lexer_construct_function_object (context_p, status_flags);
-#if JERRY_ESNEXT
if (opcode >= CBC_EXT_SET_COMPUTED_GETTER)
{
literal_index = function_literal_index;
}
-#endif /* JERRY_ESNEXT */
parser_emit_cbc_literal (context_p, CBC_PUSH_LITERAL, literal_index);
JERRY_ASSERT (context_p->last_cbc_opcode == CBC_PUSH_LITERAL);
-#if JERRY_ESNEXT
if (is_computed)
{
parser_emit_cbc_ext (context_p,
@@ -1455,7 +1305,6 @@ parser_parse_object_literal (parser_context_t *context_p) /**< context */
parser_emit_cbc_ext (context_p, is_getter ? CBC_EXT_SET_COMPUTED_GETTER : CBC_EXT_SET_COMPUTED_SETTER);
}
else
-#endif /* JERRY_ESNEXT */
{
context_p->last_cbc_opcode = PARSER_TO_EXT_OPCODE (opcode);
context_p->last_cbc.value = function_literal_index;
@@ -1464,7 +1313,6 @@ parser_parse_object_literal (parser_context_t *context_p) /**< context */
lexer_next_token (context_p);
break;
}
-#if JERRY_ESNEXT
case LEXER_RIGHT_SQUARE:
{
lexer_next_token (context_p);
@@ -1588,10 +1436,8 @@ parser_parse_object_literal (parser_context_t *context_p) /**< context */
lexer_next_token (context_p);
break;
}
-#endif /* JERRY_ESNEXT */
default:
{
-#if JERRY_ESNEXT
const lexer_lit_location_t *literal_p = (const lexer_lit_location_t *) context_p->lit_object.literal_p;
bool is_proto = ((context_p->token.lit_location.type == LEXER_IDENT_LITERAL
|| context_p->token.lit_location.type == LEXER_STRING_LITERAL)
@@ -1606,20 +1452,13 @@ parser_parse_object_literal (parser_context_t *context_p) /**< context */
proto_seen = true;
}
-#endif /* JERRY_ESNEXT */
uint16_t literal_index = context_p->lit_object.index;
-
-#if JERRY_ESNEXT
parser_line_counter_t start_line = context_p->token.line;
parser_line_counter_t start_column = context_p->token.column;
-#else /* !JERRY_ESNEXT */
- parser_append_object_literal_item (context_p, literal_index, PARSER_OBJECT_PROPERTY_VALUE);
-#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_LEFT_PAREN && !is_proto)
{
parser_parse_object_method (context_p);
@@ -1650,7 +1489,6 @@ parser_parse_object_literal (parser_context_t *context_p) /**< context */
lexer_next_token (context_p);
break;
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type != LEXER_COLON)
{
@@ -1660,34 +1498,29 @@ parser_parse_object_literal (parser_context_t *context_p) /**< context */
lexer_next_token (context_p);
parser_parse_expression (context_p, PARSE_EXPR_NO_COMMA);
-#if JERRY_ESNEXT
if (is_proto)
{
parser_emit_cbc_ext (context_p, CBC_EXT_SET__PROTO__);
break;
}
-#endif /* JERRY_ESNEXT */
if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
{
-#if JERRY_ESNEXT
if (context_p->last_cbc.literal_type == LEXER_FUNCTION_LITERAL)
{
parser_set_function_name (context_p, context_p->last_cbc.literal_index, literal_index, 0);
}
-#endif /* JERRY_ESNEXT */
context_p->last_cbc_opcode = CBC_SET_LITERAL_PROPERTY;
context_p->last_cbc.value = literal_index;
}
else
{
-#if JERRY_ESNEXT
if (context_p->last_cbc_opcode == PARSER_TO_EXT_OPCODE (CBC_EXT_FINALIZE_ANONYMOUS_CLASS))
{
uint16_t name_index = scanner_save_literal (context_p, literal_index);
parser_emit_cbc_ext_literal (context_p, CBC_EXT_SET_CLASS_NAME, name_index);
}
-#endif /* JERRY_ESNEXT */
+
parser_emit_cbc_literal (context_p, CBC_SET_PROPERTY, literal_index);
}
@@ -1705,19 +1538,10 @@ parser_parse_object_literal (parser_context_t *context_p) /**< context */
}
}
-#if !JERRY_ESNEXT
- while (context_p->stack_top_uint8 != PARSER_OBJECT_PROPERTY_START)
- {
- parser_stack_pop (context_p, NULL, 3);
- }
-
- parser_stack_pop_uint8 (context_p);
-#else /* JERRY_ESNEXT */
if (has_super_env)
{
parser_emit_cbc_ext (context_p, CBC_EXT_POP_OBJECT_SUPER_ENVIRONMENT);
}
-#endif /* !JERRY_ESNEXT */
} /* parser_parse_object_literal */
/**
@@ -1733,21 +1557,12 @@ parser_parse_function_expression (parser_context_t *context_p, /**< context */
uint16_t function_literal_index;
int32_t function_name_index = -1;
-#if !JERRY_ESNEXT
- JERRY_ASSERT (status_flags & PARSER_IS_FUNC_EXPRESSION);
-#endif /* !JERRY_ESNEXT */
-
-#if JERRY_ESNEXT
if (status_flags & PARSER_IS_FUNC_EXPRESSION)
{
-#endif /* !JERRY_ESNEXT */
-
#if JERRY_DEBUGGER
parser_line_counter_t debugger_line = context_p->token.line;
parser_line_counter_t debugger_column = context_p->token.column;
#endif /* JERRY_DEBUGGER */
-
-#if JERRY_ESNEXT
uint32_t parent_status_flags = context_p->status_flags;
context_p->status_flags &=
@@ -1765,20 +1580,15 @@ parser_parse_function_expression (parser_context_t *context_p, /**< context */
context_p->status_flags |= PARSER_IS_GENERATOR_FUNCTION | PARSER_DISALLOW_AWAIT_YIELD;
status_flags |= PARSER_IS_GENERATOR_FUNCTION | PARSER_DISALLOW_AWAIT_YIELD;
}
-#endif /* JERRY_ESNEXT */
if (!lexer_check_next_character (context_p, LIT_CHAR_LEFT_PAREN))
{
-#if JERRY_ESNEXT
/* The `await` keyword is interpreted as an IdentifierReference within function expressions */
context_p->status_flags &= (uint32_t) ~PARSER_IS_CLASS_STATIC_BLOCK;
-#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
-#if JERRY_ESNEXT
context_p->status_flags |= parent_status_flags & PARSER_IS_CLASS_STATIC_BLOCK;
-#endif /* JERRY_ESNEXT */
if (context_p->token.type != LEXER_LITERAL || context_p->token.lit_location.type != LEXER_IDENT_LITERAL)
{
@@ -1802,7 +1612,6 @@ parser_parse_function_expression (parser_context_t *context_p, /**< context */
context_p->token.column = debugger_column;
}
#endif /* JERRY_DEBUGGER */
-
if (context_p->token.keyword_type >= LEXER_FIRST_NON_STRICT_ARGUMENTS)
{
status_flags |= PARSER_HAS_NON_STRICT_ARG;
@@ -1811,10 +1620,8 @@ parser_parse_function_expression (parser_context_t *context_p, /**< context */
function_name_index = context_p->lit_object.index;
}
-#if JERRY_ESNEXT
context_p->status_flags = parent_status_flags;
}
-#endif /* JERRY_ESNEXT */
if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
{
@@ -1834,12 +1641,10 @@ parser_parse_function_expression (parser_context_t *context_p, /**< context */
JERRY_ASSERT (context_p->last_cbc_opcode == PARSER_CBC_UNAVAILABLE);
-#if JERRY_ESNEXT
if (function_name_index != -1)
{
parser_set_function_name (context_p, function_literal_index, (uint16_t) function_name_index, 0);
}
-#endif /* JERRY_ESNEXT */
if (literals == 1)
{
@@ -1869,8 +1674,6 @@ parser_parse_function_expression (parser_context_t *context_p, /**< context */
context_p->last_cbc.literal_keyword_type = LEXER_EOS;
} /* parser_parse_function_expression */
-#if JERRY_ESNEXT
-
/**
* Parse template literal.
*/
@@ -2065,8 +1868,6 @@ parser_abort_parsing_after_assignment_expression (parser_context_t *context_p)
return (context_p->token.type != LEXER_RIGHT_PAREN && context_p->token.type != LEXER_COMMA);
} /* parser_abort_parsing_after_assignment_expression */
-#endif /* JERRY_ESNEXT */
-
/**
* Parse and record unary operators, and parse the primary literal.
*
@@ -2094,7 +1895,6 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
context_p->token.type = LEXER_NEGATE;
break;
}
-#if JERRY_ESNEXT
case LEXER_KEYW_AWAIT:
{
#if JERRY_MODULE_SYSTEM
@@ -2111,7 +1911,6 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
}
break;
}
-#endif /* JERRY_ESNEXT */
}
/* Bracketed expressions are primary expressions. At this
@@ -2119,13 +1918,11 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
* they are processed when their closing paren is reached. */
if (context_p->token.type == LEXER_LEFT_PAREN)
{
-#if JERRY_ESNEXT
if (context_p->next_scanner_info_p->source_p == context_p->source_p)
{
JERRY_ASSERT (context_p->next_scanner_info_p->type == SCANNER_TYPE_FUNCTION);
break;
}
-#endif /* JERRY_ESNEXT */
(*grouping_level_p) += PARSER_GROUPING_LEVEL_INCREASE;
new_was_seen = false;
}
@@ -2134,7 +1931,6 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
/* After 'new' unary operators are not allowed. */
new_was_seen = true;
-#if JERRY_ESNEXT
/* Check if "new.target" is written here. */
if (scanner_try_scan_new_target (context_p))
{
@@ -2148,7 +1944,6 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
/* Found "new.target" return here */
return false;
}
-#endif /* JERRY_ESNEXT */
}
else if (new_was_seen || (*grouping_level_p == PARSE_EXPR_LEFT_HAND_SIDE)
|| !LEXER_IS_UNARY_OP_TOKEN (context_p->token.type))
@@ -2163,7 +1958,6 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
/* Parse primary expression. */
switch (context_p->token.type)
{
-#if JERRY_ESNEXT
case LEXER_HASHMARK:
{
if (!lexer_scan_private_identifier (context_p))
@@ -2195,10 +1989,8 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
/* The string is a normal string literal. */
/* FALLTHRU */
}
-#endif /* JERRY_ESNEXT */
case LEXER_LITERAL:
{
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (context_p->next_scanner_info_p->source_p == context_p->source_p))
{
JERRY_ASSERT (context_p->next_scanner_info_p->type == SCANNER_TYPE_FUNCTION);
@@ -2238,7 +2030,6 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
parser_parse_function_expression (context_p, arrow_status_flags);
return parser_abort_parsing_after_assignment_expression (context_p);
}
-#endif /* JERRY_ESNEXT */
uint8_t type = context_p->token.lit_location.type;
@@ -2320,7 +2111,6 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
}
case LEXER_LEFT_BRACE:
{
-#if JERRY_ESNEXT
if (context_p->next_scanner_info_p->source_p == context_p->source_p
&& context_p->next_scanner_info_p->type == SCANNER_TYPE_INITIALIZER)
{
@@ -2339,14 +2129,12 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
scanner_release_next (context_p, sizeof (scanner_location_info_t));
}
-#endif /* JERRY_ESNEXT */
parser_parse_object_literal (context_p);
break;
}
case LEXER_LEFT_SQUARE:
{
-#if JERRY_ESNEXT
if (context_p->next_scanner_info_p->source_p == context_p->source_p)
{
if (context_p->next_scanner_info_p->type == SCANNER_TYPE_INITIALIZER)
@@ -2367,7 +2155,6 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
scanner_release_next (context_p, sizeof (scanner_info_t));
}
}
-#endif /* JERRY_ESNEXT */
parser_parse_array_literal (context_p);
break;
@@ -2399,18 +2186,15 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
}
case LEXER_KEYW_THIS:
{
-#if JERRY_ESNEXT
if (context_p->status_flags & PARSER_ALLOW_SUPER_CALL)
{
parser_emit_cbc_ext (context_p, CBC_EXT_RESOLVE_LEXICAL_THIS);
}
else
{
-#endif /* JERRY_ESNEXT */
parser_emit_cbc (context_p, CBC_PUSH_THIS);
-#if JERRY_ESNEXT
}
-#endif /* JERRY_ESNEXT */
+
break;
}
case LEXER_LIT_TRUE:
@@ -2428,7 +2212,6 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
parser_emit_cbc (context_p, CBC_PUSH_NULL);
break;
}
-#if JERRY_ESNEXT
case LEXER_KEYW_CLASS:
{
parser_parse_class (context_p, false);
@@ -2506,7 +2289,6 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
return (context_p->token.type != LEXER_RIGHT_PAREN && context_p->token.type != LEXER_COMMA);
}
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
case LEXER_KEYW_IMPORT:
{
@@ -2588,7 +2370,6 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
{
parser_push_result (context_p);
-#if JERRY_ESNEXT
if (lexer_check_next_character (context_p, LIT_CHAR_HASHMARK))
{
lexer_next_token (context_p);
@@ -2609,7 +2390,7 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
lexer_next_token (context_p);
continue;
}
-#endif /* JERRY_ESNEXT */
+
lexer_expect_identifier (context_p, LEXER_STRING_LITERAL);
JERRY_ASSERT (context_p->token.type == LEXER_LITERAL
@@ -2627,13 +2408,11 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
parser_emit_cbc_literal_from_token (context_p, CBC_PUSH_PROP_THIS_LITERAL);
}
-#if JERRY_ESNEXT
else if (context_p->last_cbc_opcode == PARSER_TO_EXT_OPCODE (CBC_EXT_PUSH_SUPER))
{
context_p->last_cbc_opcode = PARSER_TO_EXT_OPCODE (CBC_EXT_PUSH_SUPER_PROP_LITERAL);
context_p->last_cbc.literal_index = context_p->lit_object.index;
}
-#endif /* JERRY_ESNEXT */
else
{
parser_emit_cbc_literal_from_token (context_p, CBC_PUSH_PROP_LITERAL);
@@ -2646,14 +2425,12 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
{
parser_push_result (context_p);
-#if JERRY_ESNEXT
uint16_t last_cbc_opcode = context_p->last_cbc_opcode;
if (last_cbc_opcode == PARSER_TO_EXT_OPCODE (CBC_EXT_PUSH_SUPER))
{
context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
}
-#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
parser_parse_expression (context_p, PARSE_EXPR);
@@ -2663,13 +2440,11 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
}
lexer_next_token (context_p);
-#if JERRY_ESNEXT
if (last_cbc_opcode == PARSER_TO_EXT_OPCODE (CBC_EXT_PUSH_SUPER))
{
parser_emit_cbc_ext (context_p, CBC_EXT_PUSH_SUPER_PROP);
continue;
}
-#endif /* JERRY_ESNEXT */
if (PARSER_IS_MUTABLE_PUSH_LITERAL (context_p->last_cbc_opcode))
{
@@ -2681,10 +2456,7 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
}
continue;
}
-
-#if JERRY_ESNEXT
case LEXER_TEMPLATE_LITERAL:
-#endif /* JERRY_ESNEXT */
case LEXER_LEFT_PAREN:
{
size_t call_arguments = 0;
@@ -2695,9 +2467,7 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
if (context_p->stack_top_uint8 == LEXER_KEYW_NEW)
{
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_LEFT_PAREN)
-#endif /* JERRY_ESNEXT */
{
parser_stack_pop_uint8 (context_p);
opcode = CBC_NEW;
@@ -2717,7 +2487,6 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
opcode = CBC_CALL_PROP;
context_p->last_cbc_opcode = PARSER_PUSH_PROP_TO_PUSH_PROP_REFERENCE (context_p->last_cbc_opcode);
}
-#if JERRY_ESNEXT
else if (context_p->last_cbc_opcode == PARSER_TO_EXT_OPCODE (CBC_EXT_PUSH_SUPER_CONSTRUCTOR))
{
opcode = PARSER_TO_EXT_OPCODE (CBC_EXT_SUPER_CALL);
@@ -2737,7 +2506,6 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
context_p->last_cbc_opcode = PARSER_TO_EXT_OPCODE (CBC_EXT_PUSH_PRIVATE_PROP_LITERAL_REFERENCE);
opcode = CBC_CALL_PROP;
}
-#endif /* JERRY_ESNEXT */
else if (JERRY_UNLIKELY (context_p->status_flags & PARSER_INSIDE_WITH)
&& PARSER_IS_PUSH_LITERALS_WITH_THIS (context_p->last_cbc_opcode)
&& context_p->last_cbc.literal_type == LEXER_IDENT_LITERAL)
@@ -2748,7 +2516,6 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
}
}
-#if JERRY_ESNEXT
bool has_spread_element = false;
if (context_p->token.type == LEXER_TEMPLATE_LITERAL)
@@ -2790,33 +2557,6 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
break;
}
}
-#else /* !JERRY_ESNEXT */
- lexer_next_token (context_p);
-
- if (context_p->token.type != LEXER_RIGHT_PAREN)
- {
- while (true)
- {
- if (++call_arguments > CBC_MAXIMUM_BYTE_VALUE)
- {
- parser_raise_error (context_p, PARSER_ERR_ARGUMENT_LIMIT_REACHED);
- }
-
- parser_parse_expression (context_p, PARSE_EXPR_NO_COMMA);
-
- if (context_p->token.type != LEXER_COMMA)
- {
- break;
- }
- lexer_next_token (context_p);
- }
-
- if (context_p->token.type != LEXER_RIGHT_PAREN)
- {
- parser_raise_error (context_p, PARSER_ERR_RIGHT_PAREN_EXPECTED);
- }
- }
-#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
@@ -2824,7 +2564,6 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
{
context_p->status_flags |= PARSER_LEXICAL_ENV_NEEDED;
-#if JERRY_ESNEXT
uint16_t eval_flags = PARSER_SAVE_STATUS_FLAGS (context_p->status_flags);
const uint32_t required_flags = PARSER_IS_FUNCTION | PARSER_LEXICAL_BLOCK_NEEDED;
@@ -2845,14 +2584,10 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
}
else
{
-#endif /* JERRY_ESNEXT */
parser_emit_cbc (context_p, CBC_EVAL);
-#if JERRY_ESNEXT
}
-#endif /* JERRY_ESNEXT */
}
-#if JERRY_ESNEXT
if (has_spread_element)
{
uint16_t spread_opcode;
@@ -2879,7 +2614,6 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
parser_emit_cbc_ext_call (context_p, spread_opcode, call_arguments);
continue;
}
-#endif /* JERRY_ESNEXT */
if (call_arguments <= 1)
{
@@ -2945,9 +2679,7 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
break;
}
-#if JERRY_ESNEXT
uint8_t last_unary_token = LEXER_INCREASE;
-#endif /* JERRY_ESNEXT */
/* Generate byte code for the unary operators. */
while (true)
@@ -2955,20 +2687,16 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
uint8_t token = context_p->stack_top_uint8;
if (!LEXER_IS_UNARY_OP_TOKEN (token))
{
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_EXPONENTIATION && last_unary_token != LEXER_INCREASE
&& last_unary_token != LEXER_DECREASE)
{
parser_raise_error (context_p, PARSER_ERR_INVALID_EXPONENTIATION);
}
-#endif /* JERRY_ESNEXT */
+
break;
}
-#if JERRY_ESNEXT
last_unary_token = token;
-#endif /* JERRY_ESNEXT */
-
parser_push_result (context_p);
parser_stack_pop_uint8 (context_p);
@@ -2984,14 +2712,12 @@ parser_process_unary_expression (parser_context_t *context_p, /**< context */
}
parser_emit_unary_lvalue_opcode (context_p, (cbc_opcode_t) token);
}
-#if JERRY_ESNEXT
else if (JERRY_UNLIKELY (token == LEXER_KEYW_AWAIT))
{
cbc_ext_opcode_t opcode =
((context_p->status_flags & PARSER_IS_GENERATOR_FUNCTION) ? CBC_EXT_GENERATOR_AWAIT : CBC_EXT_AWAIT);
parser_emit_cbc_ext (context_p, opcode);
}
-#endif /* JERRY_ESNEXT */
else
{
token = (uint8_t) (LEXER_UNARY_OP_TOKEN_TO_OPCODE (token));
@@ -3082,7 +2808,6 @@ parser_append_binary_single_assignment_token (parser_context_t *context_p, /**<
assign_opcode = CBC_ASSIGN_SET_IDENT;
-#if JERRY_ESNEXT
if (!(pattern_flags & (PARSER_PATTERN_LET | PARSER_PATTERN_CONST | PARSER_PATTERN_LOCAL)))
{
if (scanner_literal_is_const_reg (context_p, literal_index))
@@ -3107,7 +2832,6 @@ parser_append_binary_single_assignment_token (parser_context_t *context_p, /**<
assign_opcode = CBC_INIT_ARG_OR_CATCH;
}
}
-#endif /* JERRY_ESNEXT */
parser_stack_push_uint16 (context_p, literal_index);
JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_LITERAL, assign_opcode));
@@ -3150,7 +2874,6 @@ parser_append_binary_single_assignment_token (parser_context_t *context_p, /**<
context_p->last_cbc_opcode = CBC_PUSH_THIS_LITERAL;
}
}
-#if JERRY_ESNEXT
else if (context_p->last_cbc_opcode == PARSER_TO_EXT_OPCODE (CBC_EXT_PUSH_SUPER_PROP_LITERAL))
{
context_p->last_cbc_opcode = PARSER_TO_EXT_OPCODE (CBC_EXT_SUPER_PROP_LITERAL_ASSIGNMENT_REFERENCE);
@@ -3169,24 +2892,17 @@ parser_append_binary_single_assignment_token (parser_context_t *context_p, /**<
parser_stack_push_uint8 (context_p, CBC_EXT_ASSIGN_PRIVATE);
assign_opcode = CBC_EXT_OPCODE;
}
-#endif /* JERRY_ESNEXT */
else
{
/* Invalid LeftHandSide expression. */ // 3820, 3815
-#if JERRY_ESNEXT
parser_check_invalid_new_target (context_p, CBC_ASSIGN);
parser_raise_error (context_p, PARSER_ERR_INVALID_LHS_ASSIGNMENT);
-#else /* !JERRY_ESNEXT */
- parser_emit_cbc_ext (context_p, CBC_EXT_THROW_REFERENCE_ERROR);
-#endif /* JERRY_ESNEXT */
}
parser_stack_push_uint8 (context_p, assign_opcode);
parser_stack_push_uint8 (context_p, LEXER_ASSIGN);
} /* parser_append_binary_single_assignment_token */
-#if JERRY_ESNEXT
-
/**
* Check for invalid chain of logical operators
*/
@@ -3223,8 +2939,6 @@ parser_check_invalid_logical_op (parser_context_t *context_p, /**< context */
}
} /* parser_check_invalid_logical_op */
-#endif /* JERRY_ESNEXT */
-
/**
* Append a binary lvalue token.
*/
@@ -3240,12 +2954,10 @@ parser_append_binary_lvalue_token (parser_context_t *context_p, /**< context */
parser_emit_ident_reference (context_p, CBC_PUSH_IDENT_REFERENCE);
-#if JERRY_ESNEXT
if (!is_logical_assignment && scanner_literal_is_const_reg (context_p, context_p->last_cbc.literal_index))
{
parser_stack_push_uint8 (context_p, LEXER_ASSIGN_CONST);
}
-#endif /* JERRY_ESNEXT */
}
else if (PARSER_IS_PUSH_PROP (context_p->last_cbc_opcode))
{
@@ -3254,13 +2966,8 @@ parser_append_binary_lvalue_token (parser_context_t *context_p, /**< context */
else
{
/* Invalid LeftHandSide expression. */
-#if JERRY_ESNEXT
parser_check_invalid_new_target (context_p, CBC_ASSIGN);
parser_raise_error (context_p, PARSER_ERR_INVALID_LHS_ASSIGNMENT);
-#else /* !JERRY_ESNEXT */
- parser_emit_cbc_ext (context_p, CBC_EXT_THROW_REFERENCE_ERROR);
-#endif /* JERRY_ESNEXT */
-
parser_emit_cbc (context_p, CBC_PUSH_PROP_REFERENCE);
}
@@ -3277,21 +2984,17 @@ static void
parser_append_logical_token (parser_context_t *context_p, /**< context */
uint16_t opcode) /**< opcode */
{
-#if JERRY_ESNEXT
if (opcode != PARSER_TO_EXT_OPCODE (CBC_EXT_BRANCH_IF_NULLISH))
{
parser_check_invalid_logical_op (context_p, LEXER_NULLISH_COALESCING, LEXER_NULLISH_COALESCING);
}
-#endif /* JERRY_ESNEXT */
parser_branch_t branch;
-
parser_emit_cbc_forward_branch (context_p, opcode, &branch);
parser_stack_push (context_p, &branch, sizeof (parser_branch_t));
parser_stack_push_uint8 (context_p, (uint8_t) context_p->token.type);
} /* parser_append_logical_token */
-#if JERRY_ESNEXT
/**
* Append a logical token.
*/
@@ -3307,7 +3010,6 @@ parser_append_logical_assignment_token (parser_context_t *context_p, /**< contex
parser_append_binary_lvalue_token (context_p, true);
parser_append_logical_token (context_p, opcode);
} /* parser_append_logical_assignment_token */
-#endif /* JERRY_ESNEXT */
/**
* Append a binary token.
@@ -3331,9 +3033,7 @@ parser_append_binary_token (parser_context_t *context_p) /**< context */
case LEXER_ASSIGN_MULTIPLY:
case LEXER_ASSIGN_DIVIDE:
case LEXER_ASSIGN_MODULO:
-#if JERRY_ESNEXT
case LEXER_ASSIGN_EXPONENTIATION:
-#endif /* JERRY_ESNEXT */
case LEXER_ASSIGN_LEFT_SHIFT:
case LEXER_ASSIGN_RIGHT_SHIFT:
case LEXER_ASSIGN_UNS_RIGHT_SHIFT:
@@ -3344,7 +3044,6 @@ parser_append_binary_token (parser_context_t *context_p) /**< context */
parser_append_binary_lvalue_token (context_p, false);
break;
}
-#if JERRY_ESNEXT
case LEXER_ASSIGN_NULLISH_COALESCING:
{
parser_append_logical_assignment_token (context_p, PARSER_TO_EXT_OPCODE (CBC_EXT_BRANCH_IF_NULLISH));
@@ -3365,7 +3064,6 @@ parser_append_binary_token (parser_context_t *context_p) /**< context */
parser_append_logical_token (context_p, PARSER_TO_EXT_OPCODE (CBC_EXT_BRANCH_IF_NULLISH));
break;
}
-#endif /* JERRY_ESNEXT */
case LEXER_LOGICAL_OR:
{
parser_append_logical_token (context_p, CBC_BRANCH_IF_LOGICAL_TRUE);
@@ -3391,14 +3089,9 @@ static void
parser_process_binary_assignment_token (parser_context_t *context_p, /**< context */
uint8_t token) /**< token */
{
-#if !JERRY_ESNEXT
- JERRY_UNUSED (token);
-#endif /* !JERRY_ESNEXT */
-
uint16_t index = PARSER_INVALID_LITERAL_INDEX;
uint16_t opcode = context_p->stack_top_uint8;
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (opcode == CBC_EXT_OPCODE))
{
parser_stack_pop_uint8 (context_p);
@@ -3408,7 +3101,6 @@ parser_process_binary_assignment_token (parser_context_t *context_p, /**< contex
parser_stack_pop_uint8 (context_p);
}
else
-#endif /* JERRY_ESNEXT */
{
parser_stack_pop_uint8 (context_p);
@@ -3422,7 +3114,6 @@ parser_process_binary_assignment_token (parser_context_t *context_p, /**< contex
}
}
-#if JERRY_ESNEXT
bool group_expr_assingment = false;
if (JERRY_UNLIKELY (context_p->stack_top_uint8 == LEXER_ASSIGN_GROUP_EXPR))
@@ -3436,22 +3127,18 @@ parser_process_binary_assignment_token (parser_context_t *context_p, /**< contex
parser_stack_pop_uint8 (context_p);
parser_emit_cbc_ext (context_p, CBC_EXT_THROW_ASSIGN_CONST_ERROR);
}
-#endif /* JERRY_ESNEXT */
if (index == PARSER_INVALID_LITERAL_INDEX)
{
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (token == LEXER_ASSIGN_REFERENCE))
{
opcode = CBC_ASSIGN_PUSH_RESULT;
}
-#endif /* JERRY_ESNEXT */
parser_emit_cbc (context_p, opcode);
return;
}
-#if JERRY_ESNEXT
if (!group_expr_assingment)
{
uint16_t function_literal_index = parser_check_anonymous_function_declaration (context_p);
@@ -3472,7 +3159,6 @@ parser_process_binary_assignment_token (parser_context_t *context_p, /**< contex
parser_emit_cbc (context_p, CBC_ASSIGN_PUSH_RESULT);
return;
}
-#endif /* JERRY_ESNEXT */
if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL && opcode == CBC_ASSIGN_SET_IDENT)
{
@@ -3510,7 +3196,6 @@ parser_process_logical_token (parser_context_t *context_p) /**< context */
parser_set_branch_to_current_position (context_p, &branch);
} /* parser_process_logical_token */
-#if JERRY_ESNEXT
/**
* Emit opcode for logical assignment tokens.
*/
@@ -3537,8 +3222,6 @@ parser_process_logical_assignment_token (parser_context_t *context_p) /**< conte
parser_set_branch_to_current_position (context_p, &prop_reference_branch);
} /* parser_process_logical_assignment_token */
-#endif /* JERRY_ESNEXT */
-
/**
* Emit opcode for binary tokens.
*/
@@ -3621,9 +3304,7 @@ parser_process_binary_opcodes (parser_context_t *context_p, /**< context */
case LEXER_ASSIGN_MULTIPLY:
case LEXER_ASSIGN_DIVIDE:
case LEXER_ASSIGN_MODULO:
-#if JERRY_ESNEXT
case LEXER_ASSIGN_EXPONENTIATION:
-#endif /* JERRY_ESNEXT */
case LEXER_ASSIGN_LEFT_SHIFT:
case LEXER_ASSIGN_RIGHT_SHIFT:
case LEXER_ASSIGN_UNS_RIGHT_SHIFT:
@@ -3634,7 +3315,6 @@ parser_process_binary_opcodes (parser_context_t *context_p, /**< context */
parser_process_binary_lvalue_token (context_p, token);
continue;
}
-#if JERRY_ESNEXT
case LEXER_ASSIGN_NULLISH_COALESCING:
case LEXER_ASSIGN_LOGICAL_OR:
case LEXER_ASSIGN_LOGICAL_AND:
@@ -3643,14 +3323,12 @@ parser_process_binary_opcodes (parser_context_t *context_p, /**< context */
continue;
}
case LEXER_NULLISH_COALESCING:
-#endif /* JERRY_ESNEXT */
case LEXER_LOGICAL_OR:
case LEXER_LOGICAL_AND:
{
parser_process_logical_token (context_p);
continue;
}
-#if JERRY_ESNEXT
case LEXER_KEYW_IN:
{
if (context_p->stack_top_uint8 == LEXER_PRIVATE_PRIMARY_EXPR)
@@ -3663,7 +3341,6 @@ parser_process_binary_opcodes (parser_context_t *context_p, /**< context */
/* FALLTHRU */
}
-#endif /* JERRY_ESNEXT */
default:
{
parser_process_binary_token (context_p, token);
@@ -3673,7 +3350,6 @@ parser_process_binary_opcodes (parser_context_t *context_p, /**< context */
}
} /* parser_process_binary_opcodes */
-#if JERRY_ESNEXT
/**
* End position marker of a pattern.
*/
@@ -4273,8 +3949,6 @@ parser_parse_initializer_by_next_char (parser_context_t *context_p, /**< context
}
} /* parser_parse_initializer_by_next_char */
-#endif /* JERRY_ESNEXT */
-
/**
* Process ternary expression.
*/
@@ -4370,7 +4044,6 @@ parser_process_group_expression (parser_context_t *context_p, /**< context */
parser_stack_pop_uint8 (context_p);
lexer_next_token (context_p);
-#if JERRY_ESNEXT
/* Lookahead for anonymous function declaration after '=' token when the assignment base is LHS expression
with a single indentifier in it. e.g.: (a) = function () {} */
if (JERRY_UNLIKELY (context_p->token.type == LEXER_ASSIGN
@@ -4380,7 +4053,6 @@ parser_process_group_expression (parser_context_t *context_p, /**< context */
{
parser_stack_push_uint8 (context_p, LEXER_ASSIGN_GROUP_EXPR);
}
-#endif /* JERRY_ESNEXT */
} /* parser_process_group_expression */
/**
@@ -4457,16 +4129,13 @@ process_unary_expression:
if (LEXER_IS_BINARY_OP_TOKEN (context_p->token.type))
{
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (context_p->token.type == LEXER_NULLISH_COALESCING))
{
parser_check_invalid_logical_op (context_p, LEXER_LOGICAL_OR, LEXER_LOGICAL_AND);
}
-#endif /* JERRY_ESNEXT */
min_prec_treshold = parser_binary_precedence_table[context_p->token.type - LEXER_FIRST_BINARY_OP];
-#if JERRY_ESNEXT
/* Check for BINARY_LVALUE tokens + LEXER_LOGICAL_OR + LEXER_LOGICAL_AND + LEXER_EXPONENTIATION */
if ((min_prec_treshold == PARSER_RIGHT_TO_LEFT_ORDER_EXPONENTIATION)
|| (min_prec_treshold <= PARSER_RIGHT_TO_LEFT_ORDER_MAX_PRECEDENCE
@@ -4475,15 +4144,6 @@ process_unary_expression:
/* Right-to-left evaluation order. */
min_prec_treshold++;
}
-#else /* !JERRY_ESNEXT */
- /* Check for BINARY_LVALUE tokens + LEXER_LOGICAL_OR + LEXER_LOGICAL_AND */
- if (min_prec_treshold <= PARSER_RIGHT_TO_LEFT_ORDER_MAX_PRECEDENCE
- && min_prec_treshold != PARSER_RIGHT_TO_LEFT_ORDER_TERNARY_PRECEDENCE)
- {
- /* Right-to-left evaluation order. */
- min_prec_treshold++;
- }
-#endif /* JERRY_ESNEXT */
}
parser_process_binary_opcodes (context_p, min_prec_treshold);
diff --git a/jerry-core/parser/js/js-parser-internal.h b/jerry-core/parser/js/js-parser-internal.h
index 476b7996..4e46ea7c 100644
--- a/jerry-core/parser/js/js-parser-internal.h
+++ b/jerry-core/parser/js/js-parser-internal.h
@@ -57,7 +57,6 @@ typedef enum
* after the last byte code */
PARSER_DEBUGGER_BREAKPOINT_APPENDED = (1u << 11), /**< pending (unsent) breakpoint
* info is available */
-#if JERRY_ESNEXT
PARSER_LEXICAL_BLOCK_NEEDED = (1u << 12), /**< global script: needs a lexical environment for let and const
* function: needs a lexical environment for arguments */
PARSER_IS_ARROW_FUNCTION = (1u << 13), /**< an arrow function is parsed */
@@ -79,7 +78,6 @@ typedef enum
PARSER_IS_CLASS_STATIC_BLOCK = (1u << 26), /**< a class static block is parsed */
PARSER_PRIVATE_FUNCTION_NAME = PARSER_IS_FUNC_EXPRESSION, /**< represents private method for
* parser_set_function_name*/
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
PARSER_MODULE_DEFAULT_CLASS_OR_FUNC = (1u << 27), /**< parsing a function or class default export */
PARSER_MODULE_STORE_IDENT = (1u << 28), /**< store identifier of the current export statement */
@@ -128,14 +126,10 @@ typedef enum
typedef enum
{
PARSER_CHECK_BLOCK_CONTEXT, /**< check block context */
-#if JERRY_ESNEXT
PARSER_CHECK_GLOBAL_CONTEXT, /**< check global context */
PARSER_CHECK_FUNCTION_CONTEXT, /**< check function context */
-#endif /* JERRY_ESNEXT */
} parser_check_context_type_t;
-#if JERRY_ESNEXT
-
/**
* Class field bits.
*/
@@ -148,8 +142,6 @@ typedef enum
PARSER_CLASS_FIELD_STATIC_BLOCK = (1u << 4), /**< static class field */
} parser_class_field_type_t;
-#endif /* JERRY_ESNEXT */
-
/**
* Mask for strict mode code
*/
@@ -172,7 +164,6 @@ typedef enum
#define PARSER_MAX_BRANCH_LENGTH 3
#endif /* PARSER_MAXIMUM_CODE_SIZE <= UINT16_MAX */
-#if JERRY_ESNEXT
/**
* Offset of PARSER_ALLOW_SUPER
*/
@@ -222,15 +213,6 @@ typedef enum
#define PARSER_IS_NORMAL_ASYNC_FUNCTION(status_flags) \
(((status_flags) & (PARSER_IS_GENERATOR_FUNCTION | PARSER_IS_ASYNC_FUNCTION)) == PARSER_IS_ASYNC_FUNCTION)
-#else /* !JERRY_ESNEXT */
-
-/**
- * All flags that affect exotic arguments object creation.
- */
-#define PARSER_ARGUMENTS_RELATED_FLAGS (PARSER_ARGUMENTS_NEEDED | PARSER_IS_STRICT)
-
-#endif /* JERRY_ESNEXT */
-
/* Checks whether unmapped arguments are needed. */
#define PARSER_NEEDS_MAPPED_ARGUMENTS(status_flags) \
(((status_flags) &PARSER_ARGUMENTS_RELATED_FLAGS) == PARSER_ARGUMENTS_NEEDED)
@@ -403,8 +385,6 @@ typedef struct
*/
#define PARSER_SCOPE_STACK_FUNC 0xffff
-#if JERRY_ESNEXT
-
/**
* Mask for decoding the register index of map_to
*/
@@ -426,8 +406,6 @@ typedef struct
*/
#define PARSER_SCOPE_STACK_IS_LOCAL_CREATED (PARSER_SCOPE_STACK_IS_CONST_REG)
-#endif /* JERRY_ESNEXT */
-
/**
* Starting literal index for registers.
*/
@@ -485,7 +463,6 @@ typedef struct
#endif /* JERRY_LINE_INFO */
-#if JERRY_ESNEXT
/**
* List of private field contexts
*/
@@ -495,7 +472,6 @@ typedef struct parser_private_context_t
struct parser_private_context_t *prev_p; /**< previous private field context */
uint8_t opts; /**< options */
} parser_private_context_t;
-#endif /* JERRY_ESNEXT */
/**
* Those members of a context which needs
@@ -512,9 +488,7 @@ typedef struct parser_saved_context_t
/* Literal types */
uint16_t argument_count; /**< number of function arguments */
-#if JERRY_ESNEXT
uint16_t argument_length; /**< length property of arguments */
-#endif /* JERRY_ESNEXT */
uint16_t register_count; /**< number of registers */
uint16_t literal_count; /**< number of literals */
@@ -526,11 +500,8 @@ typedef struct parser_saved_context_t
uint16_t scope_stack_size; /**< size of scope stack */
uint16_t scope_stack_top; /**< preserved top of scope stack */
uint16_t scope_stack_reg_top; /**< preserved top register of scope stack */
-#if JERRY_ESNEXT
uint16_t scope_stack_global_end; /**< end of global declarations of a function */
ecma_value_t tagged_template_literal_cp; /**< compessed pointer to the tagged template literal collection */
-#endif /* JERRY_ESNEXT */
-
#ifndef JERRY_NDEBUG
uint16_t context_stack_depth; /**< current context stack depth */
#endif /* !JERRY_NDEBUG */
@@ -602,9 +573,7 @@ typedef struct
/* Literal types */
uint16_t argument_count; /**< number of function arguments */
-#if JERRY_ESNEXT
uint16_t argument_length; /**< length property of arguments */
-#endif /* JERRY_ESNEXT */
uint16_t register_count; /**< number of registers */
uint16_t literal_count; /**< number of literals */
@@ -618,11 +587,9 @@ typedef struct
uint16_t scope_stack_size; /**< size of scope stack */
uint16_t scope_stack_top; /**< current top of scope stack */
uint16_t scope_stack_reg_top; /**< current top register of scope stack */
-#if JERRY_ESNEXT
uint16_t scope_stack_global_end; /**< end of global declarations of a function */
ecma_value_t tagged_template_literal_cp; /**< compessed pointer to the tagged template literal collection */
parser_private_context_t *private_context_p; /**< private context */
-#endif /* JERRY_ESNEXT */
uint8_t stack_top_uint8; /**< top byte stored on the stack */
#ifndef JERRY_NDEBUG
@@ -738,6 +705,7 @@ ecma_string_t *parser_new_ecma_string_from_literal (lexer_literal_t *literal_p);
void parser_set_branch_to_current_position (parser_context_t *context_p, parser_branch_t *branch_p);
void parser_set_breaks_to_current_position (parser_context_t *context_p, parser_branch_node_t *current_p);
void parser_set_continues_to_current_position (parser_context_t *context_p, parser_branch_node_t *current_p);
+void parser_reverse_class_fields (parser_context_t *context_p, size_t fields_size);
/* Convenience macros. */
#define parser_emit_cbc_ext(context_p, opcode) parser_emit_cbc ((context_p), PARSER_TO_EXT_OPCODE (opcode))
@@ -754,10 +722,6 @@ void parser_set_continues_to_current_position (parser_context_t *context_p, pars
#define parser_emit_cbc_ext_backward_branch(context_p, opcode, offset) \
parser_emit_cbc_backward_branch ((context_p), PARSER_TO_EXT_OPCODE (opcode), (offset))
-#if JERRY_ESNEXT
-void parser_reverse_class_fields (parser_context_t *context_p, size_t fields_size);
-#endif /* JERRY_ESNEXT */
-
/**
* @}
*
@@ -772,7 +736,6 @@ bool lexer_check_next_character (parser_context_t *context_p, lit_utf8_byte_t ch
bool lexer_check_next_characters (parser_context_t *context_p, lit_utf8_byte_t character1, lit_utf8_byte_t character2);
uint8_t lexer_consume_next_character (parser_context_t *context_p);
bool lexer_check_post_primary_exp (parser_context_t *context_p);
-#if JERRY_ESNEXT
void lexer_skip_empty_statements (parser_context_t *context_p);
bool lexer_check_arrow (parser_context_t *context_p);
bool lexer_check_arrow_param (parser_context_t *context_p);
@@ -781,7 +744,6 @@ bool lexer_consume_generator (parser_context_t *context_p);
bool lexer_consume_assign (parser_context_t *context_p);
void lexer_update_await_yield (parser_context_t *context_p, uint32_t status_flags);
bool lexer_scan_private_identifier (parser_context_t *context_p);
-#endif /* JERRY_ESNEXT */
void lexer_parse_string (parser_context_t *context_p, lexer_string_options_t opts);
void lexer_expect_identifier (parser_context_t *context_p, uint8_t literal_type);
bool lexer_scan_identifier (parser_context_t *context_p, lexer_parse_options_t opts);
@@ -800,9 +762,7 @@ void lexer_construct_literal_object (parser_context_t *context_p,
bool lexer_construct_number_object (parser_context_t *context_p, bool is_expr, bool is_negative_number);
void lexer_convert_push_number_to_push_literal (parser_context_t *context_p);
uint16_t lexer_construct_function_object (parser_context_t *context_p, uint32_t extra_status_flags);
-#if JERRY_ESNEXT
uint16_t lexer_construct_class_static_block_function (parser_context_t *context_p);
-#endif /* JERRY_ESNEXT */
void lexer_construct_regexp_object (parser_context_t *context_p, bool parse_only);
bool lexer_compare_identifier_to_string (const lexer_lit_location_t *left_p, const uint8_t *right_p, size_t size);
bool lexer_compare_identifiers (parser_context_t *context_p,
@@ -811,11 +771,9 @@ bool lexer_compare_identifiers (parser_context_t *context_p,
bool lexer_current_is_literal (parser_context_t *context_p, const lexer_lit_location_t *right_ident_p);
bool lexer_string_is_use_strict (parser_context_t *context_p);
bool lexer_string_is_directive (parser_context_t *context_p);
-#if JERRY_ESNEXT
bool lexer_token_is_identifier (parser_context_t *context_p, const char *identifier_p, size_t identifier_length);
bool lexer_token_is_let (parser_context_t *context_p);
bool lexer_token_is_async (parser_context_t *context_p);
-#endif /* JERRY_ESNEXT */
bool lexer_compare_literal_to_string (parser_context_t *context_p, const char *string_p, size_t string_length);
void lexer_init_line_info (parser_context_t *context_p);
uint8_t lexer_convert_binary_lvalue_token_to_binary (uint8_t token);
@@ -832,7 +790,6 @@ uint8_t lexer_convert_binary_lvalue_token_to_binary (uint8_t token);
void parser_parse_block_expression (parser_context_t *context_p, int options);
void parser_parse_expression_statement (parser_context_t *context_p, int options);
void parser_parse_expression (parser_context_t *context_p, int options);
-#if JERRY_ESNEXT
void parser_resolve_private_identifier (parser_context_t *context_p);
void parser_save_private_context (parser_context_t *context_p,
parser_private_context_t *private_ctx_p,
@@ -841,8 +798,6 @@ void parser_restore_private_context (parser_context_t *context_p, parser_private
void parser_parse_class (parser_context_t *context_p, bool is_statement);
void parser_parse_initializer (parser_context_t *context_p, parser_pattern_flags_t flags);
void parser_parse_initializer_by_next_char (parser_context_t *context_p, parser_pattern_flags_t flags);
-#endif /* JERRY_ESNEXT */
-
/**
* @}
*
@@ -861,21 +816,17 @@ void scanner_reverse_info_list (parser_context_t *context_p);
void scanner_cleanup (parser_context_t *context_p);
bool scanner_is_context_needed (parser_context_t *context_p, parser_check_context_type_t check_type);
-#if JERRY_ESNEXT
bool scanner_try_scan_new_target (parser_context_t *context_p);
void scanner_check_variables (parser_context_t *context_p);
-#endif /* JERRY_ESNEXT */
void scanner_create_variables (parser_context_t *context_p, uint32_t option_flags);
void scanner_get_location (scanner_location_t *location_p, parser_context_t *context_p);
void scanner_set_location (parser_context_t *context_p, scanner_location_t *location_p);
uint16_t scanner_decode_map_to (parser_scope_stack_t *stack_item_p);
-#if JERRY_ESNEXT
uint16_t scanner_save_literal (parser_context_t *context_p, uint16_t ident_index);
bool scanner_literal_is_const_reg (parser_context_t *context_p, uint16_t literal_index);
bool scanner_literal_is_created (parser_context_t *context_p, uint16_t literal_index);
bool scanner_literal_exists (parser_context_t *context_p, uint16_t literal_index);
-#endif /* JERRY_ESNEXT */
void scanner_scan_all (parser_context_t *context_p);
@@ -935,7 +886,6 @@ uint8_t *parser_line_info_generate (parser_context_t *context_p);
*/
ecma_compiled_code_t *parser_parse_function (parser_context_t *context_p, uint32_t status_flags);
-#if JERRY_ESNEXT
ecma_compiled_code_t *parser_parse_class_static_block (parser_context_t *context_p);
ecma_compiled_code_t *parser_parse_arrow_function (parser_context_t *context_p, uint32_t status_flags);
ecma_compiled_code_t *parser_parse_class_fields (parser_context_t *context_p);
@@ -948,7 +898,6 @@ void parser_compiled_code_set_function_name (parser_context_t *context_p,
uint16_t name_index,
uint32_t status_flags);
uint16_t parser_check_anonymous_function_declaration (parser_context_t *context_p);
-#endif /* JERRY_ESNEXT */
/* Error management. */
diff --git a/jerry-core/parser/js/js-parser-statm.c b/jerry-core/parser/js/js-parser-statm.c
index b6f5075d..10df37e5 100644
--- a/jerry-core/parser/js/js-parser-statm.c
+++ b/jerry-core/parser/js/js-parser-statm.c
@@ -43,12 +43,10 @@ typedef enum
{
PARSER_STATEMENT_START,
PARSER_STATEMENT_BLOCK,
-#if JERRY_ESNEXT
PARSER_STATEMENT_BLOCK_SCOPE,
PARSER_STATEMENT_PRIVATE_SCOPE,
PARSER_STATEMENT_BLOCK_CONTEXT,
PARSER_STATEMENT_PRIVATE_CONTEXT,
-#endif /* JERRY_ESNEXT */
PARSER_STATEMENT_LABEL,
PARSER_STATEMENT_IF,
PARSER_STATEMENT_ELSE,
@@ -58,10 +56,8 @@ typedef enum
PARSER_STATEMENT_WHILE,
PARSER_STATEMENT_FOR,
PARSER_STATEMENT_FOR_IN,
-#if JERRY_ESNEXT
PARSER_STATEMENT_FOR_OF,
PARSER_STATEMENT_FOR_AWAIT_OF,
-#endif /* JERRY_ESNEXT */
PARSER_STATEMENT_WITH,
PARSER_STATEMENT_TRY,
} parser_statement_type_t;
@@ -88,7 +84,6 @@ static const uint8_t parser_statement_flags[] = {
PARSER_STATM_HAS_BLOCK,
/* PARSER_STATEMENT_BLOCK, */
PARSER_STATM_HAS_BLOCK,
-#if JERRY_ESNEXT
/* PARSER_STATEMENT_BLOCK_SCOPE, */
PARSER_STATM_HAS_BLOCK,
/* PARSER_STATEMENT_PRIVATE_SCOPE, */
@@ -97,7 +92,6 @@ static const uint8_t parser_statement_flags[] = {
PARSER_STATM_HAS_BLOCK | PARSER_STATM_CONTEXT_BREAK,
/* PARSER_STATEMENT_PRIVATE_CONTEXT, */
PARSER_STATM_CONTEXT_BREAK,
-#endif /* JERRY_ESNEXT */
/* PARSER_STATEMENT_LABEL */
PARSER_STATM_SINGLE_STATM,
/* PARSER_STATEMENT_IF */
@@ -116,19 +110,16 @@ static const uint8_t parser_statement_flags[] = {
PARSER_STATM_BREAK_TARGET | PARSER_STATM_CONTINUE_TARGET | PARSER_STATM_SINGLE_STATM,
/* PARSER_STATEMENT_FOR_IN */
PARSER_STATM_BREAK_TARGET | PARSER_STATM_CONTINUE_TARGET | PARSER_STATM_SINGLE_STATM | PARSER_STATM_CONTEXT_BREAK,
-#if JERRY_ESNEXT
/* PARSER_STATEMENT_FOR_OF */
PARSER_STATM_BREAK_TARGET | PARSER_STATM_CONTINUE_TARGET | PARSER_STATM_SINGLE_STATM | PARSER_STATM_CONTEXT_BREAK,
/* PARSER_STATEMENT_FOR_AWAIT_OF */
PARSER_STATM_BREAK_TARGET | PARSER_STATM_CONTINUE_TARGET | PARSER_STATM_SINGLE_STATM | PARSER_STATM_CONTEXT_BREAK,
-#endif /* JERRY_ESNEXT */
/* PARSER_STATEMENT_WITH */
PARSER_STATM_CONTEXT_BREAK | PARSER_STATM_SINGLE_STATM,
/* PARSER_STATEMENT_TRY */
PARSER_STATM_HAS_BLOCK | PARSER_STATM_CONTEXT_BREAK
};
-#if JERRY_ESNEXT
/**
* Block statement.
*/
@@ -146,8 +137,6 @@ typedef struct
parser_branch_t branch; /**< branch to the end */
} parser_block_context_t;
-#endif /* !JERRY_ESNEXT */
-
/**
* Loop statement.
*/
@@ -261,7 +250,6 @@ parser_statement_length (uint8_t type) /**< type of statement */
static const uint8_t statement_lengths[] = {
/* PARSER_STATEMENT_BLOCK */
1,
-#if JERRY_ESNEXT
/* PARSER_STATEMENT_BLOCK_SCOPE */
(uint8_t) (sizeof (parser_block_statement_t) + 1),
/* PARSER_STATEMENT_PRIVATE_SCOPE */
@@ -270,7 +258,6 @@ parser_statement_length (uint8_t type) /**< type of statement */
(uint8_t) (sizeof (parser_block_statement_t) + sizeof (parser_block_context_t) + 1),
/* PARSER_STATEMENT_PRIVATE_CONTEXT */
(uint8_t) (sizeof (parser_block_statement_t) + sizeof (parser_block_context_t) + 1),
-#endif /* JERRY_ESNEXT */
/* PARSER_STATEMENT_LABEL */
(uint8_t) (sizeof (parser_label_statement_t) + 1),
/* PARSER_STATEMENT_IF */
@@ -289,12 +276,10 @@ parser_statement_length (uint8_t type) /**< type of statement */
(uint8_t) (sizeof (parser_for_statement_t) + sizeof (parser_loop_statement_t) + 1),
/* PARSER_STATEMENT_FOR_IN */
(uint8_t) (sizeof (parser_for_in_of_statement_t) + sizeof (parser_loop_statement_t) + 1),
-#if JERRY_ESNEXT
/* PARSER_STATEMENT_FOR_OF */
(uint8_t) (sizeof (parser_for_in_of_statement_t) + sizeof (parser_loop_statement_t) + 1),
/* PARSER_STATEMENT_FOR_AWAIT_OF */
(uint8_t) (sizeof (parser_for_in_of_statement_t) + sizeof (parser_loop_statement_t) + 1),
-#endif /* JERRY_ESNEXT */
/* PARSER_STATEMENT_WITH */
(uint8_t) (sizeof (parser_with_statement_t) + 1 + 1),
/* PARSER_STATEMENT_TRY */
@@ -328,8 +313,6 @@ parser_parse_enclosed_expr (parser_context_t *context_p) /**< context */
lexer_next_token (context_p);
} /* parser_parse_enclosed_expr */
-#if JERRY_ESNEXT
-
/**
* Create a block context.
*
@@ -431,7 +414,6 @@ parser_validate_lexical_context (parser_context_t *context_p) /**< context */
parser_raise_error (context_p, PARSER_ERR_LEXICAL_SINGLE_STATEMENT);
}
} /* parser_validate_lexical_context */
-#endif /* JERRY_ESNEXT */
/**
* Parse var statement.
@@ -442,18 +424,15 @@ parser_parse_var_statement (parser_context_t *context_p) /**< context */
JERRY_ASSERT (context_p->token.type == LEXER_KEYW_VAR || context_p->token.type == LEXER_KEYW_LET
|| context_p->token.type == LEXER_KEYW_CONST);
-#if JERRY_ESNEXT
uint8_t declaration_type = context_p->token.type;
if (declaration_type != LEXER_KEYW_VAR)
{
parser_validate_lexical_context (context_p);
}
-#endif /* JERRY_ESNEXT */
while (true)
{
-#if JERRY_ESNEXT
if (lexer_check_next_characters (context_p, LIT_CHAR_LEFT_SQUARE, LIT_CHAR_LEFT_BRACE))
{
parser_pattern_flags_t flags = PARSER_PATTERN_BINDING;
@@ -471,7 +450,6 @@ parser_parse_var_statement (parser_context_t *context_p) /**< context */
}
else
{
-#endif /* JERRY_ESNEXT */
lexer_expect_identifier (context_p, LEXER_IDENT_LITERAL);
JERRY_ASSERT (context_p->token.type == LEXER_LITERAL
&& context_p->token.lit_location.type == LEXER_IDENT_LITERAL);
@@ -487,7 +465,6 @@ parser_parse_var_statement (parser_context_t *context_p) /**< context */
parser_module_append_export_name (context_p);
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_ESNEXT
if (declaration_type != LEXER_KEYW_VAR && context_p->token.keyword_type == LEXER_KEYW_LET)
{
parser_raise_error (context_p, PARSER_ERR_LEXICAL_LET_BINDING);
@@ -498,7 +475,6 @@ parser_parse_var_statement (parser_context_t *context_p) /**< context */
JERRY_ASSERT (context_p->next_scanner_info_p->type == SCANNER_TYPE_ERR_REDECLARED);
parser_raise_error (context_p, PARSER_ERR_VARIABLE_REDECLARED);
}
-#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
@@ -528,7 +504,6 @@ parser_parse_var_statement (parser_context_t *context_p) /**< context */
cbc_opcode_t opcode = CBC_ASSIGN_SET_IDENT;
-#if JERRY_ESNEXT
uint16_t function_literal_index = parser_check_anonymous_function_declaration (context_p);
if (function_literal_index == PARSER_ANONYMOUS_CLASS)
@@ -554,11 +529,9 @@ parser_parse_var_statement (parser_context_t *context_p) /**< context */
opcode = CBC_INIT_CONST;
}
}
-#endif /* JERRY_ESNEXT */
parser_emit_cbc_literal (context_p, (uint16_t) opcode, index);
}
-#if JERRY_ESNEXT
else if (declaration_type == LEXER_KEYW_LET)
{
parser_emit_cbc (context_p, CBC_PUSH_UNDEFINED);
@@ -578,7 +551,6 @@ parser_parse_var_statement (parser_context_t *context_p) /**< context */
parser_raise_error (context_p, PARSER_ERR_MISSING_ASSIGN_AFTER_CONST);
}
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type != LEXER_COMMA)
{
@@ -599,7 +571,6 @@ parser_parse_function_statement (parser_context_t *context_p) /**< context */
{
JERRY_ASSERT (context_p->token.type == LEXER_KEYW_FUNCTION);
-#if JERRY_ESNEXT
bool is_single_statement = (parser_statement_flags[context_p->stack_top_uint8] & PARSER_STATM_SINGLE_STATM) != 0;
if (JERRY_UNLIKELY (is_single_statement))
@@ -646,17 +617,11 @@ parser_parse_function_statement (parser_context_t *context_p) /**< context */
parser_raise_error (context_p, PARSER_ERR_LEXICAL_SINGLE_STATEMENT);
}
}
-#endif /* JERRY_ESNEXT */
-
#if JERRY_FUNCTION_TO_STRING
-#if JERRY_ESNEXT
if (!(context_p->next_scanner_info_p->u8_arg & SCANNER_FUNCTION_ASYNC))
{
context_p->function_start_p = context_p->token.lit_location.char_p;
}
-#else /* !JERRY_ESNEXT */
- context_p->function_start_p = context_p->token.lit_location.char_p;
-#endif /* JERRY_ESNEXT */
#endif /* JERRY_FUNCTION_TO_STRING */
#if JERRY_DEBUGGER
@@ -664,7 +629,6 @@ parser_parse_function_statement (parser_context_t *context_p) /**< context */
parser_line_counter_t debugger_column = context_p->token.column;
#endif /* JERRY_DEBUGGER */
-#if JERRY_ESNEXT
bool is_generator_function = false;
if (lexer_consume_generator (context_p))
@@ -675,12 +639,10 @@ parser_parse_function_statement (parser_context_t *context_p) /**< context */
}
is_generator_function = true;
}
-#endif /* JERRY_ESNEXT */
lexer_expect_identifier (context_p, LEXER_NEW_IDENT_LITERAL);
JERRY_ASSERT (context_p->token.type == LEXER_LITERAL && context_p->token.lit_location.type == LEXER_IDENT_LITERAL);
-#if JERRY_ESNEXT
if (context_p->next_scanner_info_p->source_p == context_p->source_p
&& context_p->next_scanner_info_p->type == SCANNER_TYPE_ERR_REDECLARED)
{
@@ -688,7 +650,6 @@ parser_parse_function_statement (parser_context_t *context_p) /**< context */
}
uint16_t function_name_index = context_p->lit_object.index;
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
parser_module_append_export_name (context_p);
@@ -702,7 +663,6 @@ parser_parse_function_statement (parser_context_t *context_p) /**< context */
status_flags |= PARSER_HAS_NON_STRICT_ARG;
}
-#if JERRY_ESNEXT
if (is_generator_function)
{
status_flags |= PARSER_IS_GENERATOR_FUNCTION | PARSER_DISALLOW_AWAIT_YIELD;
@@ -712,7 +672,6 @@ parser_parse_function_statement (parser_context_t *context_p) /**< context */
{
status_flags |= PARSER_IS_ASYNC_FUNCTION | PARSER_DISALLOW_AWAIT_YIELD;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_DEBUGGER
if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
@@ -743,7 +702,6 @@ parser_parse_function_statement (parser_context_t *context_p) /**< context */
JERRY_ASSERT (scope_stack_p[1].map_from == PARSER_SCOPE_STACK_FUNC);
-#if JERRY_ESNEXT
if (!(context_p->status_flags & PARSER_IS_STRICT)
&& (scope_stack_p >= context_p->scope_stack_p + context_p->scope_stack_global_end))
{
@@ -789,7 +747,6 @@ parser_parse_function_statement (parser_context_t *context_p) /**< context */
parser_pop_block_context (context_p);
}
}
-#endif /* JERRY_ESNEXT */
lexer_literal_t *literal_p = PARSER_GET_LITERAL ((size_t) scope_stack_p[1].map_to);
@@ -806,10 +763,7 @@ parser_parse_function_statement (parser_context_t *context_p) /**< context */
literal_p->u.bytecode_p = compiled_code_p;
literal_p->type = LEXER_FUNCTION_LITERAL;
-#if JERRY_ESNEXT
parser_compiled_code_set_function_name (context_p, compiled_code_p, function_name_index, 0);
-#endif /* JERRY_ESNEXT */
-
lexer_next_token (context_p);
} /* parser_parse_function_statement */
@@ -1140,12 +1094,7 @@ parser_check_left_hand_side_expression (parser_context_t *context_p, /**< contex
else
{
/* Invalid LeftHandSide expression. */
-#if JERRY_ESNEXT
parser_raise_error (context_p, PARSER_ERR_INVALID_LHS_FOR_LOOP);
-#else /* !JERRY_ESNEXT */
- parser_emit_cbc_ext (context_p, CBC_EXT_THROW_REFERENCE_ERROR);
-#endif /* JERRY_ESNEXT */
-
return CBC_ASSIGN;
}
@@ -1162,8 +1111,6 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
JERRY_ASSERT (context_p->token.type == LEXER_KEYW_FOR);
lexer_next_token (context_p);
-
-#if JERRY_ESNEXT
bool is_for_await = false;
if (context_p->token.type == LEXER_KEYW_AWAIT)
@@ -1175,17 +1122,15 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
lexer_next_token (context_p);
is_for_await = true;
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type != LEXER_LEFT_PAREN)
{
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_LITERAL && context_p->token.keyword_type == LEXER_KEYW_AWAIT
&& !(context_p->token.lit_location.status_flags & LEXER_LIT_LOCATION_HAS_ESCAPE))
{
parser_raise_error (context_p, PARSER_ERR_FOR_AWAIT_NO_ASYNC);
}
-#endif /* JERRY_ESNEXT */
+
parser_raise_error (context_p, PARSER_ERR_LEFT_PAREN_EXPECTED);
}
@@ -1194,7 +1139,6 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
parser_for_in_of_statement_t for_in_of_statement;
scanner_location_t start_location, end_location;
-#if JERRY_ESNEXT
JERRY_ASSERT (context_p->next_scanner_info_p->type == SCANNER_TYPE_FOR_IN
|| context_p->next_scanner_info_p->type == SCANNER_TYPE_FOR_OF);
@@ -1245,29 +1189,18 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
}
scanner_set_location (context_p, &end_location);
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (context_p->next_scanner_info_p->type == SCANNER_TYPE_FOR_IN);
-
- bool is_for_in = true;
- scanner_get_location (&start_location, context_p);
-
- scanner_set_location (context_p, &((scanner_location_info_t *) context_p->next_scanner_info_p)->location);
- scanner_release_next (context_p, sizeof (scanner_location_info_t));
-#endif /* JERRY_ESNEXT */
/* The length of both 'in' and 'of' is two. */
const uint8_t *source_end_p = context_p->source_p - 2;
scanner_seek (context_p);
-#if JERRY_ESNEXT
if (is_for_in && is_for_await)
{
context_p->token.line = context_p->line;
context_p->token.column = context_p->column - 2;
parser_raise_error (context_p, PARSER_ERR_FOR_AWAIT_NO_OF);
}
-#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
int options = is_for_in ? PARSE_EXPR : PARSE_EXPR_NO_COMMA;
@@ -1285,24 +1218,20 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
cbc_ext_opcode_t init_opcode = CBC_EXT_FOR_IN_INIT;
-#if JERRY_ESNEXT
if (!is_for_in)
{
init_opcode = is_for_await ? CBC_EXT_FOR_AWAIT_OF_INIT : CBC_EXT_FOR_OF_INIT;
}
-#endif /* JERRY_ESNEXT */
parser_emit_cbc_ext_forward_branch (context_p, init_opcode, &for_in_of_statement.branch);
JERRY_ASSERT (context_p->last_cbc_opcode == PARSER_CBC_UNAVAILABLE);
for_in_of_statement.start_offset = context_p->byte_code_size;
-#if JERRY_ESNEXT
if (has_context)
{
parser_emit_cbc_ext (context_p, CBC_EXT_CLONE_CONTEXT);
}
-#endif /* JERRY_ESNEXT */
/* The expression parser must not read the 'in' or 'of' tokens. */
scanner_get_location (&end_location, context_p);
@@ -1312,7 +1241,6 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
context_p->source_end_p = source_end_p;
scanner_seek (context_p);
-#if JERRY_ESNEXT
if (token_type == LEXER_EOS)
{
lexer_next_token (context_p);
@@ -1322,21 +1250,13 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
token_type = context_p->token.type;
}
}
-#else /* !JERRY_ESNEXT */
- lexer_next_token (context_p);
-
- uint8_t token_type = context_p->token.type;
-#endif /* JERRY_ESNEXT */
switch (token_type)
{
-#if JERRY_ESNEXT
case LEXER_KEYW_LET:
case LEXER_KEYW_CONST:
-#endif /* JERRY_ESNEXT */
case LEXER_KEYW_VAR:
{
-#if JERRY_ESNEXT
if (lexer_check_next_characters (context_p, LIT_CHAR_LEFT_SQUARE, LIT_CHAR_LEFT_BRACE))
{
parser_emit_cbc_ext (context_p, is_for_in ? CBC_EXT_FOR_IN_GET_NEXT : CBC_EXT_FOR_OF_GET_NEXT);
@@ -1373,16 +1293,13 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
parser_parse_initializer_by_next_char (context_p, flags);
break;
}
-#endif /* JERRY_ESNEXT */
lexer_expect_identifier (context_p, LEXER_IDENT_LITERAL);
-#if JERRY_ESNEXT
if (context_p->token.keyword_type == LEXER_KEYW_LET && token_type != LEXER_KEYW_VAR)
{
parser_raise_error (context_p, PARSER_ERR_LEXICAL_LET_BINDING);
}
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (context_p->token.type == LEXER_LITERAL
&& context_p->token.lit_location.type == LEXER_IDENT_LITERAL);
@@ -1392,12 +1309,10 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
if (context_p->token.type == LEXER_ASSIGN)
{
-#if JERRY_ESNEXT
if ((context_p->status_flags & PARSER_IS_STRICT) || !is_for_in)
{
parser_raise_error (context_p, PARSER_ERR_FOR_IN_OF_DECLARATION);
}
-#endif /* JERRY_ESNEXT */
parser_branch_t branch;
/* Initialiser is never executed. */
@@ -1408,7 +1323,6 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
}
parser_emit_cbc_ext (context_p, is_for_in ? CBC_EXT_FOR_IN_GET_NEXT : CBC_EXT_FOR_OF_GET_NEXT);
-#if JERRY_ESNEXT
#ifndef JERRY_NDEBUG
if (literal_index < PARSER_REGISTER_START && has_context
&& !scanner_literal_is_created (context_p, literal_index))
@@ -1419,12 +1333,8 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
uint16_t opcode = (has_context ? CBC_ASSIGN_LET_CONST : CBC_ASSIGN_SET_IDENT);
parser_emit_cbc_literal (context_p, opcode, literal_index);
-#else /* !JERRY_ESNEXT */
- parser_emit_cbc_literal (context_p, CBC_ASSIGN_SET_IDENT, literal_index);
-#endif /* JERRY_ESNEXT */
break;
}
-#if JERRY_ESNEXT
case LEXER_LEFT_BRACE:
case LEXER_LEFT_SQUARE:
{
@@ -1449,7 +1359,6 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
}
/* FALLTHRU */
}
-#endif /* JERRY_ESNEXT */
default:
{
uint16_t opcode;
@@ -1473,11 +1382,7 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
if (context_p->token.type != LEXER_EOS)
{
-#if JERRY_ESNEXT
parser_raise_error (context_p, is_for_in ? PARSER_ERR_IN_EXPECTED : PARSER_ERR_OF_EXPECTED);
-#else /* !JERRY_ESNEXT */
- parser_raise_error (context_p, PARSER_ERR_IN_EXPECTED);
-#endif /* JERRY_ESNEXT */
}
parser_flush_cbc (context_p);
@@ -1492,12 +1397,10 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
uint8_t for_type = PARSER_STATEMENT_FOR_IN;
-#if JERRY_ESNEXT
if (!is_for_in)
{
for_type = is_for_await ? PARSER_STATEMENT_FOR_AWAIT_OF : PARSER_STATEMENT_FOR_OF;
}
-#endif /* JERRY_ESNEXT */
parser_stack_push_uint8 (context_p, for_type);
parser_stack_iterator_init (context_p, &context_p->last_statement);
@@ -1508,13 +1411,10 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
if (context_p->token.type != LEXER_SEMICOLON)
{
-#if JERRY_ESNEXT
const uint8_t *source_p = context_p->source_p;
-#endif /* JERRY_ESNEXT */
switch (context_p->token.type)
{
-#if JERRY_ESNEXT
case LEXER_LITERAL:
{
if (!lexer_token_is_let (context_p))
@@ -1551,7 +1451,6 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
}
/* FALLTHRU */
}
-#endif /* JERRY_ESNEXT */
case LEXER_KEYW_VAR:
{
parser_parse_var_statement (context_p);
@@ -1570,12 +1469,10 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
}
}
-#if JERRY_ESNEXT
if (is_for_await)
{
parser_raise_error (context_p, PARSER_ERR_FOR_AWAIT_NO_OF);
}
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (context_p->next_scanner_info_p->source_p != context_p->source_p
|| context_p->next_scanner_info_p->type == SCANNER_TYPE_FOR);
@@ -1652,7 +1549,6 @@ parser_parse_for_statement_end (parser_context_t *context_p) /**< context */
parser_stack_iterator_skip (&iterator, sizeof (parser_loop_statement_t));
parser_stack_iterator_read (&iterator, &for_statement, sizeof (parser_for_statement_t));
-#if JERRY_ESNEXT
bool has_block_context = false;
uint8_t next_statement_type;
@@ -1663,7 +1559,6 @@ parser_parse_for_statement_end (parser_context_t *context_p) /**< context */
{
has_block_context = true;
}
-#endif /* JERRY_ESNEXT */
scanner_get_location (&location, context_p);
current_token = context_p->token;
@@ -1674,12 +1569,10 @@ parser_parse_for_statement_end (parser_context_t *context_p) /**< context */
parser_set_continues_to_current_position (context_p, loop.branch_list_p);
-#if JERRY_ESNEXT
if (has_block_context)
{
parser_emit_cbc_ext (context_p, CBC_EXT_CLONE_FULL_CONTEXT);
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type != LEXER_RIGHT_PAREN)
{
@@ -1729,13 +1622,11 @@ parser_parse_for_statement_end (parser_context_t *context_p) /**< context */
parser_emit_cbc_backward_branch (context_p, (uint16_t) opcode, for_statement.start_offset);
parser_set_breaks_to_current_position (context_p, loop.branch_list_p);
-#if JERRY_ESNEXT
if (context_p->stack_top_uint8 == PARSER_STATEMENT_PRIVATE_SCOPE
|| context_p->stack_top_uint8 == PARSER_STATEMENT_PRIVATE_CONTEXT)
{
parser_pop_block_context (context_p);
}
-#endif /* JERRY_ESNEXT */
/* Calling scanner_seek is unnecessary because all
* info blocks inside the for statement should be processed. */
@@ -1766,12 +1657,10 @@ parser_parse_switch_statement_start (parser_context_t *context_p) /**< context *
parser_raise_error (context_p, PARSER_ERR_LEFT_BRACE_EXPECTED);
}
-#if JERRY_ESNEXT
if (context_p->next_scanner_info_p->source_p == context_p->source_p - 1)
{
parser_push_block_context (context_p, true);
}
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (context_p->next_scanner_info_p->source_p == context_p->source_p
&& context_p->next_scanner_info_p->type == SCANNER_TYPE_SWITCH);
@@ -1925,10 +1814,8 @@ parser_parse_try_statement_end (parser_context_t *context_p) /**< context */
parser_stack_iterator_skip (&iterator, 1);
parser_stack_iterator_read (&iterator, &try_statement, sizeof (parser_try_statement_t));
-#if JERRY_ESNEXT
context_p->scope_stack_top = try_statement.scope_stack_top;
context_p->scope_stack_reg_top = try_statement.scope_stack_reg_top;
-#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
@@ -1949,11 +1836,6 @@ parser_parse_try_statement_end (parser_context_t *context_p) /**< context */
if (try_statement.type == parser_catch_block)
{
-#if !JERRY_ESNEXT
- context_p->scope_stack_top = try_statement.scope_stack_top;
- context_p->scope_stack_reg_top = try_statement.scope_stack_reg_top;
-#endif /* !JERRY_ESNEXT */
-
if (context_p->token.type != LEXER_KEYW_FINALLY)
{
parser_flush_cbc (context_p);
@@ -2017,7 +1899,6 @@ parser_parse_try_statement_end (parser_context_t *context_p) /**< context */
if (context_p->token.type == LEXER_LEFT_PAREN)
{
-#if JERRY_ESNEXT
if (lexer_check_next_characters (context_p, LIT_CHAR_LEFT_SQUARE, LIT_CHAR_LEFT_BRACE))
{
parser_pattern_flags_t flags = (PARSER_PATTERN_BINDING | PARSER_PATTERN_TARGET_ON_STACK | PARSER_PATTERN_LET);
@@ -2026,28 +1907,21 @@ parser_parse_try_statement_end (parser_context_t *context_p) /**< context */
}
else
{
-#endif /* JERRY_ESNEXT */
lexer_expect_identifier (context_p, LEXER_IDENT_LITERAL);
JERRY_ASSERT (context_p->token.type == LEXER_LITERAL
&& context_p->token.lit_location.type == LEXER_IDENT_LITERAL);
-#if JERRY_ESNEXT
uint16_t literal_index = context_p->lit_object.index;
parser_emit_cbc_literal (context_p,
(literal_index >= PARSER_REGISTER_START) ? CBC_ASSIGN_SET_IDENT : CBC_ASSIGN_LET_CONST,
literal_index);
-#else /* !JERRY_ESNEXT */
- parser_emit_cbc_literal (context_p, CBC_ASSIGN_SET_IDENT, context_p->lit_object.index);
-#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
#ifndef JERRY_NDEBUG
JERRY_ASSERT (block_found);
#endif /* !JERRY_NDEBUG */
-#if JERRY_ESNEXT
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type != LEXER_RIGHT_PAREN)
{
@@ -2061,12 +1935,10 @@ parser_parse_try_statement_end (parser_context_t *context_p) /**< context */
parser_raise_error (context_p, PARSER_ERR_LEFT_BRACE_EXPECTED);
}
}
-#if JERRY_ESNEXT
else if (context_p->token.type == LEXER_LEFT_BRACE)
{
parser_emit_cbc (context_p, CBC_POP);
}
-#endif /* JERRY_ESNEXT */
else
{
parser_raise_error (context_p, PARSER_ERR_LEFT_PAREN_EXPECTED);
@@ -2092,7 +1964,6 @@ parser_parse_try_statement_end (parser_context_t *context_p) /**< context */
try_statement.type = parser_finally_block;
parser_emit_cbc_ext_forward_branch (context_p, CBC_EXT_FINALLY, &try_statement.branch);
-#if JERRY_ESNEXT
if (context_p->next_scanner_info_p->source_p == context_p->source_p)
{
JERRY_ASSERT (context_p->next_scanner_info_p->type == SCANNER_TYPE_BLOCK);
@@ -2104,7 +1975,6 @@ parser_parse_try_statement_end (parser_context_t *context_p) /**< context */
scanner_create_variables (context_p, SCANNER_CREATE_VARS_NO_OPTS);
}
-#endif /* JERRY_ESNEXT */
}
lexer_next_token (context_p);
@@ -2326,12 +2196,8 @@ parser_parse_continue_statement (parser_context_t *context_p) /**< context */
opcode = CBC_JUMP_FORWARD_EXIT_CONTEXT;
}
-#if JERRY_ESNEXT
const bool is_private_scope =
(type == PARSER_STATEMENT_PRIVATE_SCOPE || type == PARSER_STATEMENT_PRIVATE_CONTEXT);
-#else /* !JERRY_ESNEXT */
- const bool is_private_scope = false;
-#endif /* !JERRY_ESNEXT */
if (parser_statement_flags[type] & PARSER_STATM_CONTINUE_TARGET)
{
@@ -2812,12 +2678,10 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
}
#endif /* JERRY_PARSER_DUMP_BYTE_CODE */
-#if JERRY_ESNEXT
if (strict_mode != PARSER_USE_STRICT_NOT_FOUND && (context_p->status_flags & PARSER_FUNCTION_HAS_COMPLEX_ARGUMENT))
{
parser_raise_error (context_p, PARSER_ERR_USE_STRICT_NOT_ALLOWED);
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type == LEXER_SEMICOLON)
{
@@ -2847,10 +2711,8 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
JERRY_ASSERT (context_p->stack_depth == context_p->context_stack_depth);
#endif /* !JERRY_NDEBUG */
-#if JERRY_ESNEXT
JERRY_ASSERT (context_p->stack_top_uint8 != PARSER_STATEMENT_PRIVATE_SCOPE
&& context_p->stack_top_uint8 != PARSER_STATEMENT_PRIVATE_CONTEXT);
-#endif /* JERRY_ESNEXT */
#if JERRY_DEBUGGER
if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED
@@ -2898,7 +2760,6 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
case LEXER_LEFT_BRACE:
{
-#if JERRY_ESNEXT
if (context_p->next_scanner_info_p->source_p == context_p->source_p)
{
parser_push_block_context (context_p, false);
@@ -2907,9 +2768,6 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
{
parser_stack_push_uint8 (context_p, PARSER_STATEMENT_BLOCK);
}
-#else /* !JERRY_ESNEXT */
- parser_stack_push_uint8 (context_p, PARSER_STATEMENT_BLOCK);
-#endif /* JERRY_ESNEXT */
parser_stack_iterator_init (context_p, &context_p->last_statement);
lexer_next_token (context_p);
@@ -2917,24 +2775,18 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
}
case LEXER_KEYW_VAR:
-#if JERRY_ESNEXT
case LEXER_KEYW_LET:
case LEXER_KEYW_CONST:
-#endif /* JERRY_ESNEXT */
{
parser_parse_var_statement (context_p);
break;
}
-
-#if JERRY_ESNEXT
case LEXER_KEYW_CLASS:
{
parser_validate_lexical_context (context_p);
parser_parse_class (context_p, true);
goto consume_last_statement;
}
-#endif /* JERRY_ESNEXT */
-
#if JERRY_MODULE_SYSTEM
case LEXER_KEYW_IMPORT:
{
@@ -3024,7 +2876,6 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
try_statement.type = parser_try_block;
parser_emit_cbc_ext_forward_branch (context_p, CBC_EXT_TRY_CREATE_CONTEXT, &try_statement.branch);
-#if JERRY_ESNEXT
try_statement.scope_stack_top = context_p->scope_stack_top;
try_statement.scope_stack_reg_top = context_p->scope_stack_reg_top;
@@ -3039,7 +2890,6 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
scanner_create_variables (context_p, SCANNER_CREATE_VARS_NO_OPTS);
}
-#endif /* JERRY_ESNEXT */
parser_stack_push (context_p, &try_statement, sizeof (parser_try_statement_t));
parser_stack_push_uint8 (context_p, PARSER_STATEMENT_TRY);
@@ -3090,25 +2940,21 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
{
parser_raise_error (context_p, PARSER_ERR_INVALID_RETURN);
}
-#if JERRY_ESNEXT
if (context_p->status_flags & PARSER_IS_CLASS_STATIC_BLOCK)
{
parser_raise_error (context_p, PARSER_ERR_INVALID_RETURN);
}
-#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
if ((context_p->token.flags & LEXER_WAS_NEWLINE) || context_p->token.type == LEXER_SEMICOLON
|| context_p->token.type == LEXER_EOS || context_p->token.type == LEXER_RIGHT_BRACE)
{
-#if JERRY_ESNEXT
if (context_p->status_flags & PARSER_IS_ASYNC_FUNCTION)
{
parser_emit_cbc_ext (context_p, CBC_EXT_RETURN_UNDEFINED);
break;
}
-#endif /* JERRY_ESNEXT */
parser_emit_cbc (context_p, CBC_RETURN_FUNCTION_END);
break;
@@ -3151,7 +2997,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
lexer_next_token (context_p);
continue;
}
-#if JERRY_ESNEXT
+
if (JERRY_UNLIKELY (lexer_token_is_let (context_p)))
{
if (context_p->next_scanner_info_p->source_p == context_p->source_p)
@@ -3209,7 +3055,6 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
continue;
}
}
-#endif /* JERRY_ESNEXT */
}
/* FALLTHRU */
}
@@ -3248,14 +3093,12 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
parser_stack_iterator_init (context_p, &context_p->last_statement);
lexer_next_token (context_p);
}
-#if JERRY_ESNEXT
else if (context_p->stack_top_uint8 == PARSER_STATEMENT_BLOCK_SCOPE
|| context_p->stack_top_uint8 == PARSER_STATEMENT_BLOCK_CONTEXT)
{
parser_pop_block_context (context_p);
lexer_next_token (context_p);
}
-#endif /* JERRY_ESNEXT */
else if (context_p->stack_top_uint8 == PARSER_STATEMENT_SWITCH
|| context_p->stack_top_uint8 == PARSER_STATEMENT_SWITCH_NO_DEFAULT)
{
@@ -3278,13 +3121,11 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
parser_set_breaks_to_current_position (context_p, loop.branch_list_p);
lexer_next_token (context_p);
-#if JERRY_ESNEXT
if (context_p->stack_top_uint8 == PARSER_STATEMENT_PRIVATE_SCOPE
|| context_p->stack_top_uint8 == PARSER_STATEMENT_PRIVATE_CONTEXT)
{
parser_pop_block_context (context_p);
}
-#endif /* JERRY_ESNEXT */
}
else if (context_p->stack_top_uint8 == PARSER_STATEMENT_TRY)
{
@@ -3384,17 +3225,13 @@ consume_last_statement:
}
case PARSER_STATEMENT_FOR_IN:
-#if JERRY_ESNEXT
case PARSER_STATEMENT_FOR_OF:
case PARSER_STATEMENT_FOR_AWAIT_OF:
-#endif /* JERRY_ESNEXT */
{
parser_for_in_of_statement_t for_in_of_statement;
parser_loop_statement_t loop;
-#if JERRY_ESNEXT
uint8_t for_type = context_p->stack_top_uint8;
-#endif /* JERRY_ESNEXT */
parser_stack_pop_uint8 (context_p);
parser_stack_pop (context_p, &loop, sizeof (parser_loop_statement_t));
@@ -3406,13 +3243,11 @@ consume_last_statement:
parser_flush_cbc (context_p);
uint16_t stack_allocation = PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION;
-#if JERRY_ESNEXT
if (for_type != PARSER_STATEMENT_FOR_IN)
{
stack_allocation = (for_type == PARSER_STATEMENT_FOR_OF ? PARSER_FOR_OF_CONTEXT_STACK_ALLOCATION
: PARSER_FOR_AWAIT_OF_CONTEXT_STACK_ALLOCATION);
}
-#endif /* JERRY_ESNEXT */
PARSER_MINUS_EQUAL_U16 (context_p->stack_depth, stack_allocation);
#ifndef JERRY_NDEBUG
@@ -3421,26 +3256,23 @@ consume_last_statement:
cbc_ext_opcode_t opcode = CBC_EXT_BRANCH_IF_FOR_IN_HAS_NEXT;
-#if JERRY_ESNEXT
if (for_type != PARSER_STATEMENT_FOR_IN)
{
opcode = (for_type == PARSER_STATEMENT_FOR_OF ? CBC_EXT_BRANCH_IF_FOR_OF_HAS_NEXT
: CBC_EXT_BRANCH_IF_FOR_AWAIT_OF_HAS_NEXT);
}
-#endif /* JERRY_ESNEXT */
parser_emit_cbc_ext_backward_branch (context_p, opcode, for_in_of_statement.start_offset);
parser_set_breaks_to_current_position (context_p, loop.branch_list_p);
parser_set_branch_to_current_position (context_p, &for_in_of_statement.branch);
-#if JERRY_ESNEXT
if (context_p->stack_top_uint8 == PARSER_STATEMENT_PRIVATE_SCOPE
|| context_p->stack_top_uint8 == PARSER_STATEMENT_PRIVATE_CONTEXT)
{
parser_pop_block_context (context_p);
}
-#endif /* JERRY_ESNEXT */
+
continue;
}
@@ -3531,9 +3363,7 @@ parser_free_jumps (parser_stack_iterator_t iterator) /**< iterator position */
case PARSER_STATEMENT_WHILE:
case PARSER_STATEMENT_FOR:
case PARSER_STATEMENT_FOR_IN:
-#if JERRY_ESNEXT
case PARSER_STATEMENT_FOR_OF:
-#endif /* JERRY_ESNEXT */
{
parser_loop_statement_t loop;
diff --git a/jerry-core/parser/js/js-parser-tagged-template-literal.c b/jerry-core/parser/js/js-parser-tagged-template-literal.c
index 24c4aa2f..f140526b 100644
--- a/jerry-core/parser/js/js-parser-tagged-template-literal.c
+++ b/jerry-core/parser/js/js-parser-tagged-template-literal.c
@@ -33,7 +33,6 @@
* @{
*/
-#if JERRY_ESNEXT
/**
* Append the cooked and raw string to the corresponding array
*/
@@ -154,7 +153,6 @@ parser_tagged_template_literal_finalize (ecma_object_t *template_obj_p, /**< tem
parser_tagged_template_literal_freeze_array (template_obj_p);
parser_tagged_template_literal_freeze_array (raw_strings_p);
} /* parser_tagged_template_literal_finalize */
-#endif /* JERRY_ESNEXT */
/**
* @}
diff --git a/jerry-core/parser/js/js-parser-tagged-template-literal.h b/jerry-core/parser/js/js-parser-tagged-template-literal.h
index 338c209b..9bc94938 100644
--- a/jerry-core/parser/js/js-parser-tagged-template-literal.h
+++ b/jerry-core/parser/js/js-parser-tagged-template-literal.h
@@ -31,7 +31,6 @@
#include "common.h"
#include "js-parser-internal.h"
-#if JERRY_ESNEXT
ecma_object_t *parser_new_tagged_template_literal (ecma_object_t **raw_strings_p);
void parser_tagged_template_literal_append_strings (parser_context_t *context_p,
@@ -40,7 +39,6 @@ void parser_tagged_template_literal_append_strings (parser_context_t *context_p,
uint32_t prop_index);
void parser_tagged_template_literal_finalize (ecma_object_t *template_obj_p, ecma_object_t *raw_strings_p);
-#endif /* JERRY_ESNEXT */
#endif /* ECMA_TAGGED_TEMPLATE_LITERAL_H */
diff --git a/jerry-core/parser/js/js-parser-util.c b/jerry-core/parser/js/js-parser-util.c
index 95aaf36b..c3ba131d 100644
--- a/jerry-core/parser/js/js-parser-util.c
+++ b/jerry-core/parser/js/js-parser-util.c
@@ -752,8 +752,6 @@ parser_set_continues_to_current_position (parser_context_t *context_p, /**< cont
}
} /* parser_set_continues_to_current_position */
-#if JERRY_ESNEXT
-
/**
* Return the size of internal record corresponding to a class field
*
@@ -867,8 +865,6 @@ parser_reverse_class_fields (parser_context_t *context_p, /**< context */
parser_free (data_p, fields_size);
} /* parser_reverse_class_fields */
-#endif /* JERRY_ESNEXT */
-
/**
* @}
* @}
diff --git a/jerry-core/parser/js/js-parser.c b/jerry-core/parser/js/js-parser.c
index c9b6fa58..17a2b1c4 100644
--- a/jerry-core/parser/js/js-parser.c
+++ b/jerry-core/parser/js/js-parser.c
@@ -29,14 +29,12 @@
JERRY_STATIC_ASSERT ((int) ECMA_PARSE_STRICT_MODE == (int) PARSER_IS_STRICT,
ecma_parse_strict_mode_must_be_equal_to_parser_is_strict);
-#if JERRY_ESNEXT
JERRY_STATIC_ASSERT (PARSER_SAVE_STATUS_FLAGS (PARSER_ALLOW_SUPER) == 0x1, incorrect_saving_of_ecma_parse_allow_super);
JERRY_STATIC_ASSERT (PARSER_RESTORE_STATUS_FLAGS (ECMA_PARSE_ALLOW_SUPER) == PARSER_ALLOW_SUPER,
incorrect_restoring_of_ecma_parse_allow_super);
JERRY_STATIC_ASSERT (PARSER_RESTORE_STATUS_FLAGS (ECMA_PARSE_FUNCTION_CONTEXT) == 0,
ecma_parse_function_context_must_not_be_transformed);
-#endif /* JERRY_ESNEXT */
/** \addtogroup parser Parser
* @{
@@ -590,7 +588,6 @@ parser_post_processing (parser_context_t *context_p) /**< context */
ecma_value_t *literal_pool_p;
uint8_t *dst_p;
-#if JERRY_ESNEXT
if ((context_p->status_flags & (PARSER_IS_FUNCTION | PARSER_LEXICAL_BLOCK_NEEDED))
== (PARSER_IS_FUNCTION | PARSER_LEXICAL_BLOCK_NEEDED))
{
@@ -629,7 +626,6 @@ parser_post_processing (parser_context_t *context_p) /**< context */
JERRY_ASSERT (!(context_p->status_flags & PARSER_NO_END_LABEL));
}
-#endif /* JERRY_ESNEXT */
#if JERRY_LINE_INFO
JERRY_ASSERT (context_p->line_info_p != NULL);
@@ -867,12 +863,10 @@ parser_post_processing (parser_context_t *context_p) /**< context */
{
context_p->status_flags &= (uint32_t) ~PARSER_NO_END_LABEL;
-#if JERRY_ESNEXT
if (PARSER_IS_NORMAL_ASYNC_FUNCTION (context_p->status_flags))
{
length++;
}
-#endif /* JERRY_ESNEXT */
length++;
}
@@ -896,7 +890,6 @@ parser_post_processing (parser_context_t *context_p) /**< context */
total_size += context_p->argument_count * sizeof (ecma_value_t);
}
-#if JERRY_ESNEXT
/* function.name */
if (!(context_p->status_flags & PARSER_CLASS_CONSTRUCTOR))
{
@@ -907,24 +900,17 @@ parser_post_processing (parser_context_t *context_p) /**< context */
{
total_size += sizeof (ecma_value_t);
}
-#endif /* JERRY_ESNEXT */
#if JERRY_LINE_INFO
total_size += sizeof (ecma_value_t);
#endif /* JERRY_LINE_INFO */
-
-#if JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING
uint8_t extended_info = 0;
-#endif /* JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING */
-#if JERRY_ESNEXT
if (context_p->argument_length != UINT16_MAX)
{
extended_info |= CBC_EXTENDED_CODE_FLAGS_HAS_ARGUMENT_LENGTH;
total_size += ecma_extended_info_get_encoded_length (context_p->argument_length);
}
-#endif /* JERRY_ESNEXT */
-
#if JERRY_FUNCTION_TO_STRING
if (context_p->last_context_p != NULL)
{
@@ -946,16 +932,12 @@ parser_post_processing (parser_context_t *context_p) /**< context */
total_size += ecma_extended_info_get_encoded_length ((uint32_t) (context_p->function_end_p - function_start_p));
}
#endif /* JERRY_FUNCTION_TO_STRING */
-
-#if JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING
if (extended_info != 0)
{
total_size += sizeof (uint8_t);
}
-#endif /* JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING */
total_size = JERRY_ALIGNUP (total_size, JMEM_ALIGNMENT);
-
compiled_code_p = (ecma_compiled_code_t *) parser_malloc (context_p, total_size);
#if JERRY_SNAPSHOT_SAVE || JERRY_PARSER_DUMP_BYTE_CODE
@@ -972,13 +954,11 @@ parser_post_processing (parser_context_t *context_p) /**< context */
compiled_code_p->refs = 1;
compiled_code_p->status_flags = 0;
-#if JERRY_ESNEXT
if (context_p->status_flags & PARSER_FUNCTION_HAS_REST_PARAM)
{
JERRY_ASSERT (context_p->argument_count > 0);
context_p->argument_count--;
}
-#endif /* JERRY_ESNEXT */
if (needs_uint16_arguments)
{
@@ -1050,7 +1030,6 @@ parser_post_processing (parser_context_t *context_p) /**< context */
{
function_type = CBC_FUNCTION_TO_TYPE_BITS (CBC_FUNCTION_SCRIPT);
}
-#if JERRY_ESNEXT
else if (context_p->status_flags & PARSER_IS_ARROW_FUNCTION)
{
if (context_p->status_flags & PARSER_IS_ASYNC_FUNCTION)
@@ -1091,7 +1070,6 @@ parser_post_processing (parser_context_t *context_p) /**< context */
JERRY_ASSERT (!(context_p->status_flags & PARSER_IS_FUNCTION));
compiled_code_p->status_flags |= CBC_CODE_FLAGS_LEXICAL_BLOCK_NEEDED;
}
-#endif /* JERRY_ESNEXT */
compiled_code_p->status_flags |= function_type;
@@ -1266,14 +1244,12 @@ parser_post_processing (parser_context_t *context_p) /**< context */
{
*dst_p++ = CBC_RETURN_FUNCTION_END;
-#if JERRY_ESNEXT
if (PARSER_IS_NORMAL_ASYNC_FUNCTION (context_p->status_flags))
{
dst_p[-1] = CBC_EXT_OPCODE;
dst_p[0] = CBC_EXT_ASYNC_EXIT;
dst_p++;
}
-#endif /* JERRY_ESNEXT */
}
JERRY_ASSERT (dst_p == byte_code_p + length);
@@ -1345,7 +1321,6 @@ parser_post_processing (parser_context_t *context_p) /**< context */
}
}
-#if JERRY_ESNEXT
if (!(context_p->status_flags & PARSER_CLASS_CONSTRUCTOR))
{
*(--base_p) = ecma_make_magic_string_value (LIT_MAGIC_STRING__EMPTY);
@@ -1356,13 +1331,11 @@ parser_post_processing (parser_context_t *context_p) /**< context */
compiled_code_p->status_flags |= CBC_CODE_FLAGS_HAS_TAGGED_LITERALS;
*(--base_p) = (ecma_value_t) context_p->tagged_template_literal_cp;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_LINE_INFO
ECMA_SET_INTERNAL_VALUE_POINTER (base_p[-1], line_info_p);
#endif /* JERRY_LINE_INFO */
-#if JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING
if (extended_info != 0)
{
#if JERRY_LINE_INFO
@@ -1374,12 +1347,10 @@ parser_post_processing (parser_context_t *context_p) /**< context */
compiled_code_p->status_flags |= CBC_CODE_FLAGS_HAS_EXTENDED_INFO;
*extended_info_p = extended_info;
-#if JERRY_ESNEXT
if (context_p->argument_length != UINT16_MAX)
{
ecma_extended_info_encode_vlq (&extended_info_p, context_p->argument_length);
}
-#endif /* JERRY_ESNEXT */
#if JERRY_FUNCTION_TO_STRING
if (context_p->last_context_p != NULL)
@@ -1398,7 +1369,6 @@ parser_post_processing (parser_context_t *context_p) /**< context */
}
#endif /* JERRY_FUNCTION_TO_STRING */
}
-#endif /* JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING */
#if JERRY_PARSER_DUMP_BYTE_CODE
if (context_p->is_show_opcodes)
@@ -1422,7 +1392,6 @@ parser_post_processing (parser_context_t *context_p) /**< context */
#undef PARSER_NEXT_BYTE
#undef PARSER_NEXT_BYTE_UPDATE
-#if JERRY_ESNEXT
/**
* Resolve private identifier in direct eval context
*/
@@ -1589,7 +1558,6 @@ parser_restore_private_context (parser_context_t *context_p, /**< context */
scanner_release_private_fields (context_p->private_context_p->members_p);
context_p->private_context_p = private_ctx_p->prev_p;
} /* parser_restore_private_context */
-#endif /* JERRY_ESNEXT */
/**
* Free identifiers and literals.
@@ -1618,7 +1586,6 @@ parser_parse_function_arguments (parser_context_t *context_p, /**< context */
{
JERRY_ASSERT (context_p->next_scanner_info_p->type == SCANNER_TYPE_FUNCTION);
-#if JERRY_ESNEXT
JERRY_ASSERT (context_p->status_flags & PARSER_IS_FUNCTION);
JERRY_ASSERT (!(context_p->status_flags & PARSER_LEXICAL_BLOCK_NEEDED));
@@ -1634,11 +1601,9 @@ parser_parse_function_arguments (parser_context_t *context_p, /**< context */
context_p->context_stack_depth = PARSER_TRY_CONTEXT_STACK_ALLOCATION;
#endif /* !JERRY_NDEBUG */
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type == end_type)
{
-#if JERRY_ESNEXT
context_p->status_flags &= (uint32_t) ~PARSER_DISALLOW_AWAIT_YIELD;
if (context_p->status_flags & PARSER_IS_GENERATOR_FUNCTION)
@@ -1649,26 +1614,21 @@ parser_parse_function_arguments (parser_context_t *context_p, /**< context */
scanner_create_variables (context_p, SCANNER_CREATE_VARS_IS_FUNCTION_BODY);
return;
}
-#endif /* JERRY_ESNEXT */
+
scanner_create_variables (context_p, SCANNER_CREATE_VARS_NO_OPTS);
return;
}
-#if JERRY_ESNEXT
bool has_complex_argument = (context_p->next_scanner_info_p->u8_arg & SCANNER_FUNCTION_HAS_COMPLEX_ARGUMENT) != 0;
-#endif /* JERRY_ESNEXT */
bool is_strict = (context_p->next_scanner_info_p->u8_arg & SCANNER_FUNCTION_IS_STRICT) != 0;
scanner_create_variables (context_p, SCANNER_CREATE_VARS_IS_FUNCTION_ARGS);
scanner_set_active (context_p);
-#if JERRY_ESNEXT
context_p->status_flags |= PARSER_FUNCTION_IS_PARSING_ARGS;
-#endif /* JERRY_ESNEXT */
while (true)
{
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_THREE_DOTS)
{
if (context_p->status_flags & PARSER_IS_PROPERTY_SETTER)
@@ -1771,7 +1731,6 @@ parser_parse_function_arguments (parser_context_t *context_p, /**< context */
}
continue;
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type != LEXER_LITERAL || context_p->token.lit_location.type != LEXER_IDENT_LITERAL)
{
@@ -1787,14 +1746,12 @@ parser_parse_function_arguments (parser_context_t *context_p, /**< context */
if (JERRY_UNLIKELY (context_p->lit_object.literal_p->status_flags & LEXER_FLAG_FUNCTION_ARGUMENT))
{
-#if JERRY_ESNEXT
if ((context_p->status_flags & PARSER_FUNCTION_HAS_COMPLEX_ARGUMENT)
|| (context_p->status_flags & PARSER_IS_ARROW_FUNCTION))
{
parser_raise_error (context_p, PARSER_ERR_DUPLICATED_ARGUMENT_NAMES);
}
has_duplicated_arg_names = true;
-#endif /* JERRY_ESNEXT */
context_p->status_flags |= PARSER_HAS_NON_STRICT_ARG;
}
@@ -1805,7 +1762,6 @@ parser_parse_function_arguments (parser_context_t *context_p, /**< context */
lexer_next_token (context_p);
-#if JERRY_ESNEXT
uint16_t literal_index = context_p->lit_object.index;
if (context_p->token.type == LEXER_ASSIGN)
@@ -1887,7 +1843,6 @@ parser_parse_function_arguments (parser_context_t *context_p, /**< context */
(uint16_t) (PARSER_REGISTER_START + context_p->argument_count),
literal_index);
}
-#endif /* JERRY_ESNEXT */
context_p->argument_count++;
if (context_p->argument_count >= PARSER_MAXIMUM_NUMBER_OF_REGISTERS)
@@ -1907,26 +1862,21 @@ parser_parse_function_arguments (parser_context_t *context_p, /**< context */
break;
}
-#if JERRY_ESNEXT
if (context_p->status_flags & PARSER_FUNCTION_HAS_REST_PARAM)
{
parser_raise_error (context_p, PARSER_ERR_FORMAL_PARAM_AFTER_REST_PARAMETER);
}
-#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
-#if JERRY_ESNEXT
if (context_p->token.type == end_type)
{
break;
}
-#endif /* JERRY_ESNEXT */
}
scanner_revert_active (context_p);
-#if JERRY_ESNEXT
JERRY_ASSERT (has_complex_argument || !(context_p->status_flags & PARSER_FUNCTION_HAS_COMPLEX_ARGUMENT));
if (context_p->status_flags & PARSER_IS_GENERATOR_FUNCTION)
@@ -1957,8 +1907,6 @@ parser_parse_function_arguments (parser_context_t *context_p, /**< context */
}
context_p->status_flags &= (uint32_t) ~(PARSER_DISALLOW_AWAIT_YIELD | PARSER_FUNCTION_IS_PARSING_ARGS);
-#endif /* JERRY_ESNEXT */
-
scanner_create_variables (context_p, SCANNER_CREATE_VARS_IS_FUNCTION_BODY);
if (is_strict)
@@ -2044,10 +1992,8 @@ parser_parse_source (void *source_p, /**< source code */
context.status_flags = parse_opts & PARSER_STRICT_MODE_MASK;
context.global_status_flags = parse_opts;
-#if JERRY_ESNEXT
context.status_flags |= PARSER_RESTORE_STATUS_FLAGS (parse_opts);
context.tagged_template_literal_cp = JMEM_CP_NULL;
-#endif /* JERRY_ESNEXT */
context.stack_depth = 0;
context.stack_limit = 0;
@@ -2081,7 +2027,7 @@ parser_parse_source (void *source_p, /**< source code */
JERRY_ASSERT (ecma_is_value_string (context.argument_list));
context.status_flags |= PARSER_IS_FUNCTION;
-#if JERRY_ESNEXT
+
if (parse_opts & ECMA_PARSE_GENERATOR_FUNCTION)
{
context.status_flags |= PARSER_IS_GENERATOR_FUNCTION;
@@ -2090,7 +2036,6 @@ parser_parse_source (void *source_p, /**< source code */
{
context.status_flags |= PARSER_IS_ASYNC_FUNCTION;
}
-#endif /* JERRY_ESNEXT */
ecma_string_t *string_p = ecma_get_string_from_value (context.argument_list);
uint8_t flags = ECMA_STRING_FLAG_EMPTY;
@@ -2179,9 +2124,7 @@ parser_parse_source (void *source_p, /**< source code */
context.last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
context.argument_count = 0;
-#if JERRY_ESNEXT
context.argument_length = UINT16_MAX;
-#endif /* JERRY_ESNEXT */
context.register_count = 0;
context.literal_count = 0;
@@ -2194,11 +2137,9 @@ parser_parse_source (void *source_p, /**< source code */
context.scope_stack_size = 0;
context.scope_stack_top = 0;
context.scope_stack_reg_top = 0;
-#if JERRY_ESNEXT
context.scope_stack_global_end = 0;
context.tagged_template_literal_cp = JMEM_CP_NULL;
context.private_context_p = NULL;
-#endif /* JERRY_ESNEXT */
#ifndef JERRY_NDEBUG
context.context_stack_depth = 0;
@@ -2323,7 +2264,6 @@ parser_parse_source (void *source_p, /**< source code */
JERRY_ASSERT (context.next_scanner_info_p->source_p == context.source_start_p
&& context.next_scanner_info_p->type == SCANNER_TYPE_FUNCTION);
-#if JERRY_ESNEXT
if (scanner_is_context_needed (&context, PARSER_CHECK_GLOBAL_CONTEXT))
{
context.status_flags |= PARSER_LEXICAL_BLOCK_NEEDED;
@@ -2333,7 +2273,6 @@ parser_parse_source (void *source_p, /**< source code */
{
scanner_check_variables (&context);
}
-#endif /* JERRY_ESNEXT */
scanner_create_variables (&context, SCANNER_CREATE_VARS_IS_SCRIPT);
}
@@ -2578,12 +2517,10 @@ parser_save_context (parser_context_t *context_p, /**< context */
}
#endif /* JERRY_DEBUGGER */
-#if JERRY_ESNEXT
if (context_p->status_flags & PARSER_FUNCTION_IS_PARSING_ARGS)
{
context_p->status_flags |= PARSER_LEXICAL_BLOCK_NEEDED;
}
-#endif /* JERRY_ESNEXT */
/* Save private part of the context. */
@@ -2594,9 +2531,7 @@ parser_save_context (parser_context_t *context_p, /**< context */
saved_context_p->last_statement = context_p->last_statement;
saved_context_p->argument_count = context_p->argument_count;
-#if JERRY_ESNEXT
saved_context_p->argument_length = context_p->argument_length;
-#endif /* JERRY_ESNEXT */
saved_context_p->register_count = context_p->register_count;
saved_context_p->literal_count = context_p->literal_count;
@@ -2607,10 +2542,8 @@ parser_save_context (parser_context_t *context_p, /**< context */
saved_context_p->scope_stack_size = context_p->scope_stack_size;
saved_context_p->scope_stack_top = context_p->scope_stack_top;
saved_context_p->scope_stack_reg_top = context_p->scope_stack_reg_top;
-#if JERRY_ESNEXT
saved_context_p->scope_stack_global_end = context_p->scope_stack_global_end;
saved_context_p->tagged_template_literal_cp = context_p->tagged_template_literal_cp;
-#endif /* JERRY_ESNEXT */
#ifndef JERRY_NDEBUG
saved_context_p->context_stack_depth = context_p->context_stack_depth;
@@ -2633,9 +2566,7 @@ parser_save_context (parser_context_t *context_p, /**< context */
context_p->last_statement.current_p = NULL;
context_p->argument_count = 0;
-#if JERRY_ESNEXT
context_p->argument_length = UINT16_MAX;
-#endif /* JERRY_ESNEXT */
context_p->register_count = 0;
context_p->literal_count = 0;
@@ -2646,10 +2577,8 @@ parser_save_context (parser_context_t *context_p, /**< context */
context_p->scope_stack_size = 0;
context_p->scope_stack_top = 0;
context_p->scope_stack_reg_top = 0;
-#if JERRY_ESNEXT
context_p->scope_stack_global_end = 0;
context_p->tagged_template_literal_cp = JMEM_CP_NULL;
-#endif /* JERRY_ESNEXT */
#ifndef JERRY_NDEBUG
context_p->context_stack_depth = 0;
@@ -2689,9 +2618,7 @@ parser_restore_context (parser_context_t *context_p, /**< context */
context_p->last_statement = saved_context_p->last_statement;
context_p->argument_count = saved_context_p->argument_count;
-#if JERRY_ESNEXT
context_p->argument_length = saved_context_p->argument_length;
-#endif /* JERRY_ESNEXT */
context_p->register_count = saved_context_p->register_count;
context_p->literal_count = saved_context_p->literal_count;
@@ -2702,10 +2629,8 @@ parser_restore_context (parser_context_t *context_p, /**< context */
context_p->scope_stack_size = saved_context_p->scope_stack_size;
context_p->scope_stack_top = saved_context_p->scope_stack_top;
context_p->scope_stack_reg_top = saved_context_p->scope_stack_reg_top;
-#if JERRY_ESNEXT
context_p->scope_stack_global_end = saved_context_p->scope_stack_global_end;
context_p->tagged_template_literal_cp = saved_context_p->tagged_template_literal_cp;
-#endif /* JERRY_ESNEXT */
#ifndef JERRY_NDEBUG
context_p->context_stack_depth = saved_context_p->context_stack_depth;
@@ -2731,19 +2656,13 @@ parser_parse_function (parser_context_t *context_p, /**< context */
JERRY_ASSERT (status_flags & PARSER_IS_FUNCTION);
parser_save_context (context_p, &saved_context);
context_p->status_flags |= status_flags;
-#if JERRY_ESNEXT
context_p->status_flags |= PARSER_ALLOW_NEW_TARGET;
-#endif /* JERRY_ESNEXT */
#if JERRY_PARSER_DUMP_BYTE_CODE
if (context_p->is_show_opcodes)
{
-#if JERRY_ESNEXT
JERRY_DEBUG_MSG ("\n--- %s parsing start ---\n\n",
(context_p->status_flags & PARSER_CLASS_CONSTRUCTOR) ? "Class constructor" : "Function");
-#else /* !JERRY_ESNEXT */
- JERRY_DEBUG_MSG ("\n--- Function parsing start ---\n\n");
-#endif /* JERRY_ESNEXT */
}
#endif /* JERRY_PARSER_DUMP_BYTE_CODE */
@@ -2776,13 +2695,11 @@ parser_parse_function (parser_context_t *context_p, /**< context */
parser_raise_error (context_p, PARSER_ERR_ONE_ARGUMENT_EXPECTED);
}
-#if JERRY_ESNEXT
if ((context_p->status_flags & (PARSER_CLASS_CONSTRUCTOR | PARSER_ALLOW_SUPER_CALL)) == PARSER_CLASS_CONSTRUCTOR)
{
parser_emit_cbc_ext (context_p, CBC_EXT_RUN_FIELD_INIT);
parser_flush_cbc (context_p);
}
-#endif /* JERRY_ESNEXT */
#if JERRY_PARSER_DUMP_BYTE_CODE
if (context_p->is_show_opcodes && (context_p->status_flags & PARSER_HAS_NON_STRICT_ARG))
@@ -2803,12 +2720,8 @@ parser_parse_function (parser_context_t *context_p, /**< context */
#if JERRY_PARSER_DUMP_BYTE_CODE
if (context_p->is_show_opcodes)
{
-#if JERRY_ESNEXT
JERRY_DEBUG_MSG ("\n--- %s parsing end ---\n\n",
(context_p->status_flags & PARSER_CLASS_CONSTRUCTOR) ? "Class constructor" : "Function");
-#else /* !JERRY_ESNEXT */
- JERRY_DEBUG_MSG ("\n--- Function parsing end ---\n\n");
-#endif /* JERRY_ESNEXT */
}
#endif /* JERRY_PARSER_DUMP_BYTE_CODE */
@@ -2817,8 +2730,6 @@ parser_parse_function (parser_context_t *context_p, /**< context */
return compiled_code_p;
} /* parser_parse_function */
-#if JERRY_ESNEXT
-
/**
* Parse static class block code
*
@@ -3330,8 +3241,6 @@ parser_compiled_code_set_function_name (parser_context_t *context_p, /**< contex
}
} /* parser_compiled_code_set_function_name */
-#endif /* JERRY_ESNEXT */
-
/**
* Raise a parse error.
*/
@@ -3367,14 +3276,12 @@ parser_raise_error (parser_context_t *context_p, /**< context */
parser_free_jumps (saved_context_p->last_statement);
}
-#if JERRY_ESNEXT
if (saved_context_p->tagged_template_literal_cp != JMEM_CP_NULL)
{
ecma_collection_t *collection =
ECMA_GET_INTERNAL_VALUE_POINTER (ecma_collection_t, saved_context_p->tagged_template_literal_cp);
ecma_collection_free_template_literal (collection);
}
-#endif /* JERRY_ESNEXT */
#if JERRY_LINE_INFO
parser_line_info_free (saved_context_p->line_info_p);
@@ -3383,7 +3290,6 @@ parser_raise_error (parser_context_t *context_p, /**< context */
saved_context_p = saved_context_p->prev_context_p;
}
-#if JERRY_ESNEXT
parser_free_private_fields (context_p);
if (context_p->tagged_template_literal_cp != JMEM_CP_NULL)
@@ -3392,7 +3298,6 @@ parser_raise_error (parser_context_t *context_p, /**< context */
ECMA_GET_INTERNAL_VALUE_POINTER (ecma_collection_t, context_p->tagged_template_literal_cp);
ecma_collection_free_template_literal (collection);
}
-#endif /* JERRY_ESNEXT */
context_p->error = error;
PARSER_THROW (context_p->try_buffer);
diff --git a/jerry-core/parser/js/js-scanner-internal.h b/jerry-core/parser/js/js-scanner-internal.h
index 169aa25f..800399dc 100644
--- a/jerry-core/parser/js/js-scanner-internal.h
+++ b/jerry-core/parser/js/js-scanner-internal.h
@@ -41,13 +41,11 @@ typedef enum
SCAN_MODE_VAR_STATEMENT, /**< scanning var statement */
SCAN_MODE_PROPERTY_NAME, /**< scanning property name */
SCAN_MODE_FUNCTION_ARGUMENTS, /**< scanning function arguments */
-#if JERRY_ESNEXT
SCAN_MODE_CONTINUE_FUNCTION_ARGUMENTS, /**< continue scanning function arguments */
SCAN_MODE_BINDING, /**< array or object binding */
SCAN_MODE_CLASS_DECLARATION, /**< scanning class declaration */
SCAN_MODE_CLASS_BODY, /**< scanning class body */
SCAN_MODE_CLASS_BODY_NO_SCAN, /**< scanning class body without calling lexer_scan_identifier */
-#endif /* JERRY_ESNEXT */
} scan_modes_t;
/**
@@ -61,9 +59,7 @@ typedef enum
SCAN_STACK_FUNCTION_STATEMENT, /**< function statement */
SCAN_STACK_FUNCTION_EXPRESSION, /**< function expression */
SCAN_STACK_FUNCTION_PROPERTY, /**< function expression in an object literal */
-#if JERRY_ESNEXT
SCAN_STACK_FUNCTION_ARROW, /**< arrow function expression */
-#endif /* JERRY_ESNEXT */
SCAN_STACK_SWITCH_BLOCK, /**< block part of "switch" statement */
SCAN_STACK_IF_STATEMENT, /**< statement part of "if" statements */
SCAN_STACK_WITH_STATEMENT, /**< statement part of "with" statements */
@@ -73,19 +69,15 @@ typedef enum
SCAN_STACK_WHILE_EXPRESSION, /**< expression part of "while" iterator */
SCAN_STACK_PAREN_EXPRESSION, /**< expression in brackets */
SCAN_STACK_STATEMENT_WITH_EXPR, /**< statement which starts with expression enclosed in brackets */
-#if JERRY_ESNEXT
SCAN_STACK_BINDING_INIT, /**< post processing after a single initializer */
SCAN_STACK_BINDING_LIST_INIT, /**< post processing after an initializer list */
SCAN_STACK_LET, /**< let statement */
SCAN_STACK_CONST, /**< const statement */
-#endif /* JERRY_ESNEXT */
/* The SCANNER_IS_FOR_START macro needs to be updated when the following constants are reordered. */
SCAN_STACK_VAR, /**< var statement */
SCAN_STACK_FOR_VAR_START, /**< start of "for" iterator with var statement */
-#if JERRY_ESNEXT
SCAN_STACK_FOR_LET_START, /**< start of "for" iterator with let statement */
SCAN_STACK_FOR_CONST_START, /**< start of "for" iterator with const statement */
-#endif /* JERRY_ESNEXT */
SCAN_STACK_FOR_START, /**< start of "for" iterator */
SCAN_STACK_FOR_CONDITION, /**< condition part of "for" iterator */
SCAN_STACK_FOR_EXPRESSION, /**< expression part of "for" iterator */
@@ -97,7 +89,6 @@ typedef enum
SCAN_STACK_ARRAY_LITERAL, /**< array literal or destructuring assignment or binding */
SCAN_STACK_OBJECT_LITERAL, /**< object literal group */
SCAN_STACK_PROPERTY_ACCESSOR, /**< property accessor in square brackets */
-#if JERRY_ESNEXT
/* These four must be in this order. */
SCAN_STACK_COMPUTED_PROPERTY, /**< computed property name */
SCAN_STACK_COMPUTED_GENERATOR, /**< computed generator function */
@@ -119,7 +110,6 @@ typedef enum
SCAN_STACK_FOR_START_PATTERN, /**< possible assignment pattern for "for" iterator */
SCAN_STACK_USE_ASYNC, /**< an "async" identifier is used */
SCAN_STACK_CLASS_STATIC_BLOCK, /**< class static block */
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
SCAN_STACK_EXPORT_DEFAULT, /**< scan primary expression after export default */
#endif /* JERRY_MODULE_SYSTEM */
@@ -131,9 +121,7 @@ typedef enum
typedef enum
{
SCANNER_CONTEXT_NO_FLAGS = 0, /**< no flags are set */
-#if JERRY_ESNEXT
SCANNER_CONTEXT_THROW_ERR_ASYNC_FUNCTION = (1 << 0), /**< throw async function error */
-#endif /* JERRY_ESNEXT */
#if JERRY_DEBUGGER
SCANNER_CONTEXT_DEBUGGER_ENABLED = (1 << 1), /**< debugger is enabled */
#endif /* JERRY_DEBUGGER */
@@ -167,24 +155,18 @@ typedef enum
{
SCANNER_LITERAL_IS_ARG = (1 << 0), /**< literal is argument */
SCANNER_LITERAL_IS_VAR = (1 << 1), /**< literal is var */
-#if JERRY_ESNEXT
/** literal is a destructured argument binding of a possible arrow function */
SCANNER_LITERAL_IS_ARROW_DESTRUCTURED_ARG = SCANNER_LITERAL_IS_VAR,
-#endif /* JERRY_ESNEXT */
SCANNER_LITERAL_IS_FUNC = (1 << 2), /**< literal is function */
SCANNER_LITERAL_NO_REG = (1 << 3), /**< literal cannot be stored in a register */
SCANNER_LITERAL_IS_LET = (1 << 4), /**< literal is let */
-#if JERRY_ESNEXT
/** literal is a function declared in this block (prevents declaring let/const with the same name) */
SCANNER_LITERAL_IS_FUNC_DECLARATION = SCANNER_LITERAL_IS_LET,
-#endif /* JERRY_ESNEXT */
SCANNER_LITERAL_IS_CONST = (1 << 5), /**< literal is const */
-#if JERRY_ESNEXT
/** literal is a destructured argument binding */
SCANNER_LITERAL_IS_DESTRUCTURED_ARG = SCANNER_LITERAL_IS_CONST,
SCANNER_LITERAL_IS_USED = (1 << 6), /**< literal is used */
SCANNER_LITERAL_EARLY_CREATE = (1 << 7), /**< binding should be created early with ECMA_VALUE_UNINITIALIZED */
-#endif /* JERRY_ESNEXT */
} scanner_literal_type_flags_t;
/*
@@ -233,8 +215,6 @@ typedef struct
scanner_case_info_t **last_case_p; /**< last case info */
} scanner_switch_statement_t;
-#if JERRY_ESNEXT
-
/**
* Types of scanner destructuring bindings.
*/
@@ -274,35 +254,27 @@ typedef struct scanner_binding_list_t
bool is_nested; /**< is nested binding declaration */
} scanner_binding_list_t;
-#endif /* JERRY_ESNEXT */
-
/**
* Flags for scanner_literal_pool_t structure.
*/
typedef enum
{
SCANNER_LITERAL_POOL_FUNCTION = (1 << 0), /**< literal pool represents a function */
-#if JERRY_ESNEXT
SCANNER_LITERAL_POOL_CLASS_NAME = (1 << 1), /**< literal pool which contains a class name */
SCANNER_LITERAL_POOL_CLASS_FIELD = (1 << 2), /**< literal pool is created for a class field initializer */
-#endif /* JERRY_ESNEXT */
SCANNER_LITERAL_POOL_IS_STRICT = (1 << 3), /**< literal pool represents a strict mode code block */
SCANNER_LITERAL_POOL_CAN_EVAL = (1 << 4), /**< prepare for executing eval in this block */
SCANNER_LITERAL_POOL_NO_ARGUMENTS = (1 << 5), /**< arguments object must not be constructed,
* or arguments cannot be stored in registers if
* SCANNER_LITERAL_POOL_ARGUMENTS_IN_ARGS is set */
-#if JERRY_ESNEXT
SCANNER_LITERAL_POOL_ARGUMENTS_IN_ARGS = (1 << 6), /**< arguments is referenced in function args */
SCANNER_LITERAL_POOL_HAS_COMPLEX_ARGUMENT = (1 << 7), /**< function has complex (ES2015+) argument definition */
-#endif /* JERRY_ESNEXT */
SCANNER_LITERAL_POOL_IN_WITH = (1 << 8), /**< literal pool is in a with statement */
-#if JERRY_ESNEXT
SCANNER_LITERAL_POOL_ARROW = (1 << 9), /**< arrow function */
SCANNER_LITERAL_POOL_GENERATOR = (1 << 10), /**< generator function */
SCANNER_LITERAL_POOL_ASYNC = (1 << 11), /**< async function */
SCANNER_LITERAL_POOL_FUNCTION_STATEMENT = (1 << 12), /**< function statement */
SCANNER_LITERAL_POOL_HAS_SUPER_REFERENCE = (1 << 13), /**< function body contains super reference */
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
SCANNER_LITERAL_POOL_IN_EXPORT = (1 << 14), /**< the declared variables are exported by the module system */
#endif /* JERRY_MODULE_SYSTEM */
@@ -331,23 +303,12 @@ typedef enum
*/
#define SCANNER_FROM_COMPUTED_TO_LITERAL_POOL(mode) (((mode) -SCAN_STACK_COMPUTED_PROPERTY) << 10)
-#if JERRY_ESNEXT
-
/**
* Literal pool which may contains function argument identifiers
*/
#define SCANNER_LITERAL_POOL_MAY_HAVE_ARGUMENTS(status_flags) \
(!((status_flags) & (SCANNER_LITERAL_POOL_CLASS_NAME | SCANNER_LITERAL_POOL_CLASS_FIELD)))
-#else /* !JERRY_ESNEXT */
-
-/**
- * Literal pool which may contains function argument identifiers
- */
-#define SCANNER_LITERAL_POOL_MAY_HAVE_ARGUMENTS(status_flags) true
-
-#endif /* JERRY_ESNEXT */
-
/**
* Local literal pool.
*/
@@ -367,27 +328,19 @@ struct scanner_context_t
{
uint32_t context_status_flags; /**< original status flags of the context */
uint8_t mode; /**< scanner mode */
-#if JERRY_ESNEXT
uint8_t binding_type; /**< current destructuring binding type */
-#endif /* JERRY_ESNEXT */
uint16_t status_flags; /**< scanner status flags */
-#if JERRY_ESNEXT
scanner_binding_list_t *active_binding_list_p; /**< currently active binding list */
-#endif /* JERRY_ESNEXT */
scanner_literal_pool_t *active_literal_pool_p; /**< currently active literal pool */
scanner_switch_statement_t active_switch_statement; /**< currently active switch statement */
scanner_info_t *end_arguments_p; /**< position of end arguments */
-#if JERRY_ESNEXT
const uint8_t *async_source_p; /**< source position for async functions */
-#endif /* JERRY_ESNEXT */
};
/* Scanner utils. */
void scanner_raise_error (parser_context_t *context_p);
-#if JERRY_ESNEXT
void scanner_raise_redeclaration_error (parser_context_t *context_p);
-#endif /* JERRY_ESNEXT */
void *scanner_malloc (parser_context_t *context_p, size_t size);
void scanner_free (void *ptr, size_t size);
@@ -401,10 +354,8 @@ scanner_info_t *scanner_insert_info_before (parser_context_t *context_p,
scanner_literal_pool_t *
scanner_push_literal_pool (parser_context_t *context_p, scanner_context_t *scanner_context_p, uint16_t status_flags);
void scanner_pop_literal_pool (parser_context_t *context_p, scanner_context_t *scanner_context_p);
-#if JERRY_ESNEXT
void scanner_filter_arguments (parser_context_t *context_p, scanner_context_t *scanner_context_p);
void scanner_construct_global_block (parser_context_t *context_p, scanner_context_t *scanner_context_p);
-#endif /* JERRY_ESNEXT */
lexer_lit_location_t *scanner_add_custom_literal (parser_context_t *context_p,
scanner_literal_pool_t *literal_pool_p,
const lexer_lit_location_t *literal_location_p);
@@ -412,15 +363,12 @@ lexer_lit_location_t *scanner_add_literal (parser_context_t *context_p, scanner_
void scanner_add_reference (parser_context_t *context_p, scanner_context_t *scanner_context_p);
lexer_lit_location_t *scanner_append_argument (parser_context_t *context_p, scanner_context_t *scanner_context_p);
void scanner_add_private_identifier (parser_context_t *context_p, scanner_private_field_flags_t opts);
-#if JERRY_ESNEXT
void scanner_detect_invalid_var (parser_context_t *context_p,
scanner_context_t *scanner_context_p,
lexer_lit_location_t *var_literal_p);
void scanner_detect_invalid_let (parser_context_t *context_p, lexer_lit_location_t *let_literal_p);
-#endif /* JERRY_ESNEXT */
void scanner_detect_eval_call (parser_context_t *context_p, scanner_context_t *scanner_context_p);
-#if JERRY_ESNEXT
lexer_lit_location_t *
scanner_push_class_declaration (parser_context_t *context_p, scanner_context_t *scanner_context_p, uint8_t stack_mode);
void scanner_push_class_field_initializer (parser_context_t *context_p, scanner_context_t *scanner_context_p);
@@ -430,11 +378,9 @@ void scanner_push_destructuring_pattern (parser_context_t *context_p,
bool is_nested);
void scanner_pop_binding_list (scanner_context_t *scanner_context_p);
void scanner_append_hole (parser_context_t *context_p, scanner_context_t *scanner_context_p);
-#endif /* JERRY_ESNEXT */
/* Scanner operations. */
-#if JERRY_ESNEXT
void scanner_add_async_literal (parser_context_t *context_p, scanner_context_t *scanner_context_p);
void scanner_check_arrow (parser_context_t *context_p, scanner_context_t *scanner_context_p);
void
@@ -442,7 +388,6 @@ scanner_scan_simple_arrow (parser_context_t *context_p, scanner_context_t *scann
void scanner_check_arrow_arg (parser_context_t *context_p, scanner_context_t *scanner_context_p);
bool scanner_check_async_function (parser_context_t *context_p, scanner_context_t *scanner_context_p);
void scanner_check_function_after_if (parser_context_t *context_p, scanner_context_t *scanner_context_p);
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
void scanner_check_import_meta (parser_context_t *context_p);
#endif /* JERRY_MODULE_SYSTEM */
diff --git a/jerry-core/parser/js/js-scanner-ops.c b/jerry-core/parser/js/js-scanner-ops.c
index 1bb1bd92..98dadc0f 100644
--- a/jerry-core/parser/js/js-scanner-ops.c
+++ b/jerry-core/parser/js/js-scanner-ops.c
@@ -29,8 +29,6 @@
* @{
*/
-#if JERRY_ESNEXT
-
/**
* Add the "async" literal to the literal pool.
*/
@@ -242,9 +240,7 @@ scanner_check_arrow_arg (parser_context_t *context_p, /**< context */
if (context_p->token.type == LEXER_LEFT_BRACE)
{
-#if JERRY_ESNEXT
parser_stack_push_uint8 (context_p, 0);
-#endif /* JERRY_ESNEXT */
parser_stack_push_uint8 (context_p, SCAN_STACK_OBJECT_LITERAL);
scanner_context_p->mode = SCAN_MODE_PROPERTY_NAME;
return;
@@ -352,8 +348,6 @@ scanner_check_function_after_if (parser_context_t *context_p, /**< context */
}
} /* scanner_check_function_after_if */
-#endif /* JERRY_ESNEXT */
-
#if JERRY_MODULE_SYSTEM
/**
@@ -378,8 +372,6 @@ scanner_check_import_meta (parser_context_t *context_p) /**< context */
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_ESNEXT
-
/**
* Arrow types for scanner_scan_bracket() function.
*/
@@ -390,8 +382,6 @@ typedef enum
SCANNER_SCAN_BRACKET_ARROW_WITH_ONE_ARG, /**< arrow function with one argument */
} scanner_scan_bracket_arrow_type_t;
-#endif /* JERRY_ESNEXT */
-
/**
* Scan bracketed expressions.
*/
@@ -400,19 +390,15 @@ scanner_scan_bracket (parser_context_t *context_p, /**< context */
scanner_context_t *scanner_context_p) /**< scanner context */
{
size_t depth = 0;
-#if JERRY_ESNEXT
const uint8_t *arrow_source_p;
const uint8_t *async_source_p = NULL;
scanner_scan_bracket_arrow_type_t arrow_type = SCANNER_SCAN_BRACKET_NO_ARROW;
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (context_p->token.type == LEXER_LEFT_PAREN);
do
{
-#if JERRY_ESNEXT
arrow_source_p = context_p->source_p;
-#endif /* JERRY_ESNEXT */
depth++;
lexer_next_token (context_p);
} while (context_p->token.type == LEXER_LEFT_PAREN);
@@ -425,13 +411,10 @@ scanner_scan_bracket (parser_context_t *context_p, /**< context */
{
if (context_p->token.lit_location.type != LEXER_IDENT_LITERAL)
{
-#if JERRY_ESNEXT
arrow_source_p = NULL;
-#endif /* JERRY_ESNEXT */
break;
}
-#if JERRY_ESNEXT
const uint8_t *source_p = context_p->source_p;
if (lexer_check_arrow (context_p))
@@ -442,7 +425,6 @@ scanner_scan_bracket (parser_context_t *context_p, /**< context */
}
size_t total_depth = depth;
-#endif /* JERRY_ESNEXT */
while (depth > 0 && lexer_check_next_character (context_p, LIT_CHAR_RIGHT_PAREN))
{
@@ -453,19 +435,14 @@ scanner_scan_bracket (parser_context_t *context_p, /**< context */
if (context_p->token.keyword_type == LEXER_KEYW_EVAL
&& lexer_check_next_character (context_p, LIT_CHAR_LEFT_PAREN))
{
-#if JERRY_ESNEXT
/* A function call cannot be an eval function. */
arrow_source_p = NULL;
const uint16_t flags = (uint16_t) (SCANNER_LITERAL_POOL_CAN_EVAL | SCANNER_LITERAL_POOL_HAS_SUPER_REFERENCE);
-#else /* !JERRY_ESNEXT */
- const uint16_t flags = SCANNER_LITERAL_POOL_CAN_EVAL;
-#endif /* JERRY_ESNEXT */
scanner_context_p->active_literal_pool_p->status_flags |= flags;
break;
}
-#if JERRY_ESNEXT
if (total_depth == depth)
{
if (lexer_check_arrow_param (context_p))
@@ -493,10 +470,8 @@ scanner_scan_bracket (parser_context_t *context_p, /**< context */
}
arrow_source_p = NULL;
-#endif /* JERRY_ESNEXT */
break;
}
-#if JERRY_ESNEXT
case LEXER_THREE_DOTS:
case LEXER_LEFT_SQUARE:
case LEXER_LEFT_BRACE:
@@ -506,22 +481,17 @@ scanner_scan_bracket (parser_context_t *context_p, /**< context */
depth--;
break;
}
-#endif /* JERRY_ESNEXT */
default:
{
-#if JERRY_ESNEXT
arrow_source_p = NULL;
-#endif /* JERRY_ESNEXT */
break;
}
}
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (scanner_context_p->async_source_p != NULL) && (arrow_source_p == NULL || depth > 0))
{
scanner_context_p->async_source_p = NULL;
}
-#endif /* JERRY_ESNEXT */
while (depth > 0)
{
@@ -529,7 +499,6 @@ scanner_scan_bracket (parser_context_t *context_p, /**< context */
depth--;
}
-#if JERRY_ESNEXT
if (arrow_source_p != NULL)
{
JERRY_ASSERT (async_source_p == NULL);
@@ -577,7 +546,6 @@ scanner_scan_bracket (parser_context_t *context_p, /**< context */
scanner_context_p->async_source_p = async_source_p;
scanner_check_async_function (context_p, scanner_context_p);
}
-#endif /* JERRY_ESNEXT */
} /* scanner_scan_bracket */
/**
diff --git a/jerry-core/parser/js/js-scanner-util.c b/jerry-core/parser/js/js-scanner-util.c
index a6578daa..3d58a779 100644
--- a/jerry-core/parser/js/js-scanner-util.c
+++ b/jerry-core/parser/js/js-scanner-util.c
@@ -36,8 +36,6 @@
JERRY_STATIC_ASSERT (PARSER_MAXIMUM_NUMBER_OF_LITERALS + PARSER_MAXIMUM_NUMBER_OF_REGISTERS < PARSER_REGISTER_START,
maximum_number_of_literals_plus_registers_must_be_less_than_register_start);
-#if JERRY_ESNEXT
-
JERRY_STATIC_ASSERT ((SCANNER_LITERAL_IS_ARROW_DESTRUCTURED_ARG & SCANNER_LITERAL_IS_LOCAL) == 0,
is_arrow_arg_binding_flag_must_not_use_local_flags);
@@ -57,8 +55,6 @@ JERRY_STATIC_ASSERT (SCANNER_LITERAL_IS_FUNC_DECLARATION != SCANNER_LITERAL_IS_D
JERRY_STATIC_ASSERT (PARSER_SCOPE_STACK_IS_CONST_REG == PARSER_SCOPE_STACK_IS_LOCAL_CREATED,
scope_stack_is_const_reg_and_scope_stack_is_local_created_must_be_the_same);
-#endif /* JERRY_ESNEXT */
-
/**
* Raise a scanner error.
*/
@@ -70,8 +66,6 @@ scanner_raise_error (parser_context_t *context_p) /**< context */
JERRY_ASSERT (0);
} /* scanner_raise_error */
-#if JERRY_ESNEXT
-
/**
* Raise a variable redeclaration error.
*/
@@ -84,8 +78,6 @@ scanner_raise_redeclaration_error (parser_context_t *context_p) /**< context */
scanner_raise_error (context_p);
} /* scanner_raise_redeclaration_error */
-#endif /* JERRY_ESNEXT */
-
/**
* Allocate memory for scanner.
*
@@ -138,24 +130,18 @@ scanner_get_stream_size (scanner_info_t *info_p, /**< scanner info block */
switch (data_p[0] & SCANNER_STREAM_TYPE_MASK)
{
case SCANNER_STREAM_TYPE_VAR:
-#if JERRY_ESNEXT
case SCANNER_STREAM_TYPE_LET:
case SCANNER_STREAM_TYPE_CONST:
case SCANNER_STREAM_TYPE_LOCAL:
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
case SCANNER_STREAM_TYPE_IMPORT:
#endif /* JERRY_MODULE_SYSTEM */
case SCANNER_STREAM_TYPE_ARG:
-#if JERRY_ESNEXT
case SCANNER_STREAM_TYPE_ARG_VAR:
case SCANNER_STREAM_TYPE_DESTRUCTURED_ARG:
case SCANNER_STREAM_TYPE_DESTRUCTURED_ARG_VAR:
-#endif /* JERRY_MODULE_SYSTEM */
case SCANNER_STREAM_TYPE_ARG_FUNC:
-#if JERRY_ESNEXT
case SCANNER_STREAM_TYPE_DESTRUCTURED_ARG_FUNC:
-#endif /* JERRY_ESNEXT */
case SCANNER_STREAM_TYPE_FUNC:
{
break;
@@ -409,8 +395,6 @@ scanner_literal_is_arguments (lexer_lit_location_t *literal_p) /**< literal */
return lexer_compare_identifier_to_string (literal_p, (const uint8_t *) "arguments", 9);
} /* scanner_literal_is_arguments */
-#if JERRY_ESNEXT
-
/**
* Find if there is a duplicated argument in the given context
*
@@ -577,8 +561,6 @@ scanner_scope_find_lexical_declaration (parser_context_t *context_p, /**< contex
return false;
} /* scanner_scope_find_lexical_declaration */
-#endif /* JERRY_ESNEXT */
-
/**
* Push a new literal pool.
*
@@ -599,16 +581,11 @@ scanner_push_literal_pool (parser_context_t *context_p, /**< context */
JERRY_ASSERT (prev_literal_pool_p != NULL);
status_flags |= SCANNER_LITERAL_POOL_NO_ARGUMENTS;
-#if JERRY_ESNEXT
const uint16_t copied_flags =
(SCANNER_LITERAL_POOL_IN_WITH | SCANNER_LITERAL_POOL_GENERATOR | SCANNER_LITERAL_POOL_ASYNC);
-#else /* !JERRY_ESNEXT */
- const uint16_t copied_flags = SCANNER_LITERAL_POOL_IN_WITH;
-#endif /* JERRY_ESNEXT */
status_flags |= (uint16_t) (prev_literal_pool_p->status_flags & copied_flags);
}
-#if JERRY_ESNEXT
else
{
context_p->status_flags &= (uint32_t) ~(PARSER_IS_GENERATOR_FUNCTION | PARSER_IS_ASYNC_FUNCTION);
@@ -623,7 +600,6 @@ scanner_push_literal_pool (parser_context_t *context_p, /**< context */
context_p->status_flags |= PARSER_IS_ASYNC_FUNCTION;
}
}
-#endif /* JERRY_ESNEXT */
if (prev_literal_pool_p != NULL)
{
@@ -671,13 +647,11 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
scanner_literal_pool_t *literal_pool_p = scanner_context_p->active_literal_pool_p;
scanner_literal_pool_t *prev_literal_pool_p = literal_pool_p->prev_p;
-#if JERRY_ESNEXT
const uint32_t arrow_super_flags = (SCANNER_LITERAL_POOL_ARROW | SCANNER_LITERAL_POOL_HAS_SUPER_REFERENCE);
if ((literal_pool_p->status_flags & arrow_super_flags) == arrow_super_flags)
{
prev_literal_pool_p->status_flags |= SCANNER_LITERAL_POOL_HAS_SUPER_REFERENCE;
}
-#endif /* JERRY_ESNEXT */
if (JERRY_UNLIKELY (literal_pool_p->source_p == NULL))
{
@@ -702,7 +676,6 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
arguments_type = SCANNER_ARGUMENTS_MAY_PRESENT_IN_EVAL;
}
-#if JERRY_ESNEXT
if (status_flags & SCANNER_LITERAL_POOL_ARGUMENTS_IN_ARGS)
{
arguments_type = SCANNER_ARGUMENTS_PRESENT;
@@ -713,15 +686,13 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
status_flags &= (uint16_t) ~SCANNER_LITERAL_POOL_NO_ARGUMENTS;
}
}
-#endif /* JERRY_ESNEXT */
uint8_t can_eval_types = 0;
-#if JERRY_ESNEXT
+
if (prev_literal_pool_p == NULL && !(context_p->global_status_flags & ECMA_PARSE_DIRECT_EVAL))
{
can_eval_types |= SCANNER_LITERAL_IS_FUNC;
}
-#endif /* JERRY_ESNEXT */
if ((status_flags & SCANNER_LITERAL_POOL_CAN_EVAL) && prev_literal_pool_p != NULL)
{
@@ -759,13 +730,7 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
if (!(status_flags & SCANNER_LITERAL_POOL_NO_ARGUMENTS) && scanner_literal_is_arguments (literal_p))
{
-#if JERRY_ESNEXT
JERRY_ASSERT (arguments_type != SCANNER_ARGUMENTS_NOT_PRESENT);
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (arguments_type == SCANNER_ARGUMENTS_MAY_PRESENT
- || arguments_type == SCANNER_ARGUMENTS_MAY_PRESENT_IN_EVAL);
-#endif /* JERRY_ESNEXT */
-
status_flags |= SCANNER_LITERAL_POOL_NO_ARGUMENTS;
if (type & SCANNER_LITERAL_IS_ARG)
@@ -775,7 +740,6 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
arguments_type = SCANNER_ARGUMENTS_NOT_PRESENT;
last_argument_p = literal_p;
}
-#if JERRY_ESNEXT
else if (type & SCANNER_LITERAL_IS_LOCAL)
{
if (arguments_type == SCANNER_ARGUMENTS_MAY_PRESENT || arguments_type == SCANNER_ARGUMENTS_MAY_PRESENT_IN_EVAL)
@@ -806,15 +770,8 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
}
}
}
-#else /* !JERRY_ESNEXT */
- else if (type & SCANNER_LITERAL_IS_FUNC)
- {
- arguments_type = SCANNER_ARGUMENTS_NOT_PRESENT;
- }
-#endif /* JERRY_ESNEXT */
else
{
-#if JERRY_ESNEXT
if ((type & SCANNER_LITERAL_IS_VAR)
&& (arguments_type == SCANNER_ARGUMENTS_PRESENT || arguments_type == SCANNER_ARGUMENTS_PRESENT_NO_REG))
{
@@ -831,7 +788,6 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
literal_p->type = type;
no_declarations--;
}
-#endif /* JERRY_ESNEXT */
if ((type & SCANNER_LITERAL_NO_REG) || arguments_type == SCANNER_ARGUMENTS_MAY_PRESENT_IN_EVAL)
{
@@ -842,17 +798,12 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
arguments_type = SCANNER_ARGUMENTS_PRESENT;
}
-#if JERRY_ESNEXT
/* The SCANNER_LITERAL_IS_ARG may be set above. */
if (!(type & SCANNER_LITERAL_IS_ARG))
{
literal_p->type = 0;
continue;
}
-#else /* !JERRY_ESNEXT */
- literal_p->type = 0;
- continue;
-#endif /* JERRY_ESNEXT */
}
}
else if (type & SCANNER_LITERAL_IS_ARG)
@@ -860,7 +811,6 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
last_argument_p = literal_p;
}
-#if JERRY_ESNEXT
if ((status_flags & SCANNER_LITERAL_POOL_FUNCTION)
&& (type & SCANNER_LITERAL_IS_LOCAL_FUNC) == SCANNER_LITERAL_IS_FUNC)
{
@@ -878,7 +828,6 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
type &= (uint8_t) ~SCANNER_LITERAL_IS_FUNC;
literal_p->type = type;
}
-#endif /* JERRY_ESNEXT */
if ((type & SCANNER_LITERAL_IS_LOCAL)
|| ((type & (SCANNER_LITERAL_IS_VAR | SCANNER_LITERAL_IS_ARG))
@@ -904,7 +853,6 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
{
no_declarations++;
-#if JERRY_ESNEXT
if ((type & (SCANNER_LITERAL_IS_CONST | SCANNER_LITERAL_IS_ARG)) == SCANNER_LITERAL_IS_CONST)
{
JERRY_ASSERT (type & SCANNER_LITERAL_IS_LET);
@@ -913,14 +861,6 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
literal_p->type = (uint8_t) (type & ~SCANNER_LITERAL_IS_FUNC);
no_declarations--;
}
-#else /* !JERRY_ESNEXT */
- if (type & SCANNER_LITERAL_IS_LOCAL)
- {
- /* Catch parameters cannot be functions. */
- literal_p->type = (uint8_t) (type & ~SCANNER_LITERAL_IS_FUNC);
- no_declarations--;
- }
-#endif /* JERRY_ESNEXT */
}
intptr_t diff = (intptr_t) (literal_p->char_p - prev_source_p);
@@ -941,9 +881,7 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
prev_source_p = literal_p->char_p + literal_p->length;
if ((status_flags & SCANNER_LITERAL_POOL_FUNCTION)
-#if JERRY_ESNEXT
|| ((type & SCANNER_LITERAL_IS_FUNC) && (status_flags & SCANNER_LITERAL_POOL_IS_STRICT))
-#endif /* JERRY_ESNEXT */
|| !(type & (SCANNER_LITERAL_IS_VAR | SCANNER_LITERAL_IS_FUNC)))
{
continue;
@@ -956,18 +894,12 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
lexer_lit_location_t *literal_location_p = scanner_add_custom_literal (context_p, prev_literal_pool_p, literal_p);
uint8_t extended_type = literal_location_p->type;
-#if JERRY_ESNEXT
- const uint16_t no_reg_flags = (SCANNER_LITERAL_POOL_FUNCTION | SCANNER_LITERAL_POOL_CLASS_FIELD);
-#else /* !JERRY_ESNEXT */
- const uint16_t no_reg_flags = SCANNER_LITERAL_POOL_FUNCTION;
-#endif /* JERRY_ESNEXT */
-
- if ((status_flags & no_reg_flags) || (type & SCANNER_LITERAL_NO_REG))
+ if ((status_flags & (SCANNER_LITERAL_POOL_FUNCTION | SCANNER_LITERAL_POOL_CLASS_FIELD))
+ || (type & SCANNER_LITERAL_NO_REG))
{
extended_type |= SCANNER_LITERAL_NO_REG;
}
-#if JERRY_ESNEXT
extended_type |= SCANNER_LITERAL_IS_USED;
if (status_flags & SCANNER_LITERAL_POOL_FUNCTION_STATEMENT)
@@ -984,7 +916,6 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
* for speculative arrow parameters and local (non-var) functions. */
type = 0;
}
-#endif /* JERRY_ESNEXT */
type = (uint8_t) (type & (SCANNER_LITERAL_IS_VAR | SCANNER_LITERAL_IS_FUNC));
JERRY_ASSERT (type == 0 || !(status_flags & SCANNER_LITERAL_POOL_FUNCTION));
@@ -1046,13 +977,7 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
no_declarations++;
}
-#if JERRY_ESNEXT
- const uint16_t is_unmapped = SCANNER_LITERAL_POOL_IS_STRICT | SCANNER_LITERAL_POOL_HAS_COMPLEX_ARGUMENT;
-#else /* !JERRY_ESNEXT */
- const uint16_t is_unmapped = SCANNER_LITERAL_POOL_IS_STRICT;
-#endif /* JERRY_ESNEXT */
-
- if (!(status_flags & is_unmapped))
+ if (!(status_flags & (SCANNER_LITERAL_POOL_IS_STRICT | SCANNER_LITERAL_POOL_HAS_COMPLEX_ARGUMENT)))
{
mapped_arguments = true;
}
@@ -1072,7 +997,6 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
last_argument_p = NULL;
}
-#if JERRY_ESNEXT
if (status_flags & (SCANNER_LITERAL_POOL_HAS_COMPLEX_ARGUMENT | SCANNER_LITERAL_POOL_ARROW))
{
u8_arg |= SCANNER_FUNCTION_HAS_COMPLEX_ARGUMENT;
@@ -1097,7 +1021,6 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
{
u8_arg |= SCANNER_FUNCTION_IS_STRICT;
}
-#endif /* JERRY_ESNEXT */
info_p->u8_arg = u8_arg;
info_p->u16_arg = (uint16_t) no_declarations;
@@ -1147,19 +1070,16 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
{
type = SCANNER_STREAM_TYPE_ARG_FUNC;
-#if JERRY_ESNEXT
if (literal_p->type & SCANNER_LITERAL_IS_DESTRUCTURED_ARG)
{
type = SCANNER_STREAM_TYPE_DESTRUCTURED_ARG_FUNC;
}
-#endif /* JERRY_ESNEXT */
}
}
else if (literal_p->type & SCANNER_LITERAL_IS_ARG)
{
type = SCANNER_STREAM_TYPE_ARG;
-#if JERRY_ESNEXT
if (literal_p->type & SCANNER_LITERAL_IS_DESTRUCTURED_ARG)
{
type = SCANNER_STREAM_TYPE_DESTRUCTURED_ARG;
@@ -1171,9 +1091,7 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
JERRY_ASSERT (type == SCANNER_STREAM_TYPE_ARG_VAR || type == SCANNER_STREAM_TYPE_DESTRUCTURED_ARG_VAR);
}
-#endif /* JERRY_ESNEXT */
}
-#if JERRY_ESNEXT
else if (literal_p->type & SCANNER_LITERAL_IS_LET)
{
if (!(literal_p->type & SCANNER_LITERAL_IS_CONST))
@@ -1210,7 +1128,6 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
{
type |= SCANNER_STREAM_NO_REG | SCANNER_STREAM_EARLY_CREATE;
}
-#endif /* JERRY_ESNEXT */
if (literal_p->status_flags & LEXER_LIT_LOCATION_HAS_ESCAPE)
{
@@ -1282,7 +1199,6 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
context_p->status_flags &= (uint32_t) ~PARSER_IS_STRICT;
}
-#if JERRY_ESNEXT
if (prev_literal_pool_p->status_flags & SCANNER_LITERAL_POOL_GENERATOR)
{
context_p->status_flags |= PARSER_IS_GENERATOR_FUNCTION;
@@ -1300,7 +1216,6 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
{
context_p->status_flags &= (uint32_t) ~PARSER_IS_ASYNC_FUNCTION;
}
-#endif /* JERRY_ESNEXT */
}
scanner_context_p->active_literal_pool_p = literal_pool_p->prev_p;
@@ -1309,8 +1224,6 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
scanner_free (literal_pool_p, sizeof (scanner_literal_pool_t));
} /* scanner_pop_literal_pool */
-#if JERRY_ESNEXT
-
/**
* Filter out the arguments from a literal pool.
*/
@@ -1467,8 +1380,6 @@ scanner_filter_arguments (parser_context_t *context_p, /**< context */
scanner_free (literal_pool_p, sizeof (scanner_literal_pool_t));
} /* scanner_filter_arguments */
-#endif /* JERRY_ESNEXT */
-
/**
* Add any literal to the specified literal pool.
*
@@ -1522,13 +1433,11 @@ scanner_add_custom_literal (parser_context_t *context_p, /**< context */
}
}
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (literal_pool_p->status_flags & SCANNER_LITERAL_POOL_CLASS_NAME))
{
literal_pool_p = literal_pool_p->prev_p;
continue;
}
-#endif /* JERRY_ESNEXT */
literal_p = (lexer_lit_location_t *) parser_list_append (context_p, &literal_pool_p->literal_pool);
*literal_p = *literal_location_p;
@@ -1565,9 +1474,7 @@ scanner_add_reference (parser_context_t *context_p, /**< context */
{
lexer_lit_location_t *lit_location_p =
scanner_add_custom_literal (context_p, scanner_context_p->active_literal_pool_p, &context_p->token.lit_location);
-#if JERRY_ESNEXT
lit_location_p->type |= SCANNER_LITERAL_IS_USED;
-#endif /* JERRY_ESNEXT */
if (scanner_context_p->active_literal_pool_p->status_flags & SCANNER_LITERAL_POOL_IN_WITH)
{
@@ -1634,12 +1541,10 @@ scanner_append_argument (parser_context_t *context_p, /**< context */
{
literal_p->length = 0;
-#if JERRY_ESNEXT
if (literal_p->type & SCANNER_LITERAL_IS_USED)
{
literal_type = SCANNER_LITERAL_IS_ARG | SCANNER_LITERAL_EARLY_CREATE;
}
-#endif /* JERRY_ESNEXT */
}
literal_p = (lexer_lit_location_t *) parser_list_append (context_p, &literal_pool_p->literal_pool);
@@ -1699,18 +1604,11 @@ scanner_detect_eval_call (parser_context_t *context_p, /**< context */
{
if (context_p->token.keyword_type == LEXER_KEYW_EVAL && lexer_check_next_character (context_p, LIT_CHAR_LEFT_PAREN))
{
-#if JERRY_ESNEXT
- const uint16_t flags = (uint16_t) (SCANNER_LITERAL_POOL_CAN_EVAL | SCANNER_LITERAL_POOL_HAS_SUPER_REFERENCE);
-#else /* !JERRY_ESNEXT */
- const uint16_t flags = SCANNER_LITERAL_POOL_CAN_EVAL;
-#endif /* JERRY_ESNEXT */
-
- scanner_context_p->active_literal_pool_p->status_flags |= flags;
+ scanner_context_p->active_literal_pool_p->status_flags |=
+ (SCANNER_LITERAL_POOL_CAN_EVAL | SCANNER_LITERAL_POOL_HAS_SUPER_REFERENCE);
}
} /* scanner_detect_eval_call */
-#if JERRY_ESNEXT
-
/**
* Throws an error for invalid var statements.
*/
@@ -2005,8 +1903,6 @@ scanner_append_hole (parser_context_t *context_p, scanner_context_t *scanner_con
literal_p->status_flags = LEXER_LIT_LOCATION_NO_OPTS;
} /* scanner_append_hole */
-#endif /* JERRY_ESNEXT */
-
/**
* Reverse the scanner info chain after the scanning is completed.
*/
@@ -2071,15 +1967,11 @@ scanner_cleanup (parser_context_t *context_p) /**< context */
}
case SCANNER_TYPE_WHILE:
case SCANNER_TYPE_FOR_IN:
-#if JERRY_ESNEXT
case SCANNER_TYPE_FOR_OF:
-#endif /* JERRY_ESNEXT */
case SCANNER_TYPE_CASE:
-#if JERRY_ESNEXT
case SCANNER_TYPE_INITIALIZER:
case SCANNER_TYPE_CLASS_FIELD_INITIALIZER_END:
case SCANNER_TYPE_CLASS_STATIC_BLOCK_END:
-#endif /* JERRY_ESNEXT */
{
size = sizeof (scanner_location_info_t);
break;
@@ -2095,25 +1987,19 @@ scanner_cleanup (parser_context_t *context_p) /**< context */
size = sizeof (scanner_switch_info_t);
break;
}
-#if JERRY_ESNEXT
case SCANNER_TYPE_CLASS_CONSTRUCTOR:
{
scanner_release_private_fields (((scanner_class_info_t *) scanner_info_p)->members);
size = sizeof (scanner_class_info_t);
break;
}
-#endif /* JERRY_ESNEXT */
default:
{
-#if JERRY_ESNEXT
JERRY_ASSERT (
scanner_info_p->type == SCANNER_TYPE_END_ARGUMENTS || scanner_info_p->type == SCANNER_TYPE_LITERAL_FLAGS
|| scanner_info_p->type == SCANNER_TYPE_LET_EXPRESSION || scanner_info_p->type == SCANNER_TYPE_ERR_REDECLARED
|| scanner_info_p->type == SCANNER_TYPE_ERR_ASYNC_FUNCTION
|| scanner_info_p->type == SCANNER_TYPE_EXPORT_MODULE_SPECIFIER);
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (scanner_info_p->type == SCANNER_TYPE_END_ARGUMENTS);
-#endif /* JERRY_ESNEXT */
break;
}
}
@@ -2141,24 +2027,15 @@ scanner_is_context_needed (parser_context_t *context_p, /**< context */
JERRY_UNUSED (check_type);
-#if JERRY_ESNEXT
JERRY_ASSERT ((check_type == PARSER_CHECK_BLOCK_CONTEXT ? info_p->type == SCANNER_TYPE_BLOCK
: info_p->type == SCANNER_TYPE_FUNCTION));
uint32_t scope_stack_reg_top =
(check_type != PARSER_CHECK_GLOBAL_CONTEXT ? context_p->scope_stack_reg_top : 1); /* block result */
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (check_type == PARSER_CHECK_BLOCK_CONTEXT);
- JERRY_ASSERT (info_p->type == SCANNER_TYPE_BLOCK);
-
- uint32_t scope_stack_reg_top = context_p->scope_stack_reg_top;
-#endif /* !JERRY_NDEBUG */
while (data_p[0] != SCANNER_STREAM_TYPE_END)
{
uint8_t data = data_p[0];
-
-#if JERRY_ESNEXT
uint32_t type = data & SCANNER_STREAM_TYPE_MASK;
if (JERRY_UNLIKELY (check_type == PARSER_CHECK_FUNCTION_CONTEXT))
@@ -2219,11 +2096,6 @@ scanner_is_context_needed (parser_context_t *context_p, /**< context */
|| type == SCANNER_STREAM_TYPE_FUNC);
}
#endif /* !JERRY_NDEBUG */
-
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT ((data & SCANNER_STREAM_TYPE_MASK) == SCANNER_STREAM_TYPE_VAR);
-#endif /* JERRY_ESNEXT */
-
if (!(data & SCANNER_STREAM_UINT16_DIFF))
{
if (data_p[2] != 0)
@@ -2240,7 +2112,6 @@ scanner_is_context_needed (parser_context_t *context_p, /**< context */
data_p += 2 + 2;
}
-#if JERRY_ESNEXT
#if JERRY_MODULE_SYSTEM
const bool is_import = (type == SCANNER_STREAM_TYPE_IMPORT);
#else /* !JERRY_MODULE_SYSTEM */
@@ -2275,7 +2146,6 @@ scanner_is_context_needed (parser_context_t *context_p, /**< context */
continue;
}
}
-#endif /* JERRY_ESNEXT */
if ((data & SCANNER_STREAM_NO_REG) || scope_stack_reg_top >= PARSER_MAXIMUM_NUMBER_OF_REGISTERS)
{
@@ -2288,8 +2158,6 @@ scanner_is_context_needed (parser_context_t *context_p, /**< context */
return false;
} /* scanner_is_context_needed */
-#if JERRY_ESNEXT
-
/**
* Try to scan/parse the ".target" part in the "new.target" expression.
*
@@ -2326,8 +2194,6 @@ scanner_try_scan_new_target (parser_context_t *context_p) /**< parser/scanner co
return false;
} /* scanner_try_scan_new_target */
-#endif /* JERRY_ESNEXT */
-
/**
* Description of "arguments" literal string.
*/
@@ -2356,7 +2222,6 @@ scanner_create_unused_literal (parser_context_t *context_p, /**< context */
context_p->literal_count++;
} /* scanner_create_unused_literal */
-#if JERRY_ESNEXT
/**
* Emit checks for redeclared bindings in the global lexical scope.
*/
@@ -2438,7 +2303,6 @@ scanner_check_variables (parser_context_t *context_p) /**< context */
parser_flush_cbc (context_p);
} /* scanner_check_variables */
-#endif /* JERRY_ESNEXT */
/**
* Create and/or initialize var/let/const/function/etc. variables.
@@ -2560,10 +2424,7 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
{
map_to = (uint16_t) (PARSER_REGISTER_START + scope_stack_reg_top);
-#if JERRY_ESNEXT
scope_stack_p->map_to = (uint16_t) (scope_stack_reg_top + 1);
-#endif /* JERRY_ESNEXT */
-
scope_stack_reg_top++;
}
else
@@ -2573,19 +2434,14 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
context_p->status_flags |= PARSER_LEXICAL_ENV_NEEDED;
-#if JERRY_ESNEXT
if (data_p[0] & SCANNER_STREAM_LOCAL_ARGUMENTS)
{
context_p->status_flags |= PARSER_LEXICAL_BLOCK_NEEDED;
}
scope_stack_p->map_to = 0;
-#endif /* JERRY_ESNEXT */
}
-#if !JERRY_ESNEXT
- scope_stack_p->map_to = map_to;
-#endif /* !JERRY_ESNEXT */
scope_stack_p++;
#if JERRY_PARSER_DUMP_BYTE_CODE
@@ -2594,7 +2450,6 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
parser_emit_cbc_ext_literal (context_p, CBC_EXT_CREATE_ARGUMENTS, map_to);
-#if JERRY_ESNEXT
if (type == SCANNER_STREAM_TYPE_ARGUMENTS_FUNC)
{
if (JERRY_UNLIKELY (scope_stack_p >= scope_stack_end_p))
@@ -2609,7 +2464,6 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
scanner_create_unused_literal (context_p, 0);
}
-#endif /* JERRY_ESNEXT */
if (option_flags & SCANNER_CREATE_VARS_IS_FUNCTION_ARGS)
{
@@ -2650,7 +2504,6 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
{
if (option_flags & SCANNER_CREATE_VARS_IS_FUNCTION_BODY)
{
-#if JERRY_ESNEXT
if ((context_p->status_flags & PARSER_LEXICAL_BLOCK_NEEDED)
&& (type == SCANNER_STREAM_TYPE_ARG_VAR || type == SCANNER_STREAM_TYPE_DESTRUCTURED_ARG_VAR))
{
@@ -2667,7 +2520,6 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
parser_emit_cbc_ext_literal_from_token (context_p, CBC_EXT_COPY_FROM_ARG);
}
}
-#endif /* JERRY_ESNEXT */
literal.char_p += data_p[1];
continue;
@@ -2691,9 +2543,7 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
{
JERRY_ASSERT (scope_stack_p >= context_p->scope_stack_p + 2);
JERRY_ASSERT (context_p->status_flags & PARSER_IS_FUNCTION);
-#if JERRY_ESNEXT
JERRY_ASSERT (!(context_p->status_flags & PARSER_FUNCTION_IS_PARSING_ARGS));
-#endif /* JERRY_ESNEXT */
parser_scope_stack_t *function_map_p = scope_stack_p - 2;
uint16_t literal_index = context_p->lit_object.index;
@@ -2709,13 +2559,11 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
cbc_opcode_t opcode = CBC_SET_VAR_FUNC;
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (context_p->status_flags & PARSER_LEXICAL_BLOCK_NEEDED)
&& (function_map_p[0].map_to & PARSER_SCOPE_STACK_REGISTER_MASK) == 0)
{
opcode = CBC_INIT_ARG_OR_FUNC;
}
-#endif /* JERRY_ESNEXT */
parser_emit_cbc_literal_value (context_p,
(uint16_t) opcode,
@@ -2732,7 +2580,6 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
scope_stack_p->map_from = context_p->lit_object.index;
-#if JERRY_ESNEXT
if (info_type == SCANNER_TYPE_FUNCTION)
{
if (type != SCANNER_STREAM_TYPE_LET
@@ -2744,7 +2591,6 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
context_p->lit_object.literal_p->status_flags |= LEXER_FLAG_GLOBAL;
}
}
-#endif /* JERRY_ESNEXT */
uint16_t map_to;
uint16_t func_init_opcode = CBC_INIT_ARG_OR_FUNC;
@@ -2752,15 +2598,9 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
if (!(data_p[0] & SCANNER_STREAM_NO_REG) && scope_stack_reg_top < PARSER_MAXIMUM_NUMBER_OF_REGISTERS)
{
map_to = (uint16_t) (PARSER_REGISTER_START + scope_stack_reg_top);
-
-#if JERRY_ESNEXT
scope_stack_p->map_to = (uint16_t) (scope_stack_reg_top + 1);
-#else /* !JERRY_ESNEXT */
- scope_stack_p->map_to = map_to;
-#endif /* JERRY_ESNEXT */
-
scope_stack_reg_top++;
-#if JERRY_ESNEXT
+
switch (type)
{
case SCANNER_STREAM_TYPE_CONST:
@@ -2782,18 +2622,13 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
}
func_init_opcode = CBC_SET_VAR_FUNC;
-#endif /* JERRY_ESNEXT */
}
else
{
context_p->lit_object.literal_p->status_flags |= LEXER_FLAG_USED;
map_to = context_p->lit_object.index;
-#if JERRY_ESNEXT
uint16_t scope_stack_map_to = 0;
-#else /* !JERRY_ESNEXT */
- scope_stack_p->map_to = map_to;
-#endif /* JERRY_ESNEXT */
if (info_type == SCANNER_TYPE_FUNCTION)
{
@@ -2802,7 +2637,6 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
switch (type)
{
-#if JERRY_ESNEXT
case SCANNER_STREAM_TYPE_LET:
case SCANNER_STREAM_TYPE_CONST:
case SCANNER_STREAM_TYPE_DESTRUCTURED_ARG:
@@ -2819,14 +2653,11 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
/* FALLTHRU */
}
case SCANNER_STREAM_TYPE_LOCAL:
-#endif /* JERRY_ESNEXT */
case SCANNER_STREAM_TYPE_VAR:
{
#if JERRY_PARSER_DUMP_BYTE_CODE
context_p->scope_stack_top = (uint16_t) (scope_stack_p - context_p->scope_stack_p);
#endif /* JERRY_PARSER_DUMP_BYTE_CODE */
-
-#if JERRY_ESNEXT
uint16_t opcode;
switch (type)
@@ -2867,43 +2698,34 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
break;
}
}
-#else /* !JERRY_ESNEXT */
- uint16_t opcode = ((option_flags & SCANNER_CREATE_VARS_IS_SCRIPT) ? CBC_CREATE_VAR_EVAL : CBC_CREATE_VAR);
-#endif /* JERRY_ESNEXT */
parser_emit_cbc_literal (context_p, opcode, map_to);
break;
}
case SCANNER_STREAM_TYPE_ARG:
-#if JERRY_ESNEXT
case SCANNER_STREAM_TYPE_ARG_VAR:
-#endif /* JERRY_ESNEXT */
case SCANNER_STREAM_TYPE_ARG_FUNC:
{
#if JERRY_PARSER_DUMP_BYTE_CODE
context_p->scope_stack_top = (uint16_t) (scope_stack_p - context_p->scope_stack_p);
#endif /* JERRY_PARSER_DUMP_BYTE_CODE */
-#if JERRY_ESNEXT
scope_stack_map_to |= PARSER_SCOPE_STACK_NO_FUNCTION_COPY;
/* Argument initializers of functions with simple arguments (e.g. function f(a,b,a) {}) are
* generated here. The other initializers are handled by parser_parse_function_arguments(). */
if (!(info_u8_arg & SCANNER_FUNCTION_HAS_COMPLEX_ARGUMENT))
{
-#endif /* JERRY_ESNEXT */
parser_emit_cbc_literal_value (context_p,
CBC_INIT_ARG_OR_FUNC,
(uint16_t) (PARSER_REGISTER_START + scope_stack_reg_top),
map_to);
-#if JERRY_ESNEXT
}
else if (data_p[0] & SCANNER_STREAM_EARLY_CREATE)
{
parser_emit_cbc_literal (context_p, CBC_CREATE_LOCAL, map_to);
scope_stack_map_to |= PARSER_SCOPE_STACK_IS_LOCAL_CREATED;
}
-#endif /* JERRY_ESNEXT */
if (scope_stack_reg_top < PARSER_MAXIMUM_NUMBER_OF_REGISTERS)
{
@@ -2913,9 +2735,7 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
}
}
-#if JERRY_ESNEXT
scope_stack_p->map_to = scope_stack_map_to;
-#endif /* JERRY_ESNEXT */
}
scope_stack_p++;
@@ -2939,7 +2759,6 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
{
if (func_init_opcode == CBC_INIT_ARG_OR_FUNC && (option_flags & SCANNER_CREATE_VARS_IS_SCRIPT))
{
-#if JERRY_ESNEXT
literal.char_p -= data_p[1];
if (!scanner_scope_find_lexical_declaration (context_p, &literal))
@@ -2952,9 +2771,6 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
}
}
literal.char_p += data_p[1];
-#else /* !JERRY_ESNEXT */
- func_init_opcode = CBC_CREATE_VAR_FUNC_EVAL;
-#endif /* JERRY_ESNEXT */
}
parser_emit_cbc_literal_value (context_p, func_init_opcode, context_p->literal_count, map_to);
@@ -2970,12 +2786,10 @@ scanner_create_variables (parser_context_t *context_p, /**< context */
context_p->scope_stack_top = (uint16_t) (scope_stack_p - context_p->scope_stack_p);
context_p->scope_stack_reg_top = (uint16_t) scope_stack_reg_top;
-#if JERRY_ESNEXT
if (info_type == SCANNER_TYPE_FUNCTION)
{
context_p->scope_stack_global_end = context_p->scope_stack_top;
}
-#endif /* JERRY_ESNEXT */
if (context_p->register_count < scope_stack_reg_top)
{
@@ -3021,16 +2835,10 @@ scanner_decode_map_to (parser_scope_stack_t *stack_item_p) /**< scope stack item
{
JERRY_ASSERT (stack_item_p->map_from != PARSER_SCOPE_STACK_FUNC);
-#if JERRY_ESNEXT
uint16_t value = (stack_item_p->map_to & PARSER_SCOPE_STACK_REGISTER_MASK);
return (value == 0) ? stack_item_p->map_from : (uint16_t) (value + (PARSER_REGISTER_START - 1));
-#else /* !JERRY_ESNEXT */
- return stack_item_p->map_to;
-#endif /* JERRY_ESNEXT */
} /* scanner_decode_map_to */
-#if JERRY_ESNEXT
-
/**
* Find the given literal index in the scope stack
* and save it the constant literal pool if the literal is register stored
@@ -3142,8 +2950,6 @@ scanner_literal_exists (parser_context_t *context_p, /**< context */
return false;
} /* scanner_literal_exists */
-#endif /* JERRY_ESNEXT */
-
/**
* @}
* @}
diff --git a/jerry-core/parser/js/js-scanner.c b/jerry-core/parser/js/js-scanner.c
index 54909fb9..3ed8ef3f 100644
--- a/jerry-core/parser/js/js-scanner.c
+++ b/jerry-core/parser/js/js-scanner.c
@@ -42,13 +42,7 @@ typedef enum
/**
* Checks whether token type is "of".
*/
-#if JERRY_ESNEXT
#define SCANNER_IDENTIFIER_IS_OF() (lexer_token_is_identifier (context_p, "of", 2))
-#else /* !JERRY_ESNEXT */
-#define SCANNER_IDENTIFIER_IS_OF() (false)
-#endif /* JERRY_ESNEXT */
-
-#if JERRY_ESNEXT
JERRY_STATIC_ASSERT (SCANNER_FROM_LITERAL_POOL_TO_COMPUTED (SCANNER_LITERAL_POOL_GENERATOR)
== SCAN_STACK_COMPUTED_GENERATOR,
@@ -62,8 +56,6 @@ JERRY_STATIC_ASSERT (SCANNER_FROM_COMPUTED_TO_LITERAL_POOL (SCAN_STACK_COMPUTED_
JERRY_STATIC_ASSERT (SCANNER_FROM_COMPUTED_TO_LITERAL_POOL (SCAN_STACK_COMPUTED_ASYNC) == SCANNER_LITERAL_POOL_ASYNC,
scanner_invalid_conversion_from_computed_async_to_literal_pool_async);
-#endif /* JERRY_ESNEXT */
-
/**
* Change scanner mode from primary expression to post primary expression.
*
@@ -75,7 +67,6 @@ scanner_primary_to_post_primary_expression (parser_context_t *context_p, /**< co
{
scanner_context_p->mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (context_p->stack_top_uint8 == SCAN_STACK_CLASS_FIELD_INITIALIZER
&& (context_p->status_flags & PARSER_IS_STRICT)))
{
@@ -88,9 +79,6 @@ scanner_primary_to_post_primary_expression (parser_context_t *context_p, /**< co
return SCAN_KEEP_TOKEN;
}
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (context_p);
-#endif /* JERRY_ESNEXT */
return SCAN_NEXT_TOKEN;
} /* scanner_primary_to_post_primary_expression */
@@ -112,12 +100,11 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
{
scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION_AFTER_NEW;
-#if JERRY_ESNEXT
if (scanner_try_scan_new_target (context_p))
{
return scanner_primary_to_post_primary_expression (context_p, scanner_context_p);
}
-#endif /* JERRY_ESNEXT */
+
break;
}
case LEXER_DIVIDE:
@@ -133,7 +120,6 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
bool is_export_default = stack_top == SCAN_STACK_EXPORT_DEFAULT;
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_ESNEXT
if (scanner_context_p->async_source_p != NULL)
{
status_flags |= SCANNER_LITERAL_POOL_ASYNC;
@@ -143,7 +129,6 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
{
status_flags |= SCANNER_LITERAL_POOL_GENERATOR;
}
-#endif /* JERRY_ESNEXT */
scanner_push_literal_pool (context_p, scanner_context_p, status_flags);
@@ -187,9 +172,7 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
}
case LEXER_LEFT_SQUARE:
{
-#if JERRY_ESNEXT
scanner_push_destructuring_pattern (context_p, scanner_context_p, SCANNER_BINDING_NONE, false);
-#endif /* JERRY_ESNEXT */
parser_stack_push_uint8 (context_p, SCAN_STACK_ARRAY_LITERAL);
scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION;
@@ -197,16 +180,13 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
}
case LEXER_LEFT_BRACE:
{
-#if JERRY_ESNEXT
scanner_push_destructuring_pattern (context_p, scanner_context_p, SCANNER_BINDING_NONE, false);
parser_stack_push_uint8 (context_p, 0);
-#endif /* JERRY_ESNEXT */
parser_stack_push_uint8 (context_p, SCAN_STACK_OBJECT_LITERAL);
scanner_context_p->mode = SCAN_MODE_PROPERTY_NAME;
return SCAN_KEEP_TOKEN;
}
-#if JERRY_ESNEXT
case LEXER_HASHMARK:
{
if (!lexer_scan_private_identifier (context_p))
@@ -228,10 +208,8 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
/* The string is a normal string literal. */
/* FALLTHRU */
}
-#endif /* JERRY_ESNEXT */
case LEXER_LITERAL:
{
-#if JERRY_ESNEXT
const uint8_t *source_p = context_p->source_p;
if (context_p->token.lit_location.type == LEXER_IDENT_LITERAL && lexer_check_arrow (context_p))
@@ -246,7 +224,6 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
scanner_check_async_function (context_p, scanner_context_p);
return SCAN_KEEP_TOKEN;
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.lit_location.type == LEXER_IDENT_LITERAL)
{
@@ -271,7 +248,6 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
{
return scanner_primary_to_post_primary_expression (context_p, scanner_context_p);
}
-#if JERRY_ESNEXT
case LEXER_KEYW_SUPER:
{
scanner_context_p->active_literal_pool_p->status_flags |= SCANNER_LITERAL_POOL_HAS_SUPER_REFERENCE;
@@ -287,7 +263,6 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
}
break;
}
-#endif /* JERRY_ESNEXT */
case LEXER_RIGHT_SQUARE:
{
if (stack_top != SCAN_STACK_ARRAY_LITERAL)
@@ -298,7 +273,6 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION_END;
return SCAN_KEEP_TOKEN;
}
-#if JERRY_ESNEXT
case LEXER_THREE_DOTS:
{
/* Elision or spread arguments */
@@ -309,7 +283,6 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION;
break;
}
-#endif /* JERRY_ESNEXT */
case LEXER_COMMA:
{
if (stack_top != SCAN_STACK_ARRAY_LITERAL)
@@ -318,15 +291,13 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
}
scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION;
-#if JERRY_ESNEXT
if (scanner_context_p->binding_type != SCANNER_BINDING_NONE)
{
scanner_context_p->mode = SCAN_MODE_BINDING;
}
-#endif /* JERRY_ESNEXT */
+
break;
}
-#if JERRY_ESNEXT
case LEXER_KEYW_YIELD:
{
lexer_next_token (context_p);
@@ -342,7 +313,6 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
}
return SCAN_KEEP_TOKEN;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
case LEXER_KEYW_IMPORT:
{
@@ -367,12 +337,10 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
{
parser_stack_pop_uint8 (context_p);
-#if JERRY_ESNEXT
if (context_p->stack_top_uint8 == SCAN_STACK_USE_ASYNC)
{
scanner_add_async_literal (context_p, scanner_context_p);
}
-#endif /* JERRY_ESNEXT */
return scanner_primary_to_post_primary_expression (context_p, scanner_context_p);
}
@@ -403,13 +371,11 @@ scanner_scan_post_primary_expression (parser_context_t *context_p, /**< context
{
lexer_scan_identifier (context_p, LEXER_PARSE_NO_OPTS);
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_HASHMARK)
{
context_p->token.flags |= LEXER_NO_SKIP_SPACES;
lexer_next_token (context_p);
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type != LEXER_LITERAL || context_p->token.lit_location.type != LEXER_IDENT_LITERAL)
{
@@ -424,7 +390,6 @@ scanner_scan_post_primary_expression (parser_context_t *context_p, /**< context
scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION;
return true;
}
-#if JERRY_ESNEXT
case LEXER_TEMPLATE_LITERAL:
{
if (JERRY_UNLIKELY (context_p->source_p[-1] != LIT_CHAR_GRAVE_ACCENT))
@@ -434,7 +399,6 @@ scanner_scan_post_primary_expression (parser_context_t *context_p, /**< context
}
return true;
}
-#endif /* JERRY_ESNEXT */
case LEXER_LEFT_SQUARE:
{
parser_stack_push_uint8 (context_p, SCAN_STACK_PROPERTY_ACCESSOR);
@@ -497,15 +461,11 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
switch (stack_top)
{
case SCAN_STACK_VAR:
-#if JERRY_ESNEXT
case SCAN_STACK_LET:
case SCAN_STACK_CONST:
-#endif /* JERRY_ESNEXT */
case SCAN_STACK_FOR_VAR_START:
-#if JERRY_ESNEXT
case SCAN_STACK_FOR_LET_START:
case SCAN_STACK_FOR_CONST_START:
-#endif /* JERRY_ESNEXT */
{
scanner_context_p->mode = SCAN_MODE_VAR_STATEMENT;
return SCAN_NEXT_TOKEN;
@@ -515,7 +475,6 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
scanner_raise_error (context_p);
break;
}
-#if JERRY_ESNEXT
case SCAN_STACK_BINDING_INIT:
case SCAN_STACK_BINDING_LIST_INIT:
{
@@ -553,7 +512,6 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
return SCAN_NEXT_TOKEN;
}
-#endif /* JERRY_ESNEXT */
case SCAN_STACK_OBJECT_LITERAL:
{
scanner_context_p->mode = SCAN_MODE_PROPERTY_NAME;
@@ -629,12 +587,10 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
parser_stack_pop_uint8 (context_p);
-#if JERRY_ESNEXT
if (context_p->stack_top_uint8 == SCAN_STACK_USE_ASYNC)
{
scanner_add_async_literal (context_p, scanner_context_p);
}
-#endif /* JERRY_ESNEXT */
scanner_context_p->mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
return SCAN_NEXT_TOKEN;
@@ -648,18 +604,15 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
parser_stack_pop_uint8 (context_p);
-#if JERRY_ESNEXT
if (context_p->stack_top_uint8 == SCAN_STACK_IF_STATEMENT)
{
scanner_check_function_after_if (context_p, scanner_context_p);
return SCAN_KEEP_TOKEN;
}
-#endif /* JERRY_ESNEXT */
scanner_context_p->mode = SCAN_MODE_STATEMENT;
return SCAN_NEXT_TOKEN;
}
-#if JERRY_ESNEXT
case SCAN_STACK_BINDING_LIST_INIT:
{
parser_stack_pop_uint8 (context_p);
@@ -713,12 +666,9 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION_END;
return SCAN_KEEP_TOKEN;
}
-#endif /* JERRY_ESNEXT */
case SCAN_STACK_VAR:
-#if JERRY_ESNEXT
case SCAN_STACK_LET:
case SCAN_STACK_CONST:
-#endif /* JERRY_ESNEXT */
{
#if JERRY_MODULE_SYSTEM
scanner_context_p->active_literal_pool_p->status_flags &= (uint16_t) ~SCANNER_LITERAL_POOL_IN_EXPORT;
@@ -728,10 +678,8 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
return SCAN_KEEP_TOKEN;
}
case SCAN_STACK_FOR_VAR_START:
-#if JERRY_ESNEXT
case SCAN_STACK_FOR_LET_START:
case SCAN_STACK_FOR_CONST_START:
-#endif /* JERRY_ESNEXT */
case SCAN_STACK_FOR_START:
{
if (type == LEXER_KEYW_IN || SCANNER_IDENTIFIER_IS_OF ())
@@ -745,17 +693,12 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
location_info = (scanner_location_info_t *) scanner_insert_info (context_p,
for_statement.u.source_p,
sizeof (scanner_location_info_t));
-#if JERRY_ESNEXT
location_info->info.type = (type == LEXER_KEYW_IN) ? SCANNER_TYPE_FOR_IN : SCANNER_TYPE_FOR_OF;
if (stack_top == SCAN_STACK_FOR_LET_START || stack_top == SCAN_STACK_FOR_CONST_START)
{
parser_stack_push_uint8 (context_p, SCAN_STACK_PRIVATE_BLOCK_EARLY);
}
-#else /* !JERRY_ESNEXT */
- location_info->info.type = SCANNER_TYPE_FOR_IN;
-#endif /* JERRY_ESNEXT */
-
scanner_get_location (&location_info->location, context_p);
parser_stack_push_uint8 (context_p, SCAN_STACK_STATEMENT_WITH_EXPR);
@@ -773,12 +716,10 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
parser_stack_pop_uint8 (context_p);
parser_stack_pop (context_p, NULL, sizeof (scanner_for_statement_t));
-#if JERRY_ESNEXT
if (stack_top == SCAN_STACK_FOR_LET_START || stack_top == SCAN_STACK_FOR_CONST_START)
{
parser_stack_push_uint8 (context_p, SCAN_STACK_PRIVATE_BLOCK);
}
-#endif /* JERRY_ESNEXT */
for_statement.u.source_p = context_p->source_p;
parser_stack_push (context_p, &for_statement, sizeof (scanner_for_statement_t));
@@ -862,11 +803,9 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
break;
}
-#if JERRY_ESNEXT
scanner_literal_pool_t *literal_pool_p;
literal_pool_p = scanner_push_literal_pool (context_p, scanner_context_p, 0);
literal_pool_p->source_p = context_p->source_p - 1;
-#endif /* JERRY_ESNEXT */
parser_stack_pop_uint8 (context_p);
@@ -926,7 +865,6 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
parser_stack_pop_uint8 (context_p);
return SCAN_NEXT_TOKEN;
}
-#if JERRY_ESNEXT
case SCAN_STACK_ARRAY_LITERAL:
case SCAN_STACK_OBJECT_LITERAL:
{
@@ -960,14 +898,12 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
{
scanner_pop_binding_list (scanner_context_p);
-#if JERRY_ESNEXT
if (object_literal_flags != 0)
{
scanner_info_t *info_p = scanner_insert_info (context_p, source_start.source_p, sizeof (scanner_info_t));
info_p->type = SCANNER_TYPE_LITERAL_FLAGS;
info_p->u8_arg = object_literal_flags;
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type != LEXER_RIGHT_PAREN)
{
@@ -1007,7 +943,6 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
scanner_pop_binding_list (scanner_context_p);
}
-#if JERRY_ESNEXT
if ((stack_top == SCAN_STACK_ARRAY_LITERAL || stack_top == SCAN_STACK_OBJECT_LITERAL)
&& (binding_type == SCANNER_BINDING_NONE || binding_type == SCANNER_BINDING_ARROW_ARG)
&& context_p->token.type != LEXER_EOS && context_p->token.type != LEXER_COMMA
@@ -1022,7 +957,6 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
info_p->type = SCANNER_TYPE_LITERAL_FLAGS;
info_p->u8_arg = object_literal_flags;
}
-#endif /* JERRY_ESNEXT */
scanner_context_p->mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
return SCAN_KEEP_TOKEN;
@@ -1051,20 +985,6 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
}
return SCAN_NEXT_TOKEN;
}
-#else /* !JERRY_ESNEXT */
- case SCAN_STACK_OBJECT_LITERAL:
- {
- if (type != LEXER_RIGHT_BRACE)
- {
- break;
- }
-
- scanner_context_p->mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
- parser_stack_pop_uint8 (context_p);
- return SCAN_NEXT_TOKEN;
- }
- case SCAN_STACK_ARRAY_LITERAL:
-#endif /* JERRY_ESNEXT */
case SCAN_STACK_PROPERTY_ACCESSOR:
{
if (type != LEXER_RIGHT_SQUARE)
@@ -1076,7 +996,6 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
parser_stack_pop_uint8 (context_p);
return SCAN_NEXT_TOKEN;
}
-#if JERRY_ESNEXT
case SCAN_STACK_COMPUTED_PROPERTY:
{
if (type != LEXER_RIGHT_SQUARE)
@@ -1307,7 +1226,6 @@ scanner_scan_primary_expression_end (parser_context_t *context_p, /**< context *
scanner_context_p->mode = SCAN_MODE_CONTINUE_FUNCTION_ARGUMENTS;
return SCAN_KEEP_TOKEN;
}
-#endif /* JERRY_ESNEXT */
default:
{
scanner_context_p->mode = SCAN_MODE_STATEMENT_END;
@@ -1339,11 +1257,9 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
}
case LEXER_LEFT_BRACE:
{
-#if JERRY_ESNEXT
scanner_literal_pool_t *literal_pool_p;
literal_pool_p = scanner_push_literal_pool (context_p, scanner_context_p, 0);
literal_pool_p->source_p = context_p->source_p;
-#endif /* JERRY_ESNEXT */
scanner_context_p->mode = SCAN_MODE_STATEMENT_OR_TERMINATOR;
parser_stack_push_uint8 (context_p, SCAN_STACK_BLOCK_STATEMENT);
@@ -1364,11 +1280,9 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
scanner_raise_error (context_p);
}
-#if JERRY_ESNEXT
scanner_literal_pool_t *literal_pool_p;
literal_pool_p = scanner_push_literal_pool (context_p, scanner_context_p, 0);
literal_pool_p->source_p = context_p->source_p;
-#endif /* JERRY_ESNEXT */
scanner_context_p->mode = SCAN_MODE_STATEMENT_OR_TERMINATOR;
parser_stack_push_uint8 (context_p, SCAN_STACK_TRY_STATEMENT);
@@ -1430,12 +1344,10 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
{
lexer_next_token (context_p);
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_KEYW_AWAIT)
{
lexer_next_token (context_p);
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type != LEXER_LEFT_PAREN)
{
@@ -1450,9 +1362,7 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
lexer_next_token (context_p);
scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION;
-#if JERRY_ESNEXT
const uint8_t *source_p = context_p->source_p;
-#endif /* JERRY_ESNEXT */
switch (context_p->token.type)
{
@@ -1468,7 +1378,6 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
return_type = SCAN_NEXT_TOKEN;
break;
}
-#if JERRY_ESNEXT
case LEXER_LEFT_BRACE:
case LEXER_LEFT_SQUARE:
{
@@ -1528,7 +1437,6 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
((context_p->token.type == LEXER_KEYW_CONST) ? SCAN_STACK_FOR_CONST_START : SCAN_STACK_FOR_LET_START);
break;
}
-#endif /* JERRY_ESNEXT */
}
parser_stack_push (context_p, &for_statement, sizeof (scanner_for_statement_t));
@@ -1541,7 +1449,6 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
parser_stack_push_uint8 (context_p, SCAN_STACK_VAR);
return SCAN_NEXT_TOKEN;
}
-#if JERRY_ESNEXT
case LEXER_KEYW_LET:
{
scanner_context_p->mode = SCAN_MODE_VAR_STATEMENT;
@@ -1554,7 +1461,6 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
parser_stack_push_uint8 (context_p, SCAN_STACK_CONST);
return SCAN_NEXT_TOKEN;
}
-#endif /* JERRY_ESNEXT */
case LEXER_KEYW_THROW:
{
scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION;
@@ -1628,7 +1534,6 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
}
case LEXER_KEYW_FUNCTION:
{
-#if JERRY_ESNEXT
uint16_t status_flags = SCANNER_LITERAL_POOL_FUNCTION | SCANNER_LITERAL_POOL_FUNCTION_STATEMENT;
if (scanner_context_p->async_source_p != NULL)
@@ -1636,17 +1541,14 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
scanner_context_p->status_flags |= SCANNER_CONTEXT_THROW_ERR_ASYNC_FUNCTION;
status_flags |= SCANNER_LITERAL_POOL_ASYNC;
}
-#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_MULTIPLY)
{
status_flags |= SCANNER_LITERAL_POOL_GENERATOR;
lexer_next_token (context_p);
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type != LEXER_LITERAL || context_p->token.lit_location.type != LEXER_IDENT_LITERAL)
{
@@ -1655,7 +1557,6 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
lexer_lit_location_t *literal_p = scanner_add_literal (context_p, scanner_context_p);
-#if JERRY_ESNEXT
const uint8_t mask = (SCANNER_LITERAL_IS_ARG | SCANNER_LITERAL_IS_FUNC | SCANNER_LITERAL_IS_LOCAL);
if ((literal_p->type & SCANNER_LITERAL_IS_LOCAL)
@@ -1676,11 +1577,6 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
literal_p->type |= SCANNER_LITERAL_IS_LOCAL_FUNC;
scanner_context_p->status_flags &= (uint16_t) ~SCANNER_CONTEXT_THROW_ERR_ASYNC_FUNCTION;
-#else /* !JERRY_ESNEXT */
- literal_p->type |= SCANNER_LITERAL_IS_VAR | SCANNER_LITERAL_IS_FUNC;
-
- uint16_t status_flags = SCANNER_LITERAL_POOL_FUNCTION;
-#endif /* JERRY_ESNEXT */
scanner_push_literal_pool (context_p, scanner_context_p, status_flags);
@@ -1688,7 +1584,6 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
parser_stack_push_uint8 (context_p, SCAN_STACK_FUNCTION_STATEMENT);
return SCAN_NEXT_TOKEN;
}
-#if JERRY_ESNEXT
case LEXER_KEYW_CLASS:
{
lexer_lit_location_t *literal_p;
@@ -1717,7 +1612,6 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
return SCAN_NEXT_TOKEN;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
case LEXER_KEYW_IMPORT:
{
@@ -2019,7 +1913,6 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
JERRY_ASSERT (context_p->token.flags & LEXER_NO_SKIP_SPACES);
-#if JERRY_ESNEXT
/* The colon needs to be checked first because the parser also checks
* it first, and this check skips the spaces which affects source_p. */
if (JERRY_UNLIKELY (lexer_check_arrow (context_p)))
@@ -2071,7 +1964,6 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
}
return SCAN_KEEP_TOKEN;
}
-#endif /* JERRY_ESNEXT */
scanner_add_reference (context_p, scanner_context_p);
@@ -2116,9 +2008,7 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
break;
}
case SCAN_STACK_BLOCK_STATEMENT:
-#if JERRY_ESNEXT
case SCAN_STACK_CLASS_STATEMENT:
-#endif /* JERRY_ESNEXT */
case SCAN_STACK_FUNCTION_STATEMENT:
{
if (type != LEXER_RIGHT_BRACE)
@@ -2126,17 +2016,10 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
break;
}
-#if JERRY_ESNEXT
if (context_p->stack_top_uint8 != SCAN_STACK_CLASS_STATEMENT)
{
scanner_pop_literal_pool (context_p, scanner_context_p);
}
-#else /* !JERRY_ESNEXT */
- if (context_p->stack_top_uint8 == SCAN_STACK_FUNCTION_STATEMENT)
- {
- scanner_pop_literal_pool (context_p, scanner_context_p);
- }
-#endif /* JERRY_ESNEXT */
terminator_found = true;
parser_stack_pop_uint8 (context_p);
@@ -2147,9 +2030,7 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
continue;
}
case SCAN_STACK_FUNCTION_EXPRESSION:
-#if JERRY_ESNEXT
case SCAN_STACK_FUNCTION_ARROW:
-#endif /* JERRY_ESNEXT */
{
if (type != LEXER_RIGHT_BRACE)
{
@@ -2157,12 +2038,11 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
}
scanner_context_p->mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
-#if JERRY_ESNEXT
+
if (context_p->stack_top_uint8 == SCAN_STACK_FUNCTION_ARROW)
{
scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION_END;
}
-#endif /* JERRY_ESNEXT */
scanner_pop_literal_pool (context_p, scanner_context_p);
parser_stack_pop_uint8 (context_p);
@@ -2185,14 +2065,12 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
break;
}
-#if JERRY_ESNEXT
bool has_super_reference =
(scanner_context_p->active_literal_pool_p->status_flags & SCANNER_LITERAL_POOL_HAS_SUPER_REFERENCE) != 0;
-#endif /* JERRY_ESNEXT */
+
scanner_pop_literal_pool (context_p, scanner_context_p);
parser_stack_pop_uint8 (context_p);
-#if JERRY_ESNEXT
if (context_p->stack_top_uint8 == SCAN_STACK_EXPLICIT_CLASS_CONSTRUCTOR
|| context_p->stack_top_uint8 == SCAN_STACK_IMPLICIT_CLASS_CONSTRUCTOR)
{
@@ -2204,9 +2082,6 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
{
*parser_stack_get_prev_uint8 (context_p) |= SCANNER_LITERAL_OBJECT_HAS_SUPER;
}
-#else /* JERRY_ESNEXT */
- JERRY_ASSERT (context_p->stack_top_uint8 == SCAN_STACK_OBJECT_LITERAL);
-#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
@@ -2238,9 +2113,7 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
scanner_context_p->active_switch_statement = switch_statement;
-#if JERRY_ESNEXT
scanner_pop_literal_pool (context_p, scanner_context_p);
-#endif /* JERRY_ESNEXT */
terminator_found = true;
lexer_next_token (context_p);
@@ -2252,14 +2125,10 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
if (type == LEXER_KEYW_ELSE && (terminator_found || (context_p->token.flags & LEXER_WAS_NEWLINE)))
{
-#if JERRY_ESNEXT
scanner_check_function_after_if (context_p, scanner_context_p);
return SCAN_KEEP_TOKEN;
-#else /* !JERRY_ESNEXT */
- scanner_context_p->mode = SCAN_MODE_STATEMENT;
- return SCAN_NEXT_TOKEN;
-#endif /* JERRY_ESNEXT */
}
+
continue;
}
case SCAN_STACK_WITH_STATEMENT:
@@ -2303,7 +2172,6 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
terminator_found = true;
continue;
}
-#if JERRY_ESNEXT
case SCAN_STACK_CLASS_STATIC_BLOCK:
{
if (type != LEXER_RIGHT_BRACE)
@@ -2354,7 +2222,6 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
scanner_pop_literal_pool (context_p, scanner_context_p);
continue;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
case SCAN_STACK_EXPORT_DEFAULT:
{
@@ -2379,14 +2246,7 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
parser_stack_pop_uint8 (context_p);
lexer_next_token (context_p);
-#if JERRY_ESNEXT
scanner_pop_literal_pool (context_p, scanner_context_p);
-#else /* !JERRY_ESNEXT */
- if (stack_top == SCAN_STACK_CATCH_STATEMENT)
- {
- scanner_pop_literal_pool (context_p, scanner_context_p);
- }
-#endif /* JERRY_ESNEXT */
/* A finally statement is optional after a try or catch statement. */
if (context_p->token.type == LEXER_KEYW_FINALLY)
@@ -2398,11 +2258,9 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
scanner_raise_error (context_p);
}
-#if JERRY_ESNEXT
scanner_literal_pool_t *literal_pool_p;
literal_pool_p = scanner_push_literal_pool (context_p, scanner_context_p, 0);
literal_pool_p->source_p = context_p->source_p;
-#endif /* JERRY_ESNEXT */
parser_stack_push_uint8 (context_p, SCAN_STACK_BLOCK_STATEMENT);
scanner_context_p->mode = SCAN_MODE_STATEMENT_OR_TERMINATOR;
@@ -2428,13 +2286,11 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
literal_pool_p->source_p = context_p->source_p;
parser_stack_push_uint8 (context_p, SCAN_STACK_CATCH_STATEMENT);
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_LEFT_BRACE)
{
scanner_context_p->mode = SCAN_MODE_STATEMENT_OR_TERMINATOR;
return SCAN_NEXT_TOKEN;
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type != LEXER_LEFT_PAREN)
{
@@ -2443,7 +2299,6 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
lexer_next_token (context_p);
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_LEFT_SQUARE || context_p->token.type == LEXER_LEFT_BRACE)
{
scanner_push_destructuring_pattern (context_p, scanner_context_p, SCANNER_BINDING_CATCH, false);
@@ -2460,7 +2315,6 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
scanner_context_p->mode = SCAN_MODE_PROPERTY_NAME;
return SCAN_KEEP_TOKEN;
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type != LEXER_LITERAL || context_p->token.lit_location.type != LEXER_IDENT_LITERAL)
{
@@ -2522,22 +2376,16 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
scanner_context.status_flags |= SCANNER_CONTEXT_DEBUGGER_ENABLED;
}
#endif /* JERRY_DEBUGGER */
-#if JERRY_ESNEXT
scanner_context.binding_type = SCANNER_BINDING_NONE;
scanner_context.active_binding_list_p = NULL;
-#endif /* JERRY_ESNEXT */
scanner_context.active_literal_pool_p = NULL;
scanner_context.active_switch_statement.last_case_p = NULL;
scanner_context.end_arguments_p = NULL;
-#if JERRY_ESNEXT
scanner_context.async_source_p = NULL;
-#endif /* JERRY_ESNEXT */
/* This assignment must be here because of Apple compilers. */
context_p->u.scanner_context_p = &scanner_context;
-#if JERRY_ESNEXT
context_p->global_status_flags |= ECMA_PARSE_INTERNAL_PRE_SCANNING;
-#endif /* JERRY_ESNEXT */
parser_stack_init (context_p);
@@ -2576,7 +2424,6 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
status_flags |= SCANNER_LITERAL_POOL_IS_STRICT;
}
-#if JERRY_ESNEXT
if (context_p->status_flags & PARSER_IS_GENERATOR_FUNCTION)
{
status_flags |= SCANNER_LITERAL_POOL_GENERATOR;
@@ -2585,7 +2432,6 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
{
status_flags |= SCANNER_LITERAL_POOL_ASYNC;
}
-#endif /* JERRY_ESNEXT */
scanner_push_literal_pool (context_p, &scanner_context, status_flags);
scanner_context.mode = SCAN_MODE_FUNCTION_ARGUMENTS;
@@ -2618,7 +2464,6 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
}
break;
}
-#if JERRY_ESNEXT
case SCAN_MODE_CLASS_DECLARATION:
{
if (context_p->token.type == LEXER_KEYW_EXTENDS)
@@ -2886,7 +2731,6 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
scanner_context.mode = SCAN_MODE_CLASS_BODY_NO_SCAN;
continue;
}
-#endif /* JERRY_ESNEXT */
case SCAN_MODE_POST_PRIMARY_EXPRESSION:
{
if (scanner_scan_post_primary_expression (context_p, &scanner_context, type, stack_top))
@@ -2937,7 +2781,6 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
}
case SCAN_MODE_VAR_STATEMENT:
{
-#if JERRY_ESNEXT
if (type == LEXER_LEFT_SQUARE || type == LEXER_LEFT_BRACE)
{
uint8_t binding_type = SCANNER_BINDING_VAR;
@@ -2965,7 +2808,6 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
scanner_context.mode = SCAN_MODE_PROPERTY_NAME;
continue;
}
-#endif /* JERRY_ESNEXT */
if (type != LEXER_LITERAL || context_p->token.lit_location.type != LEXER_IDENT_LITERAL)
{
@@ -2974,7 +2816,6 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
lexer_lit_location_t *literal_p = scanner_add_literal (context_p, &scanner_context);
-#if JERRY_ESNEXT
if (stack_top != SCAN_STACK_VAR && stack_top != SCAN_STACK_FOR_VAR_START)
{
scanner_detect_invalid_let (context_p, literal_p);
@@ -3019,16 +2860,6 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
lexer_next_token (context_p);
}
-#else /* !JERRY_ESNEXT */
- literal_p->type |= SCANNER_LITERAL_IS_VAR;
-
- if (scanner_context.active_literal_pool_p->status_flags & SCANNER_LITERAL_POOL_IN_WITH)
- {
- literal_p->type |= SCANNER_LITERAL_NO_REG;
- }
-
- lexer_next_token (context_p);
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
if (scanner_context.active_literal_pool_p->status_flags & SCANNER_LITERAL_POOL_IN_EXPORT)
@@ -3067,11 +2898,7 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
continue;
}
-#if JERRY_ESNEXT
JERRY_ASSERT (stack_top == SCAN_STACK_VAR || stack_top == SCAN_STACK_LET || stack_top == SCAN_STACK_CONST);
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (stack_top == SCAN_STACK_VAR);
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
scanner_context.active_literal_pool_p->status_flags &= (uint16_t) ~SCANNER_LITERAL_POOL_IN_EXPORT;
@@ -3092,14 +2919,12 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
literal_pool_p->source_p = context_p->source_p;
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (scanner_context.async_source_p != NULL))
{
literal_pool_p->status_flags |= SCANNER_LITERAL_POOL_ASYNC;
literal_pool_p->source_p = scanner_context.async_source_p;
scanner_context.async_source_p = NULL;
}
-#endif /* JERRY_ESNEXT */
if (type != LEXER_LEFT_PAREN)
{
@@ -3107,7 +2932,6 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
}
lexer_next_token (context_p);
-#if JERRY_ESNEXT
/* FALLTHRU */
}
case SCAN_MODE_CONTINUE_FUNCTION_ARGUMENTS:
@@ -3188,28 +3012,6 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
break;
}
}
-#else /* !JERRY_ESNEXT */
- if (context_p->token.type != LEXER_RIGHT_PAREN && context_p->token.type != LEXER_EOS)
- {
- while (true)
- {
- if (context_p->token.type != LEXER_LITERAL || context_p->token.lit_location.type != LEXER_IDENT_LITERAL)
- {
- scanner_raise_error (context_p);
- }
-
- scanner_append_argument (context_p, &scanner_context);
- lexer_next_token (context_p);
-
- if (context_p->token.type != LEXER_COMMA)
- {
- break;
- }
-
- lexer_next_token (context_p);
- }
- }
-#endif /* JERRY_ESNEXT */
if (context_p->token.type == LEXER_EOS && stack_top == SCAN_STACK_SCRIPT_FUNCTION)
{
@@ -3225,9 +3027,7 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
context_p->source_end_p = context_p->source_start_p + context_p->source_size;
lexer_init_line_info (context_p);
-#if JERRY_ESNEXT
scanner_filter_arguments (context_p, &scanner_context);
-#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
scanner_check_directives (context_p, &scanner_context);
continue;
@@ -3245,9 +3045,7 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
scanner_raise_error (context_p);
}
-#if JERRY_ESNEXT
scanner_filter_arguments (context_p, &scanner_context);
-#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
scanner_check_directives (context_p, &scanner_context);
continue;
@@ -3261,7 +3059,6 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
lexer_check_property_modifier (context_p);
}
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_LEFT_SQUARE)
{
parser_stack_push_uint8 (context_p, SCAN_STACK_COMPUTED_PROPERTY);
@@ -3280,7 +3077,6 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
}
break;
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type == LEXER_RIGHT_BRACE)
{
@@ -3288,15 +3084,11 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
continue;
}
- if (context_p->token.type == LEXER_PROPERTY_GETTER
-#if JERRY_ESNEXT
- || context_p->token.type == LEXER_KEYW_ASYNC || context_p->token.type == LEXER_MULTIPLY
-#endif /* JERRY_ESNEXT */
- || context_p->token.type == LEXER_PROPERTY_SETTER)
+ if (context_p->token.type == LEXER_PROPERTY_GETTER || context_p->token.type == LEXER_KEYW_ASYNC
+ || context_p->token.type == LEXER_MULTIPLY || context_p->token.type == LEXER_PROPERTY_SETTER)
{
uint16_t literal_pool_flags = SCANNER_LITERAL_POOL_FUNCTION;
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_MULTIPLY)
{
literal_pool_flags |= SCANNER_LITERAL_POOL_GENERATOR;
@@ -3310,19 +3102,16 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
literal_pool_flags |= SCANNER_LITERAL_POOL_GENERATOR;
}
}
-#endif /* JERRY_ESNEXT */
parser_stack_push_uint8 (context_p, SCAN_STACK_FUNCTION_PROPERTY);
lexer_scan_identifier (context_p, LEXER_PARSE_NO_OPTS);
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_LEFT_SQUARE)
{
parser_stack_push_uint8 (context_p, SCANNER_FROM_LITERAL_POOL_TO_COMPUTED (literal_pool_flags));
scanner_context.mode = SCAN_MODE_PRIMARY_EXPRESSION;
break;
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type != LEXER_LITERAL)
{
@@ -3339,15 +3128,12 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
scanner_raise_error (context_p);
}
-#if JERRY_ESNEXT
parser_line_counter_t start_line = context_p->token.line;
parser_line_counter_t start_column = context_p->token.column;
bool is_ident = (context_p->token.lit_location.type == LEXER_IDENT_LITERAL);
-#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
-#if JERRY_ESNEXT
if (context_p->token.type == LEXER_LEFT_PAREN)
{
scanner_push_literal_pool (context_p, &scanner_context, SCANNER_LITERAL_POOL_FUNCTION);
@@ -3394,7 +3180,6 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
scanner_context.mode = SCAN_MODE_PRIMARY_EXPRESSION_END;
continue;
}
-#endif /* JERRY_ESNEXT */
if (context_p->token.type != LEXER_COLON)
{
@@ -3403,15 +3188,12 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
scanner_context.mode = SCAN_MODE_PRIMARY_EXPRESSION;
-#if JERRY_ESNEXT
if (scanner_context.binding_type != SCANNER_BINDING_NONE)
{
scanner_context.mode = SCAN_MODE_BINDING;
}
-#endif /* JERRY_ESNEXT */
break;
}
-#if JERRY_ESNEXT
case SCAN_MODE_BINDING:
{
JERRY_ASSERT (scanner_context.binding_type == SCANNER_BINDING_VAR
@@ -3535,7 +3317,6 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
scanner_context.mode = SCAN_MODE_PRIMARY_EXPRESSION;
break;
}
-#endif /* JERRY_ESNEXT */
}
lexer_next_token (context_p);
@@ -3549,9 +3330,7 @@ scan_completed:
scanner_pop_literal_pool (context_p, &scanner_context);
-#if JERRY_ESNEXT
JERRY_ASSERT (scanner_context.active_binding_list_p == NULL);
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (scanner_context.active_literal_pool_p == NULL);
#ifndef JERRY_NDEBUG
@@ -3560,12 +3339,10 @@ scan_completed:
}
PARSER_CATCH
{
-#if JERRY_ESNEXT
while (scanner_context.active_binding_list_p != NULL)
{
scanner_pop_binding_list (&scanner_context);
}
-#endif /* JERRY_ESNEXT */
if (JERRY_UNLIKELY (context_p->error != PARSER_ERR_OUT_OF_MEMORY))
{
@@ -3575,7 +3352,6 @@ scan_completed:
/* The following code may allocate memory, so it is enclosed in a try/catch. */
PARSER_TRY (context_p->try_buffer)
{
-#if JERRY_ESNEXT
if (scanner_context.status_flags & SCANNER_CONTEXT_THROW_ERR_ASYNC_FUNCTION)
{
JERRY_ASSERT (scanner_context.async_source_p != NULL);
@@ -3584,7 +3360,6 @@ scan_completed:
info_p = scanner_insert_info (context_p, scanner_context.async_source_p, sizeof (scanner_info_t));
info_p->type = SCANNER_TYPE_ERR_ASYNC_FUNCTION;
}
-#endif /* JERRY_ESNEXT */
while (scanner_context.active_literal_pool_p != NULL)
{
@@ -3619,9 +3394,7 @@ scan_completed:
PARSER_TRY_END
context_p->status_flags = scanner_context.context_status_flags;
-#if JERRY_ESNEXT
context_p->global_status_flags &= (uint32_t) ~ECMA_PARSE_INTERNAL_PRE_SCANNING;
-#endif /* JERRY_ESNEXT */
scanner_reverse_info_list (context_p);
#if JERRY_PARSER_DUMP_BYTE_CODE
@@ -3675,7 +3448,6 @@ scan_completed:
data_p++;
continue;
}
-#if JERRY_ESNEXT
case SCANNER_STREAM_TYPE_ARGUMENTS:
{
JERRY_DEBUG_MSG (" ARGUMENTS%s%s\n",
@@ -3692,20 +3464,11 @@ scan_completed:
data_p++;
continue;
}
-#else /* !JERRY_ESNEXT */
- case SCANNER_STREAM_TYPE_ARGUMENTS:
- {
- JERRY_DEBUG_MSG (" ARGUMENTS%s\n", (data_p[0] & SCANNER_STREAM_NO_REG) ? " *" : "");
- data_p++;
- continue;
- }
-#endif /* JERRY_ESNEXT */
case SCANNER_STREAM_TYPE_VAR:
{
JERRY_DEBUG_MSG (" VAR ");
break;
}
-#if JERRY_ESNEXT
case SCANNER_STREAM_TYPE_LET:
{
JERRY_DEBUG_MSG (" LET ");
@@ -3721,7 +3484,6 @@ scan_completed:
JERRY_DEBUG_MSG (" LOCAL ");
break;
}
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
case SCANNER_STREAM_TYPE_IMPORT:
{
@@ -3734,7 +3496,6 @@ scan_completed:
JERRY_DEBUG_MSG (" ARG ");
break;
}
-#if JERRY_ESNEXT
case SCANNER_STREAM_TYPE_ARG_VAR:
{
JERRY_DEBUG_MSG (" ARG_VAR ");
@@ -3750,19 +3511,16 @@ scan_completed:
JERRY_DEBUG_MSG (" DESTRUCTURED_ARG_VAR ");
break;
}
-#endif /* JERRY_ESNEXT */
case SCANNER_STREAM_TYPE_ARG_FUNC:
{
JERRY_DEBUG_MSG (" ARG_FUNC ");
break;
}
-#if JERRY_ESNEXT
case SCANNER_STREAM_TYPE_DESTRUCTURED_ARG_FUNC:
{
JERRY_DEBUG_MSG (" DESTRUCTURED_ARG_FUNC ");
break;
}
-#endif /* JERRY_ESNEXT */
case SCANNER_STREAM_TYPE_FUNC:
{
JERRY_DEBUG_MSG (" FUNC ");
@@ -3804,13 +3562,11 @@ scan_completed:
length = 2 + 2;
}
-#if JERRY_ESNEXT
if (data_p[0] & SCANNER_STREAM_EARLY_CREATE)
{
JERRY_ASSERT (data_p[0] & SCANNER_STREAM_NO_REG);
JERRY_DEBUG_MSG ("*");
}
-#endif /* JERRY_ESNEXT */
if (data_p[0] & SCANNER_STREAM_NO_REG)
{
@@ -3848,14 +3604,12 @@ scan_completed:
print_location = true;
break;
}
-#if JERRY_ESNEXT
case SCANNER_TYPE_FOR_OF:
{
name_p = "FOR-OF";
print_location = true;
break;
}
-#endif /* JERRY_ESNEXT */
case SCANNER_TYPE_SWITCH:
{
JERRY_DEBUG_MSG (" SWITCH: source:%d\n", (int) (info_p->source_p - source_start_p));
@@ -3879,7 +3633,6 @@ scan_completed:
print_location = true;
break;
}
-#if JERRY_ESNEXT
case SCANNER_TYPE_INITIALIZER:
{
scanner_location_info_t *location_info_p = (scanner_location_info_t *) info_p;
@@ -3938,7 +3691,6 @@ scan_completed:
print_location = false;
break;
}
-#endif /* JERRY_ESNEXT */
}
if (print_location)
diff --git a/jerry-core/parser/js/js-scanner.h b/jerry-core/parser/js/js-scanner.h
index 64b77e79..78655685 100644
--- a/jerry-core/parser/js/js-scanner.h
+++ b/jerry-core/parser/js/js-scanner.h
@@ -39,12 +39,9 @@ typedef enum
SCANNER_TYPE_WHILE, /**< while statement */
SCANNER_TYPE_FOR, /**< for statement */
SCANNER_TYPE_FOR_IN, /**< for-in statement */
-#if JERRY_ESNEXT
SCANNER_TYPE_FOR_OF, /**< for-of statement */
-#endif /* JERRY_ESNEXT */
SCANNER_TYPE_SWITCH, /**< switch statement */
SCANNER_TYPE_CASE, /**< case statement */
-#if JERRY_ESNEXT
SCANNER_TYPE_INITIALIZER, /**< destructuring binding or assignment pattern with initializer */
SCANNER_TYPE_LITERAL_FLAGS, /**< object or array literal with non-zero flags (stored in u8_arg) */
SCANNER_TYPE_CLASS_CONSTRUCTOR, /**< class constructor */
@@ -54,7 +51,6 @@ typedef enum
SCANNER_TYPE_ERR_REDECLARED, /**< syntax error: a variable is redeclared */
SCANNER_TYPE_ERR_ASYNC_FUNCTION, /**< an invalid async function follows */
SCANNER_TYPE_EXPORT_MODULE_SPECIFIER, /**< export with module specifier */
-#endif /* JERRY_ESNEXT */
} scanner_info_type_t;
/**
@@ -167,10 +163,8 @@ typedef enum
SCANNER_STREAM_HAS_ESCAPE = (1 << 6), /**< binding has escape */
SCANNER_STREAM_NO_REG = (1 << 5), /**< binding cannot be stored in register */
SCANNER_STREAM_EARLY_CREATE = (1 << 4), /**< binding must be created with ECMA_VALUE_UNINITIALIZED */
-#if JERRY_ESNEXT
SCANNER_STREAM_LOCAL_ARGUMENTS = SCANNER_STREAM_EARLY_CREATE, /**< arguments is redeclared
* as let/const binding later */
-#endif /* JERRY_ESNEXT */
/* Update SCANNER_STREAM_TYPE_MASK macro if more bits are added. */
} scanner_compressed_stream_flags_t;
@@ -182,35 +176,27 @@ typedef enum
SCANNER_STREAM_TYPE_END, /**< end of scanner data */
SCANNER_STREAM_TYPE_HOLE, /**< no name is assigned to this argument */
SCANNER_STREAM_TYPE_ARGUMENTS, /**< arguments object should be created */
-#if JERRY_ESNEXT
SCANNER_STREAM_TYPE_ARGUMENTS_FUNC, /**< arguments object should be created which
* is later initialized with a function */
-#endif /* JERRY_ESNEXT */
SCANNER_STREAM_TYPE_VAR, /**< var declaration */
-#if JERRY_ESNEXT
SCANNER_STREAM_TYPE_LET, /**< let declaration */
SCANNER_STREAM_TYPE_CONST, /**< const declaration */
SCANNER_STREAM_TYPE_LOCAL, /**< local declaration (e.g. catch block) */
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
SCANNER_STREAM_TYPE_IMPORT, /**< module import */
#endif /* JERRY_MODULE_SYSTEM */
/* The next four types must be in this order (see SCANNER_STREAM_TYPE_IS_ARG). */
SCANNER_STREAM_TYPE_ARG, /**< argument declaration */
-#if JERRY_ESNEXT
SCANNER_STREAM_TYPE_ARG_VAR, /**< argument declaration which is later copied
* into a variable declared by var statement */
SCANNER_STREAM_TYPE_DESTRUCTURED_ARG, /**< destructuring argument declaration */
SCANNER_STREAM_TYPE_DESTRUCTURED_ARG_VAR, /**< destructuring argument declaration which is later
* copied into a variable declared by var statement */
-#endif /* JERRY_ESNEXT */
/* Function types should be at the end. See the SCANNER_STREAM_TYPE_IS_FUNCTION macro. */
SCANNER_STREAM_TYPE_ARG_FUNC, /**< argument declaration which
* is later initialized with a function */
-#if JERRY_ESNEXT
SCANNER_STREAM_TYPE_DESTRUCTURED_ARG_FUNC, /**< destructuring argument declaration which
* is later initialized with a function */
-#endif /* JERRY_ESNEXT */
SCANNER_STREAM_TYPE_FUNC, /**< function declaration */
} scanner_compressed_stream_types_t;
@@ -224,8 +210,6 @@ typedef enum
*/
#define SCANNER_STREAM_TYPE_IS_FUNCTION(type) ((type) >= SCANNER_STREAM_TYPE_ARG_FUNC)
-#if JERRY_ESNEXT
-
/**
* Checks whether the decoded type represents a function argument.
*/
@@ -244,25 +228,6 @@ typedef enum
#define SCANNER_STREAM_TYPE_IS_ARGUMENTS(type) \
((type) == SCANNER_STREAM_TYPE_ARGUMENTS || (type) == SCANNER_STREAM_TYPE_ARGUMENTS_FUNC)
-#else /* !JERRY_ESNEXT */
-
-/**
- * Checks whether the decoded type represents a function argument.
- */
-#define SCANNER_STREAM_TYPE_IS_ARG(type) ((type) == SCANNER_STREAM_TYPE_ARG)
-
-/**
- * Checks whether the decoded type represents both a function argument and a function declaration.
- */
-#define SCANNER_STREAM_TYPE_IS_ARG_FUNC(type) ((type) == SCANNER_STREAM_TYPE_ARG_FUNC)
-
-/**
- * Checks whether the decoded type represents an arguments declaration
- */
-#define SCANNER_STREAM_TYPE_IS_ARGUMENTS(type) ((type) == SCANNER_STREAM_TYPE_ARGUMENTS)
-
-#endif /* JERRY_ESNEXT */
-
/**
* Constants for u8_arg flags in scanner_function_info_t.
*/
@@ -270,12 +235,10 @@ typedef enum
{
SCANNER_FUNCTION_ARGUMENTS_NEEDED = (1 << 0), /**< arguments object needs to be created */
SCANNER_FUNCTION_HAS_COMPLEX_ARGUMENT = (1 << 1), /**< function has complex (ES2015+) argument definition */
-#if JERRY_ESNEXT
SCANNER_FUNCTION_LEXICAL_ENV_NEEDED = (1 << 2), /**< lexical environment is needed for the function body */
SCANNER_FUNCTION_STATEMENT = (1 << 3), /**< function is function statement (not arrow expression)
* this flag must be combined with the type of function (e.g. async) */
SCANNER_FUNCTION_ASYNC = (1 << 4), /**< function is async function */
-#endif /* JERRY_ESNEXT */
SCANNER_FUNCTION_IS_STRICT = (1 << 5), /**< function is strict */
} scanner_function_flags_t;
@@ -306,8 +269,6 @@ typedef enum
SCANNER_PRIVATE_FIELD_PROPERTY_GETTER_SETTER = (SCANNER_PRIVATE_FIELD_PROPERTY | SCANNER_PRIVATE_FIELD_GETTER_SETTER),
} scanner_private_field_flags_t;
-#if JERRY_ESNEXT
-
/**
* Object or array literal constants for u8_arg flags in scanner_info_t.
*/
@@ -321,8 +282,6 @@ typedef enum
SCANNER_LITERAL_OBJECT_HAS_REST = (1 << 3), /**< the object literal has a member prefixed with three dots */
} scanner_literal_flags_t;
-#endif /* JERRY_ESNEXT */
-
/**
* Option bits for scanner_create_variables function.
*/
diff --git a/jerry-core/parser/js/parser-error-messages.inc.h b/jerry-core/parser/js/parser-error-messages.inc.h
index 45b158ea..cfb96494 100644
--- a/jerry-core/parser/js/parser-error-messages.inc.h
+++ b/jerry-core/parser/js/parser-error-messages.inc.h
@@ -16,9 +16,6 @@
/* This file is automatically generated by the gen-strings.py script
* from parser-error-messages.ini. Do not edit! */
-#if JERRY_PARSER && !(JERRY_ESNEXT)
-PARSER_ERROR_DEF (PARSER_ERR_INVALID_NUMBER, "Invalid number")
-#endif /* JERRY_PARSER && !(JERRY_ESNEXT) */
#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_DUPLICATED_LABEL, "Duplicated label")
PARSER_ERROR_DEF (PARSER_ERR_LEFT_PAREN_EXPECTED, "Expected '(' token")
@@ -28,10 +25,10 @@ PARSER_ERROR_DEF (PARSER_ERR_SEMICOLON_EXPECTED, "Expected ';' token")
PARSER_ERROR_DEF (PARSER_ERR_RIGHT_SQUARE_EXPECTED, "Expected ']' token")
PARSER_ERROR_DEF (PARSER_ERR_LEFT_BRACE_EXPECTED, "Expected '{' token")
#endif /* JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER || JERRY_MODULE_SYSTEM
+#if JERRY_MODULE_SYSTEM || JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_RIGHT_BRACE_EXPECTED, "Expected '}' token")
-#endif /* JERRY_ESNEXT && JERRY_PARSER \
-|| JERRY_MODULE_SYSTEM */
+#endif /* JERRY_MODULE_SYSTEM \
+|| JERRY_PARSER */
#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_NUMBER_TOO_LONG, "Number is too long")
#endif /* JERRY_PARSER */
@@ -47,30 +44,22 @@ PARSER_ERROR_DEF (PARSER_ERR_AS_EXPECTED, "Expected 'as' token")
#endif /* JERRY_MODULE_SYSTEM && JERRY_PARSER */
#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_IN_EXPECTED, "Expected 'in' token")
-#endif /* JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_OF_EXPECTED, "Expected 'of' token")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
-#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_EXPRESSION_EXPECTED, "Expression expected")
#endif /* JERRY_PARSER */
#if JERRY_MODULE_SYSTEM || JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_IDENTIFIER_EXPECTED, "Identifier expected")
#endif /* JERRY_MODULE_SYSTEM \
|| JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
-PARSER_ERROR_DEF (PARSER_ERR_INVALID_OCTAL_DIGIT, "Invalid octal digit")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
#if JERRY_PARSER
+PARSER_ERROR_DEF (PARSER_ERR_INVALID_OCTAL_DIGIT, "Invalid octal digit")
PARSER_ERROR_DEF (PARSER_ERR_INVALID_SWITCH, "Invalid switch body")
#endif /* JERRY_PARSER */
#if JERRY_BUILTIN_REGEXP && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_UNKNOWN_REGEXP_FLAG, "Unknown regexp flag")
#endif /* JERRY_BUILTIN_REGEXP && JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
-PARSER_ERROR_DEF (PARSER_ERR_INVALID_BIN_DIGIT, "Invalid binary digit")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
#if JERRY_PARSER
+PARSER_ERROR_DEF (PARSER_ERR_INVALID_BIN_DIGIT, "Invalid binary digit")
PARSER_ERROR_DEF (PARSER_ERR_INVALID_RIGHT_SQUARE, "Unexpected '}' token")
#endif /* JERRY_PARSER */
#if JERRY_MODULE_SYSTEM && JERRY_PARSER
@@ -91,10 +80,8 @@ PARSER_ERROR_DEF (PARSER_ERR_META_EXPECTED, "Expected 'meta' keyword")
#endif /* JERRY_MODULE_SYSTEM && JERRY_PARSER */
#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_UNEXPECTED_END, "Unexpected end of input")
-#endif /* JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_UNEXPECTED_PRIVATE_FIELD, "Unexpected private field")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
+#endif /* JERRY_PARSER */
#if JERRY_MODULE_SYSTEM && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_LEFT_BRACE_MULTIPLY_EXPECTED, "Expected '{' or '*' token")
#endif /* JERRY_MODULE_SYSTEM && JERRY_PARSER */
@@ -117,10 +104,10 @@ PARSER_ERROR_DEF (PARSER_ERR_FROM_COMMA_EXPECTED, "Expected 'from' or ',' token"
#if JERRY_MODULE_SYSTEM
PARSER_ERROR_DEF (PARSER_ERR_EXPORT_NOT_DEFINED, "Export not defined in module")
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_ESNEXT && JERRY_PARSER || JERRY_MODULE_SYSTEM
+#if JERRY_MODULE_SYSTEM || JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_VARIABLE_REDECLARED, "Local variable is redeclared")
-#endif /* JERRY_ESNEXT && JERRY_PARSER \
-|| JERRY_MODULE_SYSTEM */
+#endif /* JERRY_MODULE_SYSTEM \
+|| JERRY_PARSER */
#if JERRY_BUILTIN_BIGINT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_INVALID_BIGINT, "Number is not a valid BigInt")
#endif /* JERRY_BUILTIN_BIGINT && JERRY_PARSER */
@@ -130,10 +117,8 @@ PARSER_ERROR_DEF (PARSER_ERR_PROPERTY_IDENTIFIER_EXPECTED, "Property identifier
#if JERRY_MODULE_SYSTEM
PARSER_ERROR_DEF (PARSER_ERR_DUPLICATED_EXPORT_IDENTIFIER, "Duplicate exported identifier")
#endif /* JERRY_MODULE_SYSTEM */
-#if JERRY_ESNEXT && JERRY_PARSER
-PARSER_ERROR_DEF (PARSER_ERR_NEW_TARGET_EXPECTED, "Expected new.target expression")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
#if JERRY_PARSER
+PARSER_ERROR_DEF (PARSER_ERR_NEW_TARGET_EXPECTED, "Expected new.target expression")
PARSER_ERROR_DEF (PARSER_ERR_INVALID_CHARACTER, "Invalid (unexpected) character")
PARSER_ERROR_DEF (PARSER_ERR_NON_STRICT_ARG_DEFINITION, "Non-strict argument definition")
PARSER_ERROR_DEF (PARSER_ERR_UNTERMINATED_MULTILINE_COMMENT, "Unterminated multiline comment")
@@ -145,36 +130,23 @@ PARSER_ERROR_DEF (PARSER_ERR_DUPLICATED_IMPORT_BINDING, "Duplicated imported bin
#endif /* JERRY_MODULE_SYSTEM */
#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_WHILE_EXPECTED, "While expected for do-while loop")
-#endif /* JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_DELETE_PRIVATE_FIELD, "Private fields can not be deleted")
PARSER_ERROR_DEF (PARSER_ERR_INVALID_LHS_FOR_LOOP, "Invalid left-hand-side in for-loop")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
-#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_LEFT_HAND_SIDE_EXP_EXPECTED, "Left-hand-side expression expected")
PARSER_ERROR_DEF (PARSER_ERR_LITERAL_LIMIT_REACHED, "Maximum number of literals reached")
PARSER_ERROR_DEF (PARSER_ERR_STACK_LIMIT_REACHED, "Maximum function stack size reached")
-#endif /* JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_AWAIT_NOT_ALLOWED, "Await expression is not allowed here")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
+#endif /* JERRY_PARSER */
#if JERRY_MODULE_SYSTEM && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_LEFT_BRACE_MULTIPLY_LITERAL_EXPECTED, "Expected '{' or '*' or literal token")
#endif /* JERRY_MODULE_SYSTEM && JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
-PARSER_ERROR_DEF (PARSER_ERR_INVALID_LHS_ASSIGNMENT, "Invalid left-hand side in assignment")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
#if JERRY_PARSER
+PARSER_ERROR_DEF (PARSER_ERR_INVALID_LHS_ASSIGNMENT, "Invalid left-hand side in assignment")
PARSER_ERROR_DEF (PARSER_ERR_SCOPE_STACK_LIMIT_REACHED, "Maximum depth of scope stack reached")
-#endif /* JERRY_PARSER */
-#if !JERRY_ESNEXT && JERRY_PARSER
-PARSER_ERROR_DEF (PARSER_ERR_OBJECT_PROPERTY_REDEFINED, "Property of object literal redefined")
-#endif /* !JERRY_ESNEXT && JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_UNEXPECTED_SUPER_KEYWORD, "Super is not allowed to be used here")
PARSER_ERROR_DEF (PARSER_ERR_YIELD_NOT_ALLOWED, "Yield expression is not allowed here")
PARSER_ERROR_DEF (PARSER_ERR_MULTIPLE_CLASS_CONSTRUCTORS, "Multiple constructors are not allowed")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
+#endif /* JERRY_PARSER */
#if JERRY_MODULE_SYSTEM
PARSER_ERROR_DEF (PARSER_ERR_MODULE_UNEXPECTED, "Unexpected import or export statement")
#endif /* JERRY_MODULE_SYSTEM */
@@ -182,21 +154,13 @@ PARSER_ERROR_DEF (PARSER_ERR_MODULE_UNEXPECTED, "Unexpected import or export sta
PARSER_ERROR_DEF (PARSER_ERR_IDENTIFIER_AFTER_NUMBER, "Identifier cannot start after a number")
PARSER_ERROR_DEF (PARSER_ERR_MULTIPLE_DEFAULTS_NOT_ALLOWED, "Multiple default cases are not allowed")
PARSER_ERROR_DEF (PARSER_ERR_ARRAY_ITEM_SEPARATOR_EXPECTED, "Expected ',' or ']' after an array item")
-#endif /* JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_ILLEGAL_PROPERTY_IN_DECLARATION, "Illegal property in declaration context")
PARSER_ERROR_DEF (PARSER_ERR_INVALID_DESTRUCTURING_PATTERN, "Invalid destructuring assignment target")
PARSER_ERROR_DEF (PARSER_ERR_DUPLICATED_PRIVATE_FIELD, "Private field has already been declared")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
-#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_NO_ARGUMENTS_EXPECTED, "Property getters must have no arguments")
PARSER_ERROR_DEF (PARSER_ERR_ONE_ARGUMENT_EXPECTED, "Property setters must have one argument")
PARSER_ERROR_DEF (PARSER_ERR_CASE_NOT_IN_SWITCH, "Case statement must be in a switch block")
-#endif /* JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_CLASS_CONSTRUCTOR_AS_ACCESSOR, "Class constructor may not be an accessor")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
-#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_INVALID_CONTINUE, "Continue statement must be inside a loop")
#endif /* JERRY_PARSER */
#if JERRY_MODULE_SYSTEM && JERRY_PARSER
@@ -206,37 +170,23 @@ PARSER_ERROR_DEF (PARSER_ERR_IMPORT_META_REQUIRE_MODULE, "Cannot use 'import.met
PARSER_ERROR_DEF (PARSER_ERR_INVALID_IDENTIFIER_PART, "Character cannot be part of an identifier")
PARSER_ERROR_DEF (PARSER_ERR_EVAL_CANNOT_ASSIGNED, "Eval cannot be assigned to in strict mode")
PARSER_ERROR_DEF (PARSER_ERR_WITH_NOT_ALLOWED, "With statement not allowed in strict mode")
-#endif /* JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_NEW_TARGET_NOT_ALLOWED, "new.target expression is not allowed here")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
-#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_INVALID_IDENTIFIER_START, "Character cannot be start of an identifier")
PARSER_ERROR_DEF (PARSER_ERR_STRICT_IDENT_NOT_ALLOWED, "Identifier name is reserved in strict mode")
-#endif /* JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_INVALID_NULLISH_COALESCING, "Cannot chain nullish with logical AND or OR")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
-#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_DEFAULT_NOT_IN_SWITCH, "Default statement must be in a switch block")
#endif /* JERRY_PARSER */
#if JERRY_MODULE_SYSTEM && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_IMPORT_AFTER_NEW, "Module import call is not allowed after new")
#endif /* JERRY_MODULE_SYSTEM && JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
-PARSER_ERROR_DEF (PARSER_ERR_TOO_MANY_CLASS_FIELDS, "Too many computed class fields are declared")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
#if JERRY_PARSER
+PARSER_ERROR_DEF (PARSER_ERR_TOO_MANY_CLASS_FIELDS, "Too many computed class fields are declared")
PARSER_ERROR_DEF (PARSER_ERR_INVALID_KEYWORD, "Escape sequences are not allowed in keywords")
PARSER_ERROR_DEF (PARSER_ERR_ARGUMENT_LIMIT_REACHED, "Maximum number of function arguments reached")
PARSER_ERROR_DEF (PARSER_ERR_NEWLINE_NOT_ALLOWED, "Newline is not allowed in strings or regexps")
PARSER_ERROR_DEF (PARSER_ERR_OCTAL_NUMBER_NOT_ALLOWED, "Octal numbers are not allowed in strict mode")
-#endif /* JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_CLASS_PRIVATE_CONSTRUCTOR, "Class constructor may not be a private method")
PARSER_ERROR_DEF (PARSER_ERR_FOR_AWAIT_NO_OF, "only 'of' form is allowed for for-await loops")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
-#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_ARGUMENTS_CANNOT_ASSIGNED, "Arguments cannot be assigned to in strict mode")
PARSER_ERROR_DEF (PARSER_ERR_INVALID_BREAK, "Break statement must be inside a loop or switch")
PARSER_ERROR_DEF (PARSER_ERR_OBJECT_ITEM_SEPARATOR_EXPECTED, "Expected ',' or '}' after a property definition")
@@ -248,41 +198,23 @@ PARSER_ERROR_DEF (PARSER_ERR_UNSUPPORTED_REGEXP, "Regexp is not supported in the
#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_INVALID_RETURN, "Return statement must be inside a function body")
PARSER_ERROR_DEF (PARSER_ERR_COLON_FOR_CONDITIONAL_EXPECTED, "Expected ':' token for ?: conditional expression")
-#endif /* JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_FORMAL_PARAM_AFTER_REST_PARAMETER, "Rest parameter must be the last formal parameter")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
-#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_DELETE_IDENT_NOT_ALLOWED, "Deleting identifier is not allowed in strict mode")
-#endif /* JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_LABELLED_FUNC_NOT_IN_BLOCK, "Labelled functions are only allowed inside blocks")
PARSER_ERROR_DEF (PARSER_ERR_REST_PARAMETER_DEFAULT_INITIALIZER, "Rest parameter may not have a default initializer")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
-#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_EVAL_NOT_ALLOWED, "Eval is not allowed to be used here in strict mode")
PARSER_ERROR_DEF (PARSER_ERR_INVALID_CONTINUE_LABEL, "Labeled statement targeted by a continue not found")
-#endif /* JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_LEXICAL_LET_BINDING, "Let binding cannot appear in let/const declarations")
PARSER_ERROR_DEF (PARSER_ERR_UNDECLARED_PRIVATE_FIELD, "Private field must be declared in an enclosing class")
PARSER_ERROR_DEF (PARSER_ERR_INVALID_LHS_PREFIX_OP, "Invalid left-hand side expression in prefix operation")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
-#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_OCTAL_ESCAPE_NOT_ALLOWED, "Octal escape sequences are not allowed in strict mode")
-#endif /* JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_SETTER_REST_PARAMETER, "Setter function argument must not be a rest parameter")
PARSER_ERROR_DEF (PARSER_ERR_ARGUMENTS_IN_CLASS_FIELD, "In class field declarations 'arguments' is not allowed")
PARSER_ERROR_DEF (PARSER_ERR_INVALID_LHS_POSTFIX_OP, "Invalid left-hand side expression in postfix operation")
PARSER_ERROR_DEF (PARSER_ERR_INVALID_UNDERSCORE_IN_NUMBER, "Invalid use of underscore character in number literals")
PARSER_ERROR_DEF (PARSER_ERR_INVALID_EXPONENTIATION, "Left operand of ** operator cannot be unary expression")
PARSER_ERROR_DEF (PARSER_ERR_MISSING_ASSIGN_AFTER_CONST, "Value assignment is expected after a const declaration")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
-#if JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_ARGUMENTS_NOT_ALLOWED, "Arguments is not allowed to be used here in strict mode")
-#endif /* JERRY_PARSER */
-#if JERRY_ESNEXT && JERRY_PARSER
PARSER_ERROR_DEF (PARSER_ERR_DUPLICATED_ARGUMENT_NAMES, "Duplicated function argument names are not allowed here")
PARSER_ERROR_DEF (PARSER_ERR_CLASS_STATIC_PROTOTYPE, "Classes may not have a static property called 'prototype'")
PARSER_ERROR_DEF (PARSER_ERR_INVALID_CLASS_CONSTRUCTOR, "Class constructor may not be a generator or async function")
@@ -298,4 +230,4 @@ PARSER_ERROR_DEF (PARSER_ERR_USE_STRICT_NOT_ALLOWED,
"The 'use strict' directive is not allowed for functions with non-simple arguments")
PARSER_ERROR_DEF (PARSER_ERR_ASSIGNMENT_EXPECTED,
"Unexpected arrow function or yield expression (parentheses around the expression may help)")
-#endif /* JERRY_ESNEXT && JERRY_PARSER */
+#endif /* JERRY_PARSER */
diff --git a/jerry-core/parser/js/parser-error-messages.ini b/jerry-core/parser/js/parser-error-messages.ini
index d709f39a..585d7526 100644
--- a/jerry-core/parser/js/parser-error-messages.ini
+++ b/jerry-core/parser/js/parser-error-messages.ini
@@ -73,7 +73,6 @@ PARSER_ERR_INVALID_LHS_FOR_LOOP = "Invalid left-hand-side in for-loop"
PARSER_ERR_INVALID_LHS_POSTFIX_OP = "Invalid left-hand side expression in postfix operation"
PARSER_ERR_INVALID_LHS_PREFIX_OP = "Invalid left-hand side expression in prefix operation"
PARSER_ERR_INVALID_NULLISH_COALESCING = "Cannot chain nullish with logical AND or OR"
-PARSER_ERR_INVALID_NUMBER = "Invalid number"
PARSER_ERR_INVALID_OCTAL_DIGIT = "Invalid octal digit"
PARSER_ERR_INVALID_RETURN = "Return statement must be inside a function body"
PARSER_ERR_INVALID_RIGHT_SQUARE = "Unexpected '}' token"
@@ -103,7 +102,6 @@ PARSER_ERR_NON_STRICT_ARG_DEFINITION = "Non-strict argument definition"
PARSER_ERR_NO_ARGUMENTS_EXPECTED = "Property getters must have no arguments"
PARSER_ERR_NUMBER_TOO_LONG = "Number is too long"
PARSER_ERR_OBJECT_ITEM_SEPARATOR_EXPECTED = "Expected ',' or '}' after a property definition"
-PARSER_ERR_OBJECT_PROPERTY_REDEFINED = "Property of object literal redefined"
PARSER_ERR_OCTAL_ESCAPE_NOT_ALLOWED = "Octal escape sequences are not allowed in strict mode"
PARSER_ERR_OCTAL_NUMBER_NOT_ALLOWED = "Octal numbers are not allowed in strict mode"
PARSER_ERR_OF_EXPECTED = "Expected 'of' token"
diff --git a/jerry-core/parser/regexp/re-bytecode.c b/jerry-core/parser/regexp/re-bytecode.c
index 82b62ee6..cfdbb90c 100644
--- a/jerry-core/parser/regexp/re-bytecode.c
+++ b/jerry-core/parser/regexp/re-bytecode.c
@@ -277,22 +277,14 @@ void
re_append_char (re_compiler_ctx_t *re_ctx_p, /**< RegExp bytecode context */
const lit_code_point_t cp) /**< code point */
{
-#if JERRY_ESNEXT
const size_t size = (re_ctx_p->flags & RE_FLAG_UNICODE) ? sizeof (lit_code_point_t) : sizeof (ecma_char_t);
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (re_ctx_p);
- const size_t size = sizeof (ecma_char_t);
-#endif /* !JERRY_ESNEXT */
-
uint8_t *dest_p = re_bytecode_reserve (re_ctx_p, size);
-#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
re_encode_u32 (dest_p, cp);
return;
}
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (cp <= LIT_UTF16_CODE_UNIT_MAX);
re_encode_u16 (dest_p, (ecma_char_t) cp);
@@ -306,22 +298,15 @@ re_insert_char (re_compiler_ctx_t *re_ctx_p, /**< RegExp bytecode context */
const uint32_t offset, /**< bytecode offset */
const lit_code_point_t cp) /**< code point*/
{
-#if JERRY_ESNEXT
const size_t size = (re_ctx_p->flags & RE_FLAG_UNICODE) ? sizeof (lit_code_point_t) : sizeof (ecma_char_t);
-#else /* !JERRY_ESNEXT */
- JERRY_UNUSED (re_ctx_p);
- const size_t size = sizeof (ecma_char_t);
-#endif /* !JERRY_ESNEXT */
uint8_t *dest_p = re_bytecode_insert (re_ctx_p, offset, size);
-#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
re_encode_u32 (dest_p, cp);
return;
}
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (cp <= LIT_UTF16_CODE_UNIT_MAX);
re_encode_u16 (dest_p, (ecma_char_t) cp);
@@ -338,16 +323,12 @@ re_get_char (const uint8_t **bc_p, /**< reference to bytecode pointer */
{
lit_code_point_t cp;
-#if !JERRY_ESNEXT
- JERRY_UNUSED (unicode);
-#else /* JERRY_ESNEXT */
if (unicode)
{
cp = re_decode_u32 (*bc_p);
*bc_p += sizeof (lit_code_point_t);
}
else
-#endif /* JERRY_ESNEXT */
{
cp = re_decode_u16 (*bc_p);
*bc_p += sizeof (ecma_char_t);
@@ -594,13 +575,11 @@ re_dump_bytecode (re_compiler_ctx_t *re_ctx_p) /**< RegExp bytecode context */
JERRY_DEBUG_MSG ("\n");
break;
}
-#if JERRY_ESNEXT
case RE_OP_UNICODE_PERIOD:
{
JERRY_DEBUG_MSG ("UNICODE_PERIOD\n");
break;
}
-#endif /* JERRY_ESNEXT */
case RE_OP_PERIOD:
{
JERRY_DEBUG_MSG ("PERIOD\n");
diff --git a/jerry-core/parser/regexp/re-bytecode.h b/jerry-core/parser/regexp/re-bytecode.h
index 07028d6d..9fd8456d 100644
--- a/jerry-core/parser/regexp/re-bytecode.h
+++ b/jerry-core/parser/regexp/re-bytecode.h
@@ -82,9 +82,7 @@ typedef enum
RE_OP_CLASS_ESCAPE, /**< class escape */
RE_OP_CHAR_CLASS, /**< character class */
-#if JERRY_ESNEXT
RE_OP_UNICODE_PERIOD, /**< period in full unicode mode */
-#endif /* JERRY_ESNEXT */
RE_OP_PERIOD, /**< period in non-unicode mode */
RE_OP_CHAR, /**< any code point */
RE_OP_BYTE, /**< 1-byte utf8 character */
diff --git a/jerry-core/parser/regexp/re-parser.c b/jerry-core/parser/regexp/re-parser.c
index 0361b34e..b1176dc4 100644
--- a/jerry-core/parser/regexp/re-parser.c
+++ b/jerry-core/parser/regexp/re-parser.c
@@ -388,7 +388,6 @@ re_count_groups (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context */
}
} /* re_count_groups */
-#if JERRY_ESNEXT
/**
* Check if a code point is a Syntax character
*
@@ -403,7 +402,6 @@ re_is_syntax_char (lit_code_point_t cp) /**< code point */
|| cp == LIT_CHAR_RIGHT_PAREN || cp == LIT_CHAR_LEFT_SQUARE || cp == LIT_CHAR_RIGHT_SQUARE
|| cp == LIT_CHAR_LEFT_BRACE || cp == LIT_CHAR_RIGHT_BRACE || cp == LIT_CHAR_VLINE);
} /* re_is_syntax_char */
-#endif /* JERRY_ESNEXT */
/**
* Parse a Character Escape or a Character Class Escape.
@@ -429,12 +427,10 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
return ECMA_VALUE_EMPTY;
}
-#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
return ecma_raise_syntax_error (ECMA_ERR_INVALID_ESCAPE_SEQUENCE);
}
-#endif /* JERRY_ESNEXT */
/* Legacy octal escape sequence */
if (lit_char_is_octal_digit (*re_ctx_p->input_curr_p))
@@ -531,12 +527,10 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
}
}
-#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
return ecma_raise_syntax_error (ECMA_ERR_INVALID_CONTROL_ESCAPE_SEQUENCE);
}
-#endif /* JERRY_ESNEXT */
re_ctx_p->token.value = LIT_CHAR_BACKSLASH;
re_ctx_p->input_curr_p--;
@@ -554,12 +548,10 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
break;
}
-#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
return ecma_raise_syntax_error (ECMA_ERR_INVALID_HEX_ESCAPE_SEQUENCE);
}
-#endif /* JERRY_ESNEXT */
re_ctx_p->token.value = LIT_CHAR_LOWERCASE_X;
break;
@@ -573,7 +565,6 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
re_ctx_p->token.value = hex_value;
re_ctx_p->input_curr_p += 4;
-#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE && lit_is_code_point_utf16_high_surrogate (re_ctx_p->token.value)
&& re_ctx_p->input_curr_p + 6 <= re_ctx_p->input_end_p && re_ctx_p->input_curr_p[0] == '\\'
&& re_ctx_p->input_curr_p[1] == 'u')
@@ -586,12 +577,10 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
re_ctx_p->input_curr_p += 6;
}
}
-#endif /* JERRY_ESNEXT */
break;
}
-#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
if (re_ctx_p->input_curr_p + 1 < re_ctx_p->input_end_p && re_ctx_p->input_curr_p[0] == LIT_CHAR_LEFT_BRACE
@@ -620,7 +609,6 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
return ecma_raise_syntax_error (ECMA_ERR_INVALID_UNICODE_ESCAPE_SEQUENCE);
}
-#endif /* JERRY_ESNEXT */
re_ctx_p->token.value = LIT_CHAR_LOWERCASE_U;
break;
@@ -628,13 +616,11 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
/* Identity escape */
default:
{
-#if JERRY_ESNEXT
/* Must be '/', or one of SyntaxCharacter */
if (re_ctx_p->flags & RE_FLAG_UNICODE && ch != LIT_CHAR_SLASH && !re_is_syntax_char (ch))
{
return ecma_raise_syntax_error (ECMA_ERR_INVALID_ESCAPE);
}
-#endif /* JERRY_ESNEXT */
re_ctx_p->token.value = ch;
}
}
@@ -811,12 +797,10 @@ re_parse_next_token (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
return ecma_raise_syntax_error (ECMA_ERR_NOTHING_TO_REPEAT);
}
-#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
return ecma_raise_syntax_error (ECMA_ERR_LONE_QUANTIFIER_BRACKET);
}
-#endif /* JERRY_ESNEXT */
re_ctx_p->input_curr_p++;
re_ctx_p->token.type = RE_TOK_CHAR;
@@ -825,7 +809,6 @@ re_parse_next_token (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
/* Check quantifier */
break;
}
-#if JERRY_ESNEXT
case LIT_CHAR_RIGHT_SQUARE:
case LIT_CHAR_RIGHT_BRACE:
{
@@ -836,13 +819,11 @@ re_parse_next_token (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
/* FALLTHRU */
}
-#endif /* JERRY_ESNEXT */
default:
{
re_ctx_p->token.type = RE_TOK_CHAR;
re_ctx_p->token.value = ch;
-#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE && lit_is_code_point_utf16_high_surrogate (ch)
&& re_ctx_p->input_curr_p < re_ctx_p->input_end_p)
{
@@ -853,7 +834,6 @@ re_parse_next_token (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
re_ctx_p->input_curr_p += LIT_UTF8_MAX_BYTES_IN_CODE_UNIT;
}
}
-#endif /* JERRY_ESNEXT */
/* Check quantifier */
break;
@@ -974,13 +954,11 @@ re_parse_char_class (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
re_ctx_p->input_curr_p++;
current = LIT_CHAR_BS;
}
-#if JERRY_ESNEXT
else if (*re_ctx_p->input_curr_p == LIT_CHAR_MINUS)
{
re_ctx_p->input_curr_p++;
current = LIT_CHAR_MINUS;
}
-#endif /* JERRY_ESNEXT */
else if ((re_ctx_p->flags & RE_FLAG_UNICODE) == 0 && *re_ctx_p->input_curr_p == LIT_CHAR_LOWERCASE_C
&& re_ctx_p->input_curr_p + 1 < re_ctx_p->input_end_p
&& (lit_char_is_decimal_digit (*(re_ctx_p->input_curr_p + 1))
@@ -1009,12 +987,10 @@ re_parse_char_class (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
}
}
}
-#if JERRY_ESNEXT
else if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
current = ecma_regexp_unicode_advance (&re_ctx_p->input_curr_p, re_ctx_p->input_end_p);
}
-#endif /* JERRY_ESNEXT */
else
{
current = lit_cesu8_read_next (&re_ctx_p->input_curr_p);
@@ -1036,12 +1012,10 @@ re_parse_char_class (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
continue;
}
-#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
return ecma_raise_syntax_error (ECMA_ERR_INVALID_CHARACTER_CLASS);
}
-#endif /* JERRY_ESNEXT */
if (start != RE_INVALID_CP)
{
@@ -1180,12 +1154,7 @@ re_parse_alternative (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context
}
case RE_TOK_PERIOD:
{
-#if JERRY_ESNEXT
re_append_opcode (re_ctx_p, (re_ctx_p->flags & RE_FLAG_UNICODE) ? RE_OP_UNICODE_PERIOD : RE_OP_PERIOD);
-#else /* !JERRY_ESNEXT */
- re_append_opcode (re_ctx_p, RE_OP_PERIOD);
-#endif /* !JERRY_ESNEXT */
-
re_insert_atom_iterator (re_ctx_p, atom_offset);
break;
}
@@ -1232,7 +1201,6 @@ re_parse_alternative (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context
return result;
}
-#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
re_ctx_p->token.qmin = 1;
@@ -1240,7 +1208,6 @@ re_parse_alternative (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context
re_ctx_p->token.greedy = true;
}
else
-#endif /* JERRY_ESNEXT */
{
re_parse_quantifier (re_ctx_p);
diff --git a/jerry-core/profiles/README.md b/jerry-core/profiles/README.md
index d60c4c47..87c72e3c 100644
--- a/jerry-core/profiles/README.md
+++ b/jerry-core/profiles/README.md
@@ -56,8 +56,10 @@ In JerryScript all of the features are enabled by default, so an empty profile f
The defines can have a value of `0` or `1`. If for whatever reason one of them are not defined, it is treated as if it were
defined to `1`.
-#### ES 5.1 features
+#### Built-ins
+* `JERRY_BUILTINS`:
+ Enables or disable all of the Built-in objects
* `JERRY_BUILTIN_ANNEXB`:
Enables or disables the [Annex B](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-B) of the ECMA5.1 standard.
* `JERRY_BUILTIN_ARRAY`:
@@ -79,23 +81,6 @@ defined to `1`.
Enables or disables the [RegExp](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.10) built-in.
* `JERRY_BUILTIN_STRING`:
Enables or disables the [String](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.5) built-in.
-* `JERRY_BUILTINS`:
- Enables or disable all of the [Standard Built-in ECMAScript 5.1 Objects](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15)
- This option is evaluated first, any other `JERRY_BUILTIN_<name>` defines will override that specific builtin config.
- Equivalent with setting the following defines to the `JERRY_BUILTINS` value:
- * `JERRY_BUILTIN_ANNEXB`
- * `JERRY_BUILTIN_ARRAY`
- * `JERRY_BUILTIN_BOOLEAN`
- * `JERRY_BUILTIN_DATE`
- * `JERRY_BUILTIN_ERRORS`
- * `JERRY_BUILTIN_JSON`
- * `JERRY_BUILTIN_MATH`
- * `JERRY_BUILTIN_NUMBER`
- * `JERRY_BUILTIN_REGEXP`
- * `JERRY_BUILTIN_STRING`
-
-#### ES2015+ features
-
* `JERRY_BUILTIN_BIGINT`:
Enables or disables the [BigInt](https://262.ecma-international.org/11.0/#sec-ecmascript-language-types-bigint-type) syntax and built-in.
* `JERRY_BUILTIN_CONTAINER`:
@@ -120,36 +105,4 @@ defined to `1`.
Enables or disables the [WeakRef](https://tc39.es/ecma262/#sec-weak-ref-constructor) built-in.
* `JERRY_MODULE_SYSTEM`:
Enables or disable the [module system](http://www.ecma-international.org/ecma-262/6.0/#sec-modules) language element.
-* `JERRY_ESNEXT`: Enables or disables all of the implemented [ECMAScript2015+ features](http://www.ecma-international.org/ecma-262/10.0/) above.
- * [arrow functions](http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions) language element.
- * [async functions](https://262.ecma-international.org/11.0/#sec-async-function-definitions) language element.
- * [class](https://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions) language element.
- * [default value](http://www.ecma-international.org/ecma-262/6.0/#sec-function-definitions) for formal parameters.
- * [destructuring assignment](http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment) language element.
- * [destructuring binding pattern](http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-binding-patterns) declarations.
- * [enhanced object initializer](http://www.ecma-international.org/ecma-262/6.0/#sec-object-initializer) language element.
- * [for-of](https://www.ecma-international.org/ecma-262/6.0/#sec-for-in-and-for-of-statements) language element.
- * [for-await-of](https://262.ecma-international.org/11.0/#sec-for-in-and-for-of-statements) language element.
- * [generator functions](http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions) language element.
- * [iterator](https://www.ecma-international.org/ecma-262/6.0/#sec-iterator-interface) built-in.
- * [nullish coalescing](https://262.ecma-international.org/11.0/#prod-CoalesceExpression) built-in.
- * [numeric separator](https://github.com/tc39/proposal-numeric-separator) language element.
- * [Promise](http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects) built-in.
- * [rest parameter](http://www.ecma-international.org/ecma-262/6.0/#sec-function-definitions) language element.
- * [rest operator with object destructuring](https://262.ecma-international.org/11.0/#prod-ObjectBindingPattern) language element.
- * [spread](https://262.ecma-international.org/11.0/#prod-SpreadElement) syntax.
- * [symbol](https://www.ecma-international.org/ecma-262/6.0/#sec-symbol-objects) language element.
- * [template strings](http://www.ecma-international.org/ecma-262/6.0/#sec-static-semantics-templatestrings) language element.
-
- Furthermore all builtins follow the latest ECMAScript specification including those which behave differently in ES5.1.
- This option is evaluated first, any other `JERRY_<name>` defines will override that specific entry.
- Equivalent with setting the following defines to the `JERRY_ESNEXT` value:
- * `JERRY_BUILTIN_BIGINT`
- * `JERRY_BUILTIN_CONTAINER`
- * `JERRY_BUILTIN_DATAVIEW`
- * `JERRY_BUILTIN_GLOBAL_THIS`
- * `JERRY_BUILTIN_PROXY`
- * `JERRY_BUILTIN_REALMS`
- * `JERRY_BUILTIN_REFLECT`
- * `JERRY_BUILTIN_TYPEDARRAY`
- * `JERRY_MODULE_SYSTEM`
+
diff --git a/jerry-core/profiles/es2015-subset.profile b/jerry-core/profiles/es2015-subset.profile
deleted file mode 100644
index 93c0f357..00000000
--- a/jerry-core/profiles/es2015-subset.profile
+++ /dev/null
@@ -1 +0,0 @@
-# Currently an empty profile.
diff --git a/jerry-core/profiles/es5.1.profile b/jerry-core/profiles/es5.1.profile
deleted file mode 100644
index fbe0e34b..00000000
--- a/jerry-core/profiles/es5.1.profile
+++ /dev/null
@@ -1 +0,0 @@
-JERRY_ESNEXT=0
diff --git a/jerry-core/profiles/minimal.profile b/jerry-core/profiles/minimal.profile
index d431bfe6..5aa7b894 100644
--- a/jerry-core/profiles/minimal.profile
+++ b/jerry-core/profiles/minimal.profile
@@ -1,3 +1,2 @@
JERRY_BUILTINS=0
-JERRY_ESNEXT=0
JERRY_UNICODE_CASE_CONVERSION=0
diff --git a/jerry-core/vm/opcodes-ecma-arithmetics.c b/jerry-core/vm/opcodes-ecma-arithmetics.c
index ec19aa75..d6503a40 100644
--- a/jerry-core/vm/opcodes-ecma-arithmetics.c
+++ b/jerry-core/vm/opcodes-ecma-arithmetics.c
@@ -105,13 +105,11 @@ do_number_arithmetic (number_arithmetic_op op, /**< number arithmetic operation
result = ecma_number_remainder (left_number, right_number);
break;
}
-#if JERRY_ESNEXT
case NUMBER_ARITHMETIC_EXPONENTIATION:
{
result = ecma_number_pow (left_number, right_number);
break;
}
-#endif /* JERRY_ESNEXT */
}
ret_value = ecma_make_number_value (result);
@@ -150,13 +148,11 @@ do_number_arithmetic (number_arithmetic_op op, /**< number arithmetic operation
ret_value = ecma_bigint_div_mod (left_value, right_value, true);
break;
}
-#if JERRY_ESNEXT
case NUMBER_ARITHMETIC_EXPONENTIATION:
{
ret_value = ecma_bigint_pow (left_value, right_value);
break;
}
-#endif /* JERRY_ESNEXT */
}
ecma_free_value (left_value);
diff --git a/jerry-core/vm/opcodes-ecma-relational-equality.c b/jerry-core/vm/opcodes-ecma-relational-equality.c
index 23040e03..b3602adf 100644
--- a/jerry-core/vm/opcodes-ecma-relational-equality.c
+++ b/jerry-core/vm/opcodes-ecma-relational-equality.c
@@ -107,7 +107,6 @@ opfunc_instanceof (ecma_value_t left_value, /**< left value */
return ecma_raise_type_error (ECMA_ERR_RIGHT_VALUE_OF_INSTANCEOF_MUST_BE_AN_OBJECT);
}
-#if JERRY_ESNEXT
ecma_value_t has_instance_method = ecma_op_get_method_by_symbol_id (right_value, LIT_GLOBAL_SYMBOL_HAS_INSTANCE);
if (ECMA_IS_VALUE_ERROR (has_instance_method))
{
@@ -131,7 +130,6 @@ opfunc_instanceof (ecma_value_t left_value, /**< left value */
return ecma_make_boolean_value (has_instance);
}
-#endif /* JERRY_ESNEXT */
ecma_object_t *right_value_obj_p = ecma_get_object_from_value (right_value);
return ecma_op_object_has_instance (right_value_obj_p, left_value);
diff --git a/jerry-core/vm/opcodes.c b/jerry-core/vm/opcodes.c
index 933a724f..85c1f656 100644
--- a/jerry-core/vm/opcodes.c
+++ b/jerry-core/vm/opcodes.c
@@ -184,13 +184,6 @@ vm_op_delete_prop (ecma_value_t object, /**< base object */
ecma_value_t property, /**< property name */
bool is_strict) /**< strict mode */
{
-#if !JERRY_ESNEXT
- if (ecma_is_value_undefined (object))
- {
- return ECMA_VALUE_TRUE;
- }
-#endif /* !JERRY_ESNEXT */
-
if (!ecma_op_require_object_coercible (object))
{
return ECMA_VALUE_ERROR;
@@ -215,12 +208,10 @@ vm_op_delete_prop (ecma_value_t object, /**< base object */
ecma_deref_object (obj_p);
ecma_deref_ecma_string (name_string_p);
-#if JERRY_ESNEXT
if (is_strict && ecma_is_value_false (delete_op_ret))
{
return ecma_raise_type_error (ECMA_ERR_OPERATOR_DELETE_RETURNED_FALSE_IN_STRICT_MODE);
}
-#endif /* JERRY_ESNEXT */
return delete_op_ret;
} /* vm_op_delete_prop */
@@ -296,14 +287,12 @@ opfunc_for_in (ecma_value_t iterable_value, /**< ideally an iterable value */
ecma_object_t *obj_p = ecma_get_object_from_value (obj_expr_value);
ecma_collection_t *prop_names_p = ecma_op_object_enumerate (obj_p);
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (prop_names_p == NULL))
{
ecma_deref_object (obj_p);
*result_obj_p = ECMA_VALUE_ERROR;
return NULL;
}
-#endif /* JERRY_ESNEXT */
if (prop_names_p->item_count != 0)
{
@@ -317,8 +306,6 @@ opfunc_for_in (ecma_value_t iterable_value, /**< ideally an iterable value */
return NULL;
} /* opfunc_for_in */
-#if JERRY_ESNEXT
-
/**
* 'VM_OC_APPEND_ARRAY' opcode handler specialized for spread objects
*
@@ -498,8 +485,6 @@ opfunc_spread_arguments (ecma_value_t *stack_top_p, /**< pointer to the current
return buff_p;
} /* opfunc_spread_arguments */
-#endif /* JERRY_ESNEXT */
-
/**
* 'VM_OC_APPEND_ARRAY' opcode handler, for setting array object properties
*
@@ -511,12 +496,10 @@ opfunc_append_array (ecma_value_t *stack_top_p, /**< current stack top */
uint16_t values_length) /**< number of elements to set
* with potential OPFUNC_HAS_SPREAD_ELEMENT flag */
{
-#if JERRY_ESNEXT
if (values_length >= OPFUNC_HAS_SPREAD_ELEMENT)
{
return opfunc_append_to_spread_array (stack_top_p, (uint16_t) (values_length & ~OPFUNC_HAS_SPREAD_ELEMENT));
}
-#endif /* JERRY_ESNEXT */
ecma_object_t *array_obj_p = ecma_get_object_from_value (stack_top_p[-1]);
JERRY_ASSERT (ecma_get_object_type (array_obj_p) == ECMA_OBJECT_TYPE_ARRAY);
@@ -574,8 +557,6 @@ opfunc_append_array (ecma_value_t *stack_top_p, /**< current stack top */
return ECMA_VALUE_EMPTY;
} /* opfunc_append_array */
-#if JERRY_ESNEXT
-
/**
* Create an executable object using the current frame context
*
@@ -905,7 +886,7 @@ opfunc_async_create_and_await (vm_frame_ctx_t *frame_ctx_p, /**< frame context *
static ecma_value_t
opfunc_private_method_or_accessor_add (ecma_object_t *class_object_p, /**< the function itself */
ecma_object_t *this_obj_p, /**< this object */
- uint32_t static_flag)
+ uint32_t static_flag) /**< static_flag */
{
ecma_string_t *internal_string_p = ecma_get_internal_string (LIT_INTERNAL_MAGIC_STRING_CLASS_PRIVATE_ELEMENTS);
ecma_property_t *prop_p = ecma_find_named_property (class_object_p, internal_string_p);
@@ -985,7 +966,9 @@ opfunc_private_method_or_accessor_add (ecma_object_t *class_object_p, /**< the f
* ECMA_VALUE_{TRUE/FALSE} - otherwise
*/
ecma_value_t
-opfunc_define_field (ecma_value_t base, ecma_value_t property, ecma_value_t value)
+opfunc_define_field (ecma_value_t base, /**< base */
+ ecma_value_t property, /**< property */
+ ecma_value_t value) /**< value */
{
ecma_string_t *property_key_p = ecma_op_to_property_key (property);
@@ -1216,6 +1199,8 @@ opfunc_set_home_object (ecma_object_t *func_p, /**< function object */
/**
* Make private key from descriptor
+ *
+ * @return pointer to private key
*/
ecma_string_t *
opfunc_make_private_key (ecma_value_t descriptor) /**< descriptor */
@@ -1228,6 +1213,9 @@ opfunc_make_private_key (ecma_value_t descriptor) /**< descriptor */
/**
* Find a private property in the private elements internal property given the key
+ *
+ * @return pointer to the private property - if it is found,
+ * NULL - othervise
*/
static ecma_property_t *
opfunc_find_private_key (ecma_object_t *class_object_p, /**< class environment */
@@ -1291,7 +1279,7 @@ static ecma_property_t *
opfunc_find_private_element (ecma_object_t *obj_p, /**< object */
ecma_string_t *key_p, /**< key */
ecma_string_t **private_key_p, /**< [out] private key */
- bool allow_heritage)
+ bool allow_heritage) /**< heritage flag */
{
JERRY_ASSERT (private_key_p != NULL);
JERRY_ASSERT (*private_key_p == NULL);
@@ -1342,7 +1330,8 @@ opfunc_find_private_element (ecma_object_t *obj_p, /**< object */
* ECMA_VALUE_FALSE - otherwise
*/
ecma_value_t
-opfunc_private_in (ecma_value_t base, ecma_value_t property)
+opfunc_private_in (ecma_value_t base, /**< base */
+ ecma_value_t property) /**< property */
{
if (!ecma_is_value_object (base))
{
@@ -1514,11 +1503,13 @@ opfunc_private_get (ecma_value_t base, /**< this object */
/**
* Find the private property in the object who's private key descriptor matches the given key
+ *
+ * @return pointer to private key
*/
static ecma_string_t *
-opfunc_create_private_key (ecma_value_t *collection_p, /**< TODO */
+opfunc_create_private_key (ecma_value_t *collection_p, /**< collection of private properties */
ecma_value_t search_key, /**< key */
- ecma_private_property_kind_t search_kind)
+ ecma_private_property_kind_t search_kind) /**< kind of the property */
{
if (search_kind < ECMA_PRIVATE_GETTER)
{
@@ -1561,7 +1552,10 @@ opfunc_create_private_key (ecma_value_t *collection_p, /**< TODO */
* Collect private members for PrivateMethodOrAccessorAdd and PrivateFieldAdd abstract operations
*/
void
-opfunc_collect_private_properties (ecma_value_t constructor, ecma_value_t prop_name, ecma_value_t value, uint8_t opcode)
+opfunc_collect_private_properties (ecma_value_t constructor, /**< constructor */
+ ecma_value_t prop_name, /**< property name */
+ ecma_value_t value, /**< value */
+ uint8_t opcode) /**< opcode */
{
ecma_private_property_kind_t kind = ECMA_PRIVATE_FIELD;
bool is_static = false;
@@ -2303,8 +2297,6 @@ opfunc_lexical_scope_has_restricted_binding (vm_frame_ctx_t *frame_ctx_p, /**< f
&& !ecma_is_property_configurable (property));
} /* opfunc_lexical_scope_has_restricted_binding */
-#endif /* JERRY_ESNEXT */
-
/**
* @}
* @}
diff --git a/jerry-core/vm/opcodes.h b/jerry-core/vm/opcodes.h
index 1657755d..7a964bc3 100644
--- a/jerry-core/vm/opcodes.h
+++ b/jerry-core/vm/opcodes.h
@@ -36,9 +36,7 @@ typedef enum
NUMBER_ARITHMETIC_MULTIPLICATION, /**< multiplication */
NUMBER_ARITHMETIC_DIVISION, /**< division */
NUMBER_ARITHMETIC_REMAINDER, /**< remainder calculation */
-#if JERRY_ESNEXT
NUMBER_ARITHMETIC_EXPONENTIATION, /**< exponentiation */
-#endif /* JERRY_ESNEXT */
} number_arithmetic_op;
/**
@@ -54,8 +52,6 @@ typedef enum
NUMBER_BITWISE_SHIFT_URIGHT, /**< bitwise UNSIGNED RIGHT SHIFT calculation */
} number_bitwise_logic_op;
-#if JERRY_ESNEXT
-
/**
* Types for opfunc_create_executable_object.
*/
@@ -65,8 +61,6 @@ typedef enum
VM_CREATE_EXECUTABLE_OBJECT_ASYNC, /**< create an async function */
} vm_create_executable_object_type_t;
-#endif /* JERRY_ESNEXT */
-
/**
* The stack contains spread object during the upcoming APPEND_ARRAY operation
*/
@@ -102,14 +96,10 @@ ecma_value_t vm_op_delete_var (ecma_value_t name_literal, ecma_object_t *lex_env
ecma_collection_t *opfunc_for_in (ecma_value_t left_value, ecma_value_t *result_obj_p);
-#if JERRY_ESNEXT
ecma_collection_t *opfunc_spread_arguments (ecma_value_t *stack_top_p, uint8_t argument_list_len);
-#endif /* JERRY_ESNEXT */
ecma_value_t opfunc_append_array (ecma_value_t *stack_top_p, uint16_t values_length);
-#if JERRY_ESNEXT
-
vm_executable_object_t *opfunc_create_executable_object (vm_frame_ctx_t *frame_ctx_p,
vm_create_executable_object_type_t type);
@@ -174,7 +164,6 @@ ecma_value_t
opfunc_copy_data_properties (ecma_value_t target_object, ecma_value_t source_object, ecma_value_t filter_array);
ecma_value_t opfunc_lexical_scope_has_restricted_binding (vm_frame_ctx_t *vm_frame_ctx_p, ecma_string_t *name_p);
-#endif /* JERRY_ESNEXT */
/**
* @}
diff --git a/jerry-core/vm/vm-defines.h b/jerry-core/vm/vm-defines.h
index 0f93427f..7ca78131 100644
--- a/jerry-core/vm/vm-defines.h
+++ b/jerry-core/vm/vm-defines.h
@@ -45,13 +45,11 @@ typedef enum
VM_FRAME_CTX_SHARED_DIRECT_EVAL = (1 << 1), /**< direct eval call */
VM_FRAME_CTX_SHARED_FREE_THIS = (1 << 2), /**< free this binding */
VM_FRAME_CTX_SHARED_FREE_LOCAL_ENV = (1 << 3), /**< free local environment */
-#if JERRY_ESNEXT
VM_FRAME_CTX_SHARED_NON_ARROW_FUNC = (1 << 4), /**< non-arrow function */
VM_FRAME_CTX_SHARED_HERITAGE_PRESENT = (1 << 5), /**< class heritage present */
VM_FRAME_CTX_SHARED_HAS_CLASS_FIELDS = (1 << 6), /**< has class fields */
VM_FRAME_CTX_SHARED_EXECUTABLE = (1 << 7), /**< frame is an executable object constructed
* with opfunc_create_executable_object */
-#endif /* JERRY_ESNEXT */
} vm_frame_ctx_shared_flags_t;
/**
@@ -74,8 +72,6 @@ typedef struct
uint32_t arg_list_len; /**< arguments list length */
} vm_frame_ctx_shared_args_t;
-#if JERRY_ESNEXT
-
/**
* Shared data extended with computed class fields
*/
@@ -91,8 +87,6 @@ typedef struct
#define VM_GET_COMPUTED_CLASS_FIELDS(frame_ctx_p) \
(((vm_frame_ctx_shared_class_fields_t *) ((frame_ctx_p)->shared_p))->computed_class_fields_p)
-#endif /* JERRY_ESNEXT */
-
/**
* Flag bits of vm_frame_ctx_t
*/
diff --git a/jerry-core/vm/vm-stack.c b/jerry-core/vm/vm-stack.c
index 38a9e72d..c7eaf993 100644
--- a/jerry-core/vm/vm-stack.c
+++ b/jerry-core/vm/vm-stack.c
@@ -43,7 +43,6 @@ JERRY_STATIC_ASSERT (PARSER_WITH_CONTEXT_STACK_ALLOCATION == PARSER_TRY_CONTEXT_
JERRY_STATIC_ASSERT (PARSER_FOR_OF_CONTEXT_STACK_ALLOCATION == PARSER_FOR_AWAIT_OF_CONTEXT_STACK_ALLOCATION,
for_of_context_stack_allocation_must_be_equal_to_for_await_of_context_stack_allocation);
-#if JERRY_ESNEXT
/**
* Abort (finalize) the current variable length stack context, and remove it.
*
@@ -76,7 +75,6 @@ vm_stack_context_abort_variable_length (vm_frame_ctx_t *frame_ctx_p, /**< frame
return vm_stack_top_p;
} /* vm_stack_context_abort_variable_length */
-#endif /* JERRY_ESNEXT */
/**
* Abort (finalize) the current stack context, and remove it.
@@ -113,16 +111,13 @@ vm_stack_context_abort (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
}
case VM_CONTEXT_TRY:
case VM_CONTEXT_CATCH:
-#if JERRY_ESNEXT
case VM_CONTEXT_BLOCK:
-#endif /* JERRY_ESNEXT */
case VM_CONTEXT_WITH:
{
VM_MINUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_WITH_CONTEXT_STACK_ALLOCATION);
vm_stack_top_p -= PARSER_WITH_CONTEXT_STACK_ALLOCATION;
break;
}
-#if JERRY_ESNEXT
case VM_CONTEXT_ITERATOR:
case VM_CONTEXT_OBJ_INIT:
case VM_CONTEXT_OBJ_INIT_REST:
@@ -141,7 +136,6 @@ vm_stack_context_abort (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
vm_stack_top_p -= PARSER_FOR_OF_CONTEXT_STACK_ALLOCATION;
break;
}
-#endif /* JERRY_ESNEXT */
default:
{
JERRY_ASSERT (VM_GET_CONTEXT_TYPE (vm_stack_top_p[-1]) == VM_CONTEXT_FOR_IN);
@@ -201,15 +195,11 @@ vm_decode_branch_offset (const uint8_t *branch_offset_p, /**< start offset of by
return branch_offset;
} /* vm_decode_branch_offset */
-#if JERRY_ESNEXT
-
/**
* Byte code which resumes an executable object with throw
*/
static const uint8_t vm_stack_resume_executable_object_with_context_end[1] = { CBC_CONTEXT_END };
-#endif /* JERRY_ESNEXT */
-
/**
* Find a finally up to the end position.
*
@@ -252,7 +242,6 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
return VM_CONTEXT_FOUND_EXPECTED;
}
-#if JERRY_ESNEXT
if (stack_top_p[-1] & VM_CONTEXT_HAS_LEX_ENV)
{
ecma_object_t *lex_env_p = frame_ctx_p->lex_env_p;
@@ -260,7 +249,6 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
frame_ctx_p->lex_env_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t, lex_env_p->u2.outer_reference_cp);
ecma_deref_object (lex_env_p);
}
-#endif /* JERRY_ESNEXT */
byte_code_p = frame_ctx_p->byte_code_start_p + context_end;
@@ -299,16 +287,6 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
{
JERRY_ASSERT (context_type == VM_CONTEXT_CATCH);
-#if !JERRY_ESNEXT
- if (stack_top_p[-1] & VM_CONTEXT_HAS_LEX_ENV)
- {
- ecma_object_t *lex_env_p = frame_ctx_p->lex_env_p;
- JERRY_ASSERT (lex_env_p->u2.outer_reference_cp != JMEM_CP_NULL);
- frame_ctx_p->lex_env_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t, lex_env_p->u2.outer_reference_cp);
- ecma_deref_object (lex_env_p);
- }
-#endif /* !JERRY_ESNEXT */
-
if (byte_code_p[0] == CBC_CONTEXT_END)
{
VM_MINUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
@@ -322,7 +300,6 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
VM_PLUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_FINALLY_CONTEXT_EXTRA_STACK_ALLOCATION);
stack_top_p += PARSER_FINALLY_CONTEXT_EXTRA_STACK_ALLOCATION;
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (byte_code_p[1] == CBC_EXT_ASYNC_EXIT))
{
branch_offset = (uint32_t) (byte_code_p - frame_ctx_p->byte_code_start_p);
@@ -332,7 +309,6 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
frame_ctx_p->stack_top_p = stack_top_p;
return VM_CONTEXT_FOUND_FINALLY;
}
-#endif /* JERRY_ESNEXT */
JERRY_ASSERT (byte_code_p[1] >= CBC_EXT_FINALLY && byte_code_p[1] <= CBC_EXT_FINALLY_3);
@@ -348,7 +324,6 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
frame_ctx_p->stack_top_p = stack_top_p;
return VM_CONTEXT_FOUND_FINALLY;
}
-#if JERRY_ESNEXT
else if (stack_top_p[-1] & VM_CONTEXT_CLOSE_ITERATOR)
{
JERRY_ASSERT (context_type == VM_CONTEXT_FOR_OF || context_type == VM_CONTEXT_FOR_AWAIT_OF
@@ -441,7 +416,6 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
jcontext_raise_exception (exception);
}
}
-#endif /* JERRY_ESNEXT */
stack_top_p = vm_stack_context_abort (frame_ctx_p, stack_top_p);
}
@@ -450,8 +424,6 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
return VM_CONTEXT_FOUND_EXPECTED;
} /* vm_stack_find_finally */
-#if JERRY_ESNEXT
-
/**
* Get the offsets of ecma values corresponding to the passed context.
*
@@ -568,8 +540,6 @@ vm_ref_lex_env_chain (ecma_object_t *lex_env_p, /**< top of lexical environment
} while (context_top_p > context_end_p);
} /* vm_ref_lex_env_chain */
-#endif /* JERRY_ESNEXT */
-
/**
* @}
* @}
diff --git a/jerry-core/vm/vm-stack.h b/jerry-core/vm/vm-stack.h
index 0797d16b..37fd815a 100644
--- a/jerry-core/vm/vm-stack.h
+++ b/jerry-core/vm/vm-stack.h
@@ -68,12 +68,9 @@ typedef enum
VM_CONTEXT_FINALLY_RETURN, /**< finally context with a return */
VM_CONTEXT_TRY, /**< try context */
VM_CONTEXT_CATCH, /**< catch context */
-#if JERRY_ESNEXT
VM_CONTEXT_BLOCK, /**< block context */
-#endif /* JERRY_ESNEXT */
VM_CONTEXT_WITH, /**< with context */
VM_CONTEXT_FOR_IN, /**< for-in context */
-#if JERRY_ESNEXT
VM_CONTEXT_FOR_OF, /**< for-of context */
VM_CONTEXT_FOR_AWAIT_OF, /**< for-await-of context */
@@ -81,7 +78,6 @@ typedef enum
VM_CONTEXT_ITERATOR, /**< iterator context */
VM_CONTEXT_OBJ_INIT, /**< object-initializer context */
VM_CONTEXT_OBJ_INIT_REST, /**< object-initializer-rest context */
-#endif /* JERRY_ESNEXT */
} vm_stack_context_type_t;
/**
@@ -90,10 +86,8 @@ typedef enum
typedef enum
{
VM_CONTEXT_FOUND_FINALLY, /**< found finally */
-#if JERRY_ESNEXT
VM_CONTEXT_FOUND_ERROR, /**< found an error */
VM_CONTEXT_FOUND_AWAIT, /**< found an await operation */
-#endif /* JERRY_ESNEXT */
VM_CONTEXT_FOUND_EXPECTED, /**< found the type specified in finally_type */
} vm_stack_found_type;
@@ -105,11 +99,7 @@ typedef enum
* - [JS values belong to the context]
* - [previous JS values stored by the VM stack]
*/
-#if JERRY_ESNEXT
#define VM_CONTEXT_IS_VARIABLE_LENGTH(context_type) ((context_type) >= VM_CONTEXT_ITERATOR)
-#else /* !JERRY_ESNEXT */
-#define VM_CONTEXT_IS_VARIABLE_LENGTH(context_type) false
-#endif /* JERRY_ESNEXT */
/**
* Checks whether the context type is a finally type.
@@ -131,11 +121,9 @@ typedef enum
*/
#define VM_CONTEXT_GET_NEXT_OFFSET(offsets) (-((int32_t) ((offsets) & ((1 << VM_CONTEXT_OFFSET_SHIFT) - 1))))
-#if JERRY_ESNEXT
ecma_value_t *vm_stack_context_abort_variable_length (vm_frame_ctx_t *frame_ctx_p,
ecma_value_t *vm_stack_top_p,
uint32_t context_stack_allocation);
-#endif /* JERRY_ESNEXT */
ecma_value_t *vm_stack_context_abort (vm_frame_ctx_t *frame_ctx_p, ecma_value_t *vm_stack_top_p);
vm_stack_found_type vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p,
ecma_value_t *stack_top_p,
diff --git a/jerry-core/vm/vm.c b/jerry-core/vm/vm.c
index df7ce69f..46c3590d 100644
--- a/jerry-core/vm/vm.c
+++ b/jerry-core/vm/vm.c
@@ -95,12 +95,10 @@ vm_op_get_value (ecma_value_t object, /**< base object */
property_name_p = ecma_get_string_from_value (property);
}
-#if JERRY_ESNEXT
if (ecma_is_value_symbol (property))
{
property_name_p = ecma_get_symbol_from_value (property);
}
-#endif /* JERRY_ESNEXT */
if (property_name_p != NULL)
{
@@ -264,12 +262,10 @@ vm_run_global (const ecma_compiled_code_t *bytecode_p, /**< pointer to bytecode
ecma_object_t *global_obj_p = ecma_builtin_get_global ();
#endif /* JERRY_BUILTIN_REALMS */
-#if JERRY_ESNEXT
if (bytecode_p->status_flags & CBC_CODE_FLAGS_LEXICAL_BLOCK_NEEDED)
{
ecma_create_global_lexical_block (global_obj_p);
}
-#endif /* JERRY_ESNEXT */
ecma_object_t *const global_scope_p = ecma_get_global_scope (global_obj_p);
@@ -465,7 +461,6 @@ vm_construct_literal_object (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
ecma_object_t *func_obj_p;
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (CBC_FUNCTION_IS_ARROW (bytecode_p->status_flags)))
{
func_obj_p = ecma_op_create_arrow_function_object (frame_ctx_p->lex_env_p, bytecode_p, frame_ctx_p->this_binding);
@@ -474,9 +469,6 @@ vm_construct_literal_object (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
{
func_obj_p = ecma_op_create_any_function_object (frame_ctx_p->lex_env_p, bytecode_p);
}
-#else /* !JERRY_ESNEXT */
- func_obj_p = ecma_op_create_simple_function_object (frame_ctx_p->lex_env_p, bytecode_p);
-#endif /* JERRY_ESNEXT */
return ecma_make_object_value (func_obj_p);
} /* vm_construct_literal_object */
@@ -513,8 +505,11 @@ vm_get_implicit_this_value (ecma_value_t *this_value_p) /**< [in,out] this value
*/
static const uint8_t vm_error_byte_code_p[] = { CBC_EXT_OPCODE, CBC_EXT_ERROR };
-#if JERRY_ESNEXT
-
+/**
+ * Get class function object
+ *
+ * @return the pointer to the object
+ */
static ecma_object_t *
vm_get_class_function (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
{
@@ -731,7 +726,6 @@ vm_spread_operation (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
frame_ctx_p->byte_code_p += 3;
}
} /* vm_spread_operation */
-#endif /* JERRY_ESNEXT */
/**
* 'Function call' opcode handler.
@@ -1283,10 +1277,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
}
case VM_OC_CREATE_BINDING:
{
-#if !JERRY_ESNEXT
- JERRY_ASSERT (opcode == CBC_CREATE_VAR);
-#endif /* !JERRY_ESNEXT */
-
uint32_t literal_index;
READ_LITERAL_INDEX (literal_index);
@@ -1298,7 +1288,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
uint8_t prop_attributes = ECMA_PROPERTY_FLAG_WRITABLE;
-#if JERRY_ESNEXT
if (opcode == CBC_CREATE_LET)
{
prop_attributes = ECMA_PROPERTY_ENUMERABLE_WRITABLE;
@@ -1315,9 +1304,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
{
property_value_p->value = ECMA_VALUE_UNINITIALIZED;
}
-#else /* !JERRY_ESNEXT */
- ecma_create_named_data_property (frame_ctx_p->lex_env_p, name_p, prop_attributes, NULL);
-#endif /* JERRY_ESNEXT */
continue;
}
@@ -1343,27 +1329,27 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
while (lex_env_p->type_flags_refs & ECMA_OBJECT_FLAG_BLOCK)
{
-#if JERRY_ESNEXT && !(defined JERRY_NDEBUG)
+#if !(defined JERRY_NDEBUG)
if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
{
ecma_property_t *property_p = ecma_find_named_property (lex_env_p, name_p);
JERRY_ASSERT (property_p == NULL || !(*property_p & ECMA_PROPERTY_FLAG_ENUMERABLE));
}
-#endif /* JERRY_ESNEXT && !JERRY_NDEBUG */
+#endif /* !JERRY_NDEBUG */
JERRY_ASSERT (lex_env_p->u2.outer_reference_cp != JMEM_CP_NULL);
lex_env_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t, lex_env_p->u2.outer_reference_cp);
}
-#if JERRY_ESNEXT && !(defined JERRY_NDEBUG)
+#if !(defined JERRY_NDEBUG)
if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
{
ecma_property_t *property_p = ecma_find_named_property (lex_env_p, name_p);
JERRY_ASSERT (property_p == NULL || !(*property_p & ECMA_PROPERTY_FLAG_ENUMERABLE));
}
-#endif /* JERRY_ESNEXT && !JERRY_NDEBUG */
+#endif /* !JERRY_NDEBUG */
/* 'Variable declaration' */
result = ecma_op_has_binding (lex_env_p, name_p);
@@ -1413,7 +1399,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
}
continue;
}
-#if JERRY_ESNEXT
case VM_OC_EXT_VAR_EVAL:
{
uint32_t literal_index;
@@ -1485,7 +1470,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
ecma_deref_object (ecma_get_object_from_value (lit_value));
continue;
}
-#endif /* JERRY_ESNEXT */
case VM_OC_CREATE_ARGUMENTS:
{
uint32_t literal_index;
@@ -1574,7 +1558,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
}
continue;
}
-#if JERRY_ESNEXT
case VM_OC_CHECK_VAR:
{
JERRY_ASSERT (CBC_FUNCTION_GET_TYPE (frame_ctx_p->shared_p->bytecode_header_p->status_flags)
@@ -1887,7 +1870,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
left_value ^= right_value;
/* FALLTHRU */
}
-#endif /* JERRY_ESNEXT */
case VM_OC_SET_PROPERTY:
{
JERRY_STATIC_ASSERT (VM_OC_NON_STATIC_FLAG == VM_OC_BACKWARD_BRANCH,
@@ -1903,7 +1885,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
goto error;
}
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (ecma_compare_ecma_string_to_magic_id (prop_name_p, LIT_MAGIC_STRING_PROTOTYPE))
&& !(opcode_data & VM_OC_NON_STATIC_FLAG))
{
@@ -1912,9 +1893,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
}
const int index = (int) (opcode_data >> VM_OC_NON_STATIC_SHIFT) - 2;
-#else /* !JERRY_ESNEXT */
- const int index = -1;
-#endif /* JERRY_ESNEXT */
ecma_object_t *object_p = ecma_get_object_from_value (stack_top_p[index]);
@@ -1936,7 +1914,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
goto error;
}
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (ecma_compare_ecma_string_to_magic_id (prop_name_p, LIT_MAGIC_STRING_PROTOTYPE))
&& !(opcode_data & VM_OC_NON_STATIC_FLAG))
{
@@ -1945,10 +1922,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
}
const int index = (int) (opcode_data >> VM_OC_NON_STATIC_SHIFT) - 2;
-#else /* !JERRY_ESNEXT */
- const int index = -1;
-#endif /* JERRY_ESNEXT */
-
opfunc_set_accessor (VM_OC_GROUP_GET_INDEX (opcode_data) == VM_OC_SET_GETTER,
stack_top_p[index],
prop_name_p,
@@ -1964,7 +1937,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
*stack_top_p++ = ecma_make_object_value (ecma_op_new_array_object (0));
continue;
}
-#if JERRY_ESNEXT
case VM_OC_LOCAL_EVAL:
{
ECMA_CLEAR_LOCAL_PARSE_OPTS ();
@@ -2885,7 +2857,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
}
continue;
}
-#endif /* JERRY_ESNEXT */
case VM_OC_PUSH_ELISON:
{
*stack_top_p++ = ECMA_VALUE_ARRAY_HOLE;
@@ -2896,22 +2867,17 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
uint16_t values_length = *byte_code_p++;
stack_top_p -= values_length;
-#if JERRY_ESNEXT
if (*byte_code_start_p == CBC_EXT_OPCODE)
{
values_length = (uint16_t) (values_length | OPFUNC_HAS_SPREAD_ELEMENT);
}
-#endif /* JERRY_ESNEXT */
result = opfunc_append_array (stack_top_p, values_length);
-#if JERRY_ESNEXT
if (ECMA_IS_VALUE_ERROR (result))
{
goto error;
}
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (ecma_is_value_empty (result));
-#endif /* JERRY_ESNEXT */
+
continue;
}
case VM_OC_IDENT_REFERENCE:
@@ -3341,7 +3307,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
ecma_fast_free_value (value);
continue;
}
-#if JERRY_ESNEXT
case VM_OC_POP_REFERENCE:
{
ecma_free_value (stack_top_p[-2]);
@@ -3362,7 +3327,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
--stack_top_p;
continue;
}
-#endif /* JERRY_ESNEXT */
case VM_OC_PLUS:
case VM_OC_MINUS:
{
@@ -3637,7 +3601,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
*stack_top_p++ = result;
goto free_both_values;
}
-#if JERRY_ESNEXT
case VM_OC_EXP:
{
result = do_number_arithmetic (NUMBER_ARITHMETIC_EXPONENTIATION, left_value, right_value);
@@ -3650,7 +3613,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
*stack_top_p++ = result;
goto free_both_values;
}
-#endif /* JERRY_ESNEXT */
case VM_OC_EQUAL:
{
result = opfunc_equality (left_value, right_value);
@@ -4005,7 +3967,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
}
case VM_OC_BLOCK_CREATE_CONTEXT:
{
-#if JERRY_ESNEXT
ecma_value_t *stack_context_top_p;
stack_context_top_p = VM_GET_REGISTERS (frame_ctx_p) + register_end + frame_ctx_p->context_depth;
@@ -4040,12 +4001,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
stack_context_top_p[-1] |= VM_CONTEXT_HAS_LEX_ENV;
}
-#else /* !JERRY_ESNEXT */
- JERRY_ASSERT (VM_GET_CONTEXT_TYPE (stack_top_p[-2]) == VM_CONTEXT_CATCH
- && !(stack_top_p[-2] & VM_CONTEXT_HAS_LEX_ENV));
-
- stack_top_p[-2] |= VM_CONTEXT_HAS_LEX_ENV;
-#endif /* JERRY_ESNEXT */
frame_ctx_p->lex_env_p = ecma_create_decl_lex_env (frame_ctx_p->lex_env_p);
frame_ctx_p->lex_env_p->type_flags_refs |= ECMA_OBJECT_FLAG_BLOCK;
@@ -4096,13 +4051,11 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
if (prop_names_p == NULL)
{
-#if JERRY_ESNEXT
if (JERRY_UNLIKELY (ECMA_IS_VALUE_ERROR (expr_obj_value)))
{
result = expr_obj_value;
goto error;
}
-#endif /* JERRY_ESNEXT */
/* The collection is already released */
byte_code_p = byte_code_start_p + branch_offset;
@@ -4118,13 +4071,12 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
stack_top_p[-3] = 0;
stack_top_p[-4] = expr_obj_value;
-#if JERRY_ESNEXT
if (byte_code_p[0] == CBC_EXT_OPCODE && byte_code_p[1] == CBC_EXT_CLONE_CONTEXT)
{
/* No need to duplicate the first context. */
byte_code_p += 2;
}
-#endif /* JERRY_ESNEXT */
+
continue;
}
case VM_OC_FOR_IN_GET_NEXT:
@@ -4191,7 +4143,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
}
continue;
}
-#if JERRY_ESNEXT
case VM_OC_FOR_OF_INIT:
{
ecma_value_t value = *(--stack_top_p);
@@ -4405,7 +4356,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
frame_ctx_p->stack_top_p = stack_top_p;
return ECMA_VALUE_UNDEFINED;
}
-#endif /* JERRY_ESNEXT */
case VM_OC_TRY:
{
/* Try opcode simply creates the try context. */
@@ -4467,7 +4417,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
continue;
}
-#if JERRY_ESNEXT
if (stack_top_p[-1] & VM_CONTEXT_HAS_LEX_ENV)
{
ecma_object_t *lex_env_p = frame_ctx_p->lex_env_p;
@@ -4475,7 +4424,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
frame_ctx_p->lex_env_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t, lex_env_p->u2.outer_reference_cp);
ecma_deref_object (lex_env_p);
}
-#endif /* JERRY_ESNEXT */
VM_MINUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_FINALLY_CONTEXT_STACK_ALLOCATION);
stack_top_p -= PARSER_FINALLY_CONTEXT_STACK_ALLOCATION;
@@ -4517,7 +4465,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
stack_top_p[-2] = jump_target;
break;
}
-#if JERRY_ESNEXT
case VM_CONTEXT_FOUND_ERROR:
{
JERRY_ASSERT (jcontext_has_pending_exception ());
@@ -4530,7 +4477,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
stack_top_p[-2] = jump_target;
return ECMA_VALUE_UNDEFINED;
}
-#endif /* JERRY_ESNEXT */
default:
{
byte_code_p = frame_ctx_p->byte_code_start_p + jump_target;
@@ -4561,7 +4507,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
stack_top_p[-2] = (uint32_t) branch_offset;
break;
}
-#if JERRY_ESNEXT
case VM_CONTEXT_FOUND_ERROR:
{
JERRY_ASSERT (jcontext_has_pending_exception ());
@@ -4574,7 +4519,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
stack_top_p[-2] = (uint32_t) branch_offset;
return ECMA_VALUE_UNDEFINED;
}
-#endif /* JERRY_ESNEXT */
default:
{
byte_code_p = frame_ctx_p->byte_code_start_p + branch_offset;
@@ -4839,13 +4783,12 @@ error:
while (stack_top_p > stack_bottom_p)
{
ecma_value_t stack_item = *(--stack_top_p);
-#if JERRY_ESNEXT
if (stack_item == ECMA_VALUE_RELEASE_LEX_ENV)
{
opfunc_pop_lexical_environment (frame_ctx_p);
continue;
}
-#endif /* JERRY_ESNEXT */
+
ecma_fast_free_value (stack_item);
}
@@ -4918,7 +4861,6 @@ error:
stack_top_p[-2] = result;
continue;
}
-#if JERRY_ESNEXT
case VM_CONTEXT_FOUND_ERROR:
{
JERRY_ASSERT (jcontext_has_pending_exception ());
@@ -4936,7 +4878,6 @@ error:
stack_top_p[-2] = result;
return ECMA_VALUE_UNDEFINED;
}
-#endif /* JERRY_ESNEXT */
default:
{
goto finish;
@@ -4975,13 +4916,11 @@ error:
*stack_top_p++ = result;
continue;
}
-#if JERRY_ESNEXT
case VM_CONTEXT_FOUND_AWAIT:
{
JERRY_ASSERT (VM_GET_CONTEXT_TYPE (frame_ctx_p->stack_top_p[-1]) == VM_CONTEXT_FINALLY_THROW);
return ECMA_VALUE_UNDEFINED;
}
-#endif /* JERRY_ESNEXT */
default:
{
break;
@@ -5278,7 +5217,6 @@ vm_execute (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
opfunc_call (frame_ctx_p);
break;
}
-#if JERRY_ESNEXT
case VM_EXEC_SUPER_CALL:
{
vm_super_call (frame_ctx_p);
@@ -5293,7 +5231,6 @@ vm_execute (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
{
return completion_value;
}
-#endif /* JERRY_ESNEXT */
case VM_EXEC_CONSTRUCT:
{
opfunc_construct (frame_ctx_p);
diff --git a/jerry-core/vm/vm.h b/jerry-core/vm/vm.h
index 3cb1bdb9..080d8519 100644
--- a/jerry-core/vm/vm.h
+++ b/jerry-core/vm/vm.h
@@ -164,10 +164,8 @@ typedef enum
VM_OC_ERROR, /**< error while the vm_loop is suspended */
VM_OC_JUMP, /**< jump */
-#if JERRY_ESNEXT
VM_OC_BRANCH_IF_NULLISH, /** branch if undefined or null */
VM_OC_POP_REFERENCE, /** prop identifier or property reference from the stack */
-#endif /* JERRY_ESNEXT */
VM_OC_BRANCH_IF_STRICT_EQUAL, /**< branch if strict equal */
/* These four opcodes must be in this order. */
@@ -189,9 +187,7 @@ typedef enum
VM_OC_MUL, /**< mul */
VM_OC_DIV, /**< div */
VM_OC_MOD, /**< mod */
-#if JERRY_ESNEXT
VM_OC_EXP, /**< exponentiation */
-#endif /* JERRY_ESNEXT */
VM_OC_EQUAL, /**< equal */
VM_OC_NOT_EQUAL, /**< not equal */
@@ -227,17 +223,14 @@ typedef enum
VM_OC_CREATE_ARGUMENTS, /**< create arguments object */
VM_OC_SET_BYTECODE_PTR, /**< setting bytecode pointer */
VM_OC_VAR_EVAL, /**< variable and function evaluation */
-#if JERRY_ESNEXT
VM_OC_EXT_VAR_EVAL, /**< variable and function evaluation for
* functions with separate argument context */
-#endif /* JERRY_ESNEXT */
VM_OC_INIT_ARG_OR_FUNC, /**< create and init a function or argument binding */
#if JERRY_DEBUGGER
VM_OC_BREAKPOINT_ENABLED, /**< enabled breakpoint for debugger */
VM_OC_BREAKPOINT_DISABLED, /**< disabled breakpoint for debugger */
#endif /* JERRY_DEBUGGER */
-#if JERRY_ESNEXT
VM_OC_CLASS_CALL_STATIC_BLOCK, /**< call the class static block */
VM_OC_DEFINE_FIELD, /**< define class field */
VM_OC_PRIVATE_PROP_REFERENCE, /**< reference to class private method */
@@ -310,7 +303,6 @@ typedef enum
VM_OC_SET__PROTO__, /**< set prototype when __proto__: form is used */
VM_OC_PUSH_STATIC_FIELD_FUNC, /**< push static field initializer function */
VM_OC_ADD_COMPUTED_FIELD, /**< add computed field name */
-#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
VM_OC_MODULE_IMPORT, /**< module dynamic import */
VM_OC_MODULE_IMPORT_META, /**< module import.meta */
@@ -324,91 +316,10 @@ typedef enum
*/
typedef enum
{
-#if !JERRY_ESNEXT
- VM_OC_EXP = VM_OC_NONE, /**< exponentiation */
- VM_OC_BRANCH_IF_NULLISH = VM_OC_NONE, /** branch if undefined or null */
- VM_OC_POP_REFERENCE = VM_OC_NONE, /** prop identifier or property reference from the stack */
-#endif /* !JERRY_ESNEXT */
#if !JERRY_DEBUGGER
VM_OC_BREAKPOINT_ENABLED = VM_OC_NONE, /**< enabled breakpoint for debugger is unused */
VM_OC_BREAKPOINT_DISABLED = VM_OC_NONE, /**< disabled breakpoint for debugger is unused */
#endif /* !JERRY_DEBUGGER */
-#if !JERRY_ESNEXT
- VM_OC_CLASS_CALL_STATIC_BLOCK = VM_OC_NONE, /**< call the class static block */
- VM_OC_DEFINE_FIELD = VM_OC_NONE, /**< define class field */
- VM_OC_PRIVATE_PROP_REFERENCE = VM_OC_NONE, /* reference to class private method */
- VM_OC_ASSIGN_PRIVATE = VM_OC_NONE, /**< assign to private field */
- VM_OC_PRIVATE_FIELD_ADD = VM_OC_NONE, /**< add private field */
- VM_OC_PRIVATE_PROP_GET = VM_OC_NONE, /**< get private field */
- VM_OC_PRIVATE_IN = VM_OC_NONE, /**< 'in' opcode handler for private identifiers */
- VM_OC_COLLECT_PRIVATE_PROPERTY = VM_OC_NONE, /**< collect private properties */
- VM_OC_EXT_VAR_EVAL = VM_OC_NONE, /**< variable and function evaluation for
- * functions with separate argument context */
- VM_OC_CHECK_VAR = VM_OC_NONE, /**< check redeclared vars in the global scope */
- VM_OC_CHECK_LET = VM_OC_NONE, /**< check redeclared lets in the global scope */
- VM_OC_ASSIGN_LET_CONST = VM_OC_NONE, /**< assign values to let/const declarations */
- VM_OC_INIT_BINDING = VM_OC_NONE, /**< create and intialize a binding */
- VM_OC_THROW_CONST_ERROR = VM_OC_NONE, /**< throw invalid assignment to const variable error */
- VM_OC_COPY_TO_GLOBAL = VM_OC_NONE, /**< copy value to global lex env */
- VM_OC_COPY_FROM_ARG = VM_OC_NONE, /**< copy value from arg lex env */
- VM_OC_CLONE_CONTEXT = VM_OC_NONE, /**< clone lexical environment with let/const declarations */
- VM_OC_COPY_DATA_PROPERTIES = VM_OC_NONE, /**< copy data properties of an object */
- VM_OC_SET_COMPUTED_PROPERTY = VM_OC_NONE, /**< set computed property is unused */
-
- VM_OC_FOR_OF_INIT = VM_OC_NONE, /**< for-of init context */
- VM_OC_FOR_OF_GET_NEXT = VM_OC_NONE, /**< for-of get next */
- VM_OC_FOR_OF_HAS_NEXT = VM_OC_NONE, /**< for-of has next */
- VM_OC_FOR_AWAIT_OF_INIT = VM_OC_NONE, /**< for-await-of init context */
- VM_OC_FOR_AWAIT_OF_HAS_NEXT = VM_OC_NONE, /**< for-await-of has next */
-
- VM_OC_LOCAL_EVAL = VM_OC_NONE, /**< eval in local context */
- VM_OC_SUPER_CALL = VM_OC_NONE, /**< call the 'super' constructor */
- VM_OC_PUSH_CLASS_ENVIRONMENT = VM_OC_NONE, /**< push class environment */
- VM_OC_PUSH_IMPLICIT_CTOR = VM_OC_NONE, /**< create implicit class constructor */
- VM_OC_INIT_CLASS = VM_OC_NONE, /**< initialize class */
- VM_OC_FINALIZE_CLASS = VM_OC_NONE, /**< finalize class */
- VM_OC_SET_FIELD_INIT = VM_OC_NONE, /**< store the class field initializer function */
- VM_OC_SET_STATIC_FIELD_INIT = VM_OC_NONE, /**< store the static class field initializer function */
- VM_OC_RUN_FIELD_INIT = VM_OC_NONE, /**< run the class field initializer function */
- VM_OC_RUN_STATIC_FIELD_INIT = VM_OC_NONE, /**< run the static class field initializer function */
- VM_OC_SET_NEXT_COMPUTED_FIELD = VM_OC_NONE, /**< set the next computed field of a class */
- VM_OC_PUSH_SUPER_CONSTRUCTOR = VM_OC_NONE, /**< getSuperConstructor operation */
- VM_OC_RESOLVE_LEXICAL_THIS = VM_OC_NONE, /**< resolve this_binding from from the lexical environment */
- VM_OC_SUPER_REFERENCE = VM_OC_NONE, /**< push super reference */
- VM_OC_SET_HOME_OBJECT = VM_OC_NONE, /**< set the [[HomeObject]] internal property in an object literal */
- VM_OC_OBJECT_LITERAL_HOME_ENV = VM_OC_NONE, /**< create/destroy [[HomeObject]] environment of an object literal */
- VM_OC_SET_FUNCTION_NAME = VM_OC_NONE, /**< set function name property */
-
- VM_OC_PUSH_SPREAD_ELEMENT = VM_OC_NONE, /**< push spread element */
- VM_OC_PUSH_REST_OBJECT = VM_OC_NONE, /**< push rest object */
- VM_OC_ITERATOR_CONTEXT_CREATE = VM_OC_NONE, /**< create iterator context */
- VM_OC_ITERATOR_STEP = VM_OC_NONE, /**< IteratorStep abstract operation */
- VM_OC_ITERATOR_CONTEXT_END = VM_OC_NONE, /**< finalize iterator cotnext */
- VM_OC_OBJ_INIT_CONTEXT_CREATE = VM_OC_NONE, /**< create object initializer context */
- VM_OC_OBJ_INIT_CONTEXT_END = VM_OC_NONE, /**< finalize object initializer context */
- VM_OC_OBJ_INIT_PUSH_REST = VM_OC_NONE, /**< push the object with the rest properties */
- VM_OC_INITIALIZER_PUSH_NAME = VM_OC_NONE, /**< append string to name list array and push the string */
- VM_OC_DEFAULT_INITIALIZER = VM_OC_NONE, /**< default initializer inside a pattern */
- VM_OC_REST_INITIALIZER = VM_OC_NONE, /**< create rest object inside an array pattern */
- VM_OC_INITIALIZER_PUSH_PROP = VM_OC_NONE, /**< push property for object initializer */
- VM_OC_SPREAD_ARGUMENTS = VM_OC_NONE, /**< perform function call/construct with spreaded arguments */
- VM_OC_CREATE_GENERATOR = VM_OC_NONE, /**< create a generator object */
- VM_OC_YIELD = VM_OC_NONE, /**< yield operation */
- VM_OC_ASYNC_YIELD = VM_OC_NONE, /**< async yield operation */
- VM_OC_ASYNC_YIELD_ITERATOR = VM_OC_NONE, /**< async yield iterator operation */
- VM_OC_AWAIT = VM_OC_NONE, /**< await operation */
- VM_OC_GENERATOR_AWAIT = VM_OC_NONE, /**< generator await operation */
- VM_OC_EXT_RETURN = VM_OC_NONE, /**< return which also clears the stack */
- VM_OC_ASYNC_EXIT = VM_OC_NONE, /**< return from async function */
- VM_OC_STRING_CONCAT = VM_OC_NONE, /**< string concatenation */
- VM_OC_GET_TEMPLATE_OBJECT = VM_OC_NONE, /**< GetTemplateObject operation */
- VM_OC_PUSH_NEW_TARGET = VM_OC_NONE, /**< push new.target onto the stack */
- VM_OC_REQUIRE_OBJECT_COERCIBLE = VM_OC_NONE, /**< RequireObjectCoercible opretaion */
- VM_OC_ASSIGN_SUPER = VM_OC_NONE, /**< assign super reference */
- VM_OC_SET__PROTO__ = VM_OC_NONE, /**< set prototype when __proto__: form is used */
- VM_OC_PUSH_STATIC_FIELD_FUNC = VM_OC_NONE, /**< push static field initializer function */
- VM_OC_ADD_COMPUTED_FIELD = VM_OC_NONE, /**< add computed field name */
-#endif /* !JERRY_ESNEXT */
#if !JERRY_MODULE_SYSTEM
VM_OC_MODULE_IMPORT = VM_OC_NONE, /**< module dynamic import */
VM_OC_MODULE_IMPORT_META = VM_OC_NONE, /**< module import.meta */