Remove ES_NEXT macro (#4915)
- remove all '#JERRY_ESNEXT' macro - remove 5.1 build profile, update test runner accordingly (Note: all builtins are turn on by default) - move tests from tests/jerry/esnext into tests/jerry, concatenate files with same names - add skiplist to some snapshot tests that were supported only in 5.1 - fix doxygen issues that were hidden before (bc. of es.next macro) Co-authored-by: Martin Negyokru negyokru@inf.u-szeged.hu JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
@@ -75,18 +75,11 @@ jobs:
|
||||
- run: sudo apt install gcc-multilib
|
||||
- run: $RUNNER --buildoption-test
|
||||
|
||||
Conformance_Tests_ES5_1:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: $RUNNER --test262
|
||||
- run: $RUNNER --test262 --build-debug
|
||||
|
||||
Conformance_Tests_ESNext:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: $RUNNER --test262-esnext=update
|
||||
- run: $RUNNER --test262 update
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: success() || failure()
|
||||
with:
|
||||
@@ -98,7 +91,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: $RUNNER --test262-esnext=update --build-debug --test262-test-list=built-ins,annexB,harness,intl402
|
||||
- run: $RUNNER --test262 update --build-debug --test262-test-list=built-ins,annexB,harness,intl402
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: success() || failure()
|
||||
with:
|
||||
@@ -110,7 +103,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: $RUNNER --test262-esnext=update --build-debug --test262-test-list=language
|
||||
- run: $RUNNER --test262 update --build-debug --test262-test-list=language
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: success() || failure()
|
||||
with:
|
||||
|
||||
@@ -2863,13 +2863,6 @@ jerry_value_is_object (const jerry_value_t value)
|
||||
|
||||
Returns whether the given `jerry_value_t` is a promise value.
|
||||
|
||||
*Notes*:
|
||||
- This API depends on a build option (`JERRY_ESNEXT`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_PROMISE` feature enum value,
|
||||
see: [jerry_feature_enabled](#jerry_feature_enabled).
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
|
||||
**Prototype**
|
||||
|
||||
```c
|
||||
@@ -2884,8 +2877,6 @@ jerry_value_is_promise (const jerry_value_t value)
|
||||
|
||||
*New in version 2.0*.
|
||||
|
||||
*Changed in version [[NEXT_RELEASE]]*: Build option dependency changed from `JERRY_BUILTIN_PROMISE` to `JERRY_ESNEXT`.
|
||||
|
||||
**Example**
|
||||
|
||||
```c
|
||||
@@ -3003,12 +2994,6 @@ jerry_value_is_string (const jerry_value_t value)
|
||||
|
||||
Returns whether the given `jerry_value_t` is a symbol value.
|
||||
|
||||
*Notes*:
|
||||
- This API depends on a build option (`JERRY_BUILTIN_SYMBOL`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_SYMBOL` feature enum value,
|
||||
see: [jerry_feature_enabled](#jerry_feature_enabled).
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
**Prototype**
|
||||
|
||||
```c
|
||||
@@ -5728,11 +5713,6 @@ The function returns the result of a Promise object.
|
||||
*Notes*:
|
||||
- Returned value must be freed with [jerry_value_free](#jerry_value_free) when it
|
||||
is no longer needed.
|
||||
- This API depends on a build option (`JERRY_ESNEXT`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_PROMISE` feature enum value,
|
||||
see: [jerry_feature_enabled](#jerry_feature_enabled).
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -5750,8 +5730,6 @@ jerry_promise_result (const jerry_value_t promise);
|
||||
|
||||
*New in version 2.2*.
|
||||
|
||||
*Changed in version [[NEXT_RELEASE]]*: Build option dependency changed from `JERRY_BUILTIN_PROMISE` to `JERRY_ESNEXT`.
|
||||
|
||||
**Example**
|
||||
|
||||
[doctest]: # (test="compile")
|
||||
@@ -5796,11 +5774,6 @@ example (void)
|
||||
*Notes*:
|
||||
- Returned value must be freed with [jerry_value_free](#jerry_value_free) when it
|
||||
is no longer needed.
|
||||
- This API depends on a build option (`JERRY_ESNEXT`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_PROMISE` feature enum value,
|
||||
see: [jerry_feature_enabled](#jerry_feature_enabled).
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -5817,8 +5790,6 @@ jerry_promise_state (const jerry_value_t promise);
|
||||
|
||||
*New in version 2.2*.
|
||||
|
||||
*Changed in version [[NEXT_RELEASE]]*: Build option dependency changed from `JERRY_BUILTIN_PROMISE` to `JERRY_ESNEXT`.
|
||||
|
||||
**Example**
|
||||
|
||||
[doctest]: # (test="compile")
|
||||
@@ -6107,11 +6078,6 @@ Reject the promise with an argument.
|
||||
*Note*:
|
||||
- Returned value must be freed with [jerry_value_free](#jerry_value_free) when it
|
||||
is no longer needed.
|
||||
- This API depends on a build option (`JERRY_ESNEXT`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_PROMISE` feature enum value,
|
||||
see: [jerry_feature_enabled](#jerry_feature_enabled).
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -6128,8 +6094,6 @@ jerry_promise_reject (jerry_value_t promise, jerry_value_t argument);
|
||||
|
||||
*New in version 2.0*.
|
||||
|
||||
*Changed in version [[NEXT_RELEASE]]*: Build option dependency changed from `JERRY_BUILTIN_PROMISE` to `JERRY_ESNEXT`.
|
||||
|
||||
**Example**
|
||||
|
||||
```c
|
||||
@@ -6171,10 +6135,6 @@ Get the well-known symbol corresponding to the given [well-known symbol id](#jer
|
||||
*Notes*:
|
||||
- Returned value must be freed with [jerry_value_free](#jerry_value_free) when it
|
||||
is no longer needed.
|
||||
- This API depends on a build option (`JERRY_BUILTIN_SYMBOL`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_SYMBOL` feature enum value,
|
||||
see: [jerry_feature_enabled](#jerry_feature_enabled).
|
||||
- The es.next profile enables this by default.
|
||||
- If the symbol support is not enabled an undefined will be returned.
|
||||
|
||||
**Prototype**
|
||||
@@ -6231,11 +6191,6 @@ Returns with the `[[Description]]` internal property of a symbol value.
|
||||
*Notes*:
|
||||
- Returned value must be freed with [jerry_value_free](#jerry_value_free) when it
|
||||
is no longer needed.
|
||||
- This API depends on a build option (`JERRY_BUILTIN_SYMBOL`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_SYMBOL` feature enum value,
|
||||
see: [jerry_feature_enabled](#jerry_feature_enabled).
|
||||
- The es.next profile enables this by default.
|
||||
- If symbol support is not enabled an exception will be returned.
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -6294,11 +6249,6 @@ Based on ECMA 262 v6 19.4.3.2.1 this is in the form of `Symbol(<description>)`.
|
||||
*Notes*:
|
||||
- Returned value must be freed with [jerry_value_free](#jerry_value_free) when it
|
||||
is no longer needed.
|
||||
- This API depends on a build option (`JERRY_BUILTIN_SYMBOL`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_SYMBOL` feature enum value,
|
||||
see: [jerry_feature_enabled](#jerry_feature_enabled).
|
||||
- The es.next profile enables this by default.
|
||||
- If symbol support is not enabled an exception will be returned.
|
||||
|
||||
**Prototype**
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
+14
-109
@@ -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;
|
||||
}
|
||||
|
||||
+12
-54
@@ -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) */
|
||||
@@ -708,13 +673,6 @@
|
||||
#error "Date does not support float32"
|
||||
#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
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
@@ -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) */
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
/**
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1061,6 +1020,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 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
|
||||
@@ -28,6 +28,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.
|
||||
*/
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 }
|
||||
};
|
||||
|
||||
@@ -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,32 +162,11 @@ 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_TYPEDARRAY_PROTOTYPE_VALUES:
|
||||
{
|
||||
if (!ecma_is_typedarray (this_arg))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_TYPED_ARRAY);
|
||||
}
|
||||
|
||||
if (ecma_arraybuffer_is_detached (ecma_typedarray_get_arraybuffer (ecma_get_object_from_value (this_arg))))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
|
||||
}
|
||||
|
||||
return ecma_typedarray_iterators_helper (this_arg, ECMA_ITERATOR_VALUES);
|
||||
}
|
||||
case ECMA_INTRINSIC_SET_PROTOTYPE_VALUES:
|
||||
{
|
||||
return ecma_builtin_intrinsic_set_prototype_values (this_arg);
|
||||
}
|
||||
case ECMA_INTRINSIC_MAP_PROTOTYPE_ENTRIES:
|
||||
{
|
||||
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);
|
||||
@@ -203,6 +180,34 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built-
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif /* JERRY_BUILTIN_ARRAY */
|
||||
#if JERRY_BUILTIN_TYPEDARRAY
|
||||
case ECMA_INTRINSIC_TYPEDARRAY_PROTOTYPE_VALUES:
|
||||
{
|
||||
if (!ecma_is_typedarray (this_arg))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_TYPED_ARRAY);
|
||||
}
|
||||
|
||||
if (ecma_arraybuffer_is_detached (ecma_typedarray_get_arraybuffer (ecma_get_object_from_value (this_arg))))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
case ECMA_INTRINSIC_MAP_PROTOTYPE_ENTRIES:
|
||||
{
|
||||
return ecma_builtin_intrinsic_map_prototype_entries (this_arg);
|
||||
}
|
||||
#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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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) */
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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]);
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user