Re-target for ES.Next (#3901)
A list of changes: - 'es2015-subset' profile is deprecated, and an 'es.next' profile is added. - The default profile is changed to 'es.next' - Renamed the JERRY_ES2015 guard to JERRY_ESNEXT - Renamed JERRY_ES2015_BUILTIN_* guards to JERRY_BUILTIN_* - Moved es2015 specific tests to a new 'es.next' subdirectory - Updated docs, targets, and test runners to reflect these changes Resolves #3737. JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
@@ -51,10 +51,10 @@ tools/build.py --debug --logging=on --error-messages=on --line-info=on
|
||||
python tools/build.py --cmake-param=CMAKE_PARAM
|
||||
```
|
||||
|
||||
**Set a profile mode (ES5.1, subset of ES2015, minimal)**
|
||||
**Set a profile mode (ES.next, ES5.1, minimal)**
|
||||
|
||||
```bash
|
||||
python tools/build.py --profile=es5.1|es2015-subset|minimal
|
||||
python tools/build.py --profile=es.next|es5.1|minimal
|
||||
```
|
||||
|
||||
See also the related [README.md](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/profiles/README.md).
|
||||
|
||||
@@ -41,7 +41,7 @@ that can be used by the debugger to identify the currently executed source conte
|
||||
### Profiles
|
||||
|
||||
This option can be used to enable/disable available JavaScript language features by providing profile files. Profile files contain a list of C definitions that configure each individual feature.
|
||||
The `path` value for CMake and Python arguments should be a file path to the profile file, or one of `es2015-subset`, `es5.1`, or `minimal`, which are the pre-defined profiles.
|
||||
The `path` value for CMake and Python arguments should be a file path to the profile file, or one of `es.next`, `es5.1`, or `minimal`, which are the pre-defined profiles.
|
||||
To see how a profile file should be created, or what configuration options are available in C, see the profile [README](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/profiles/README.md).
|
||||
|
||||
| Options | |
|
||||
|
||||
+42
-42
@@ -1459,10 +1459,10 @@ jerry_value_is_array (const jerry_value_t value)
|
||||
Returns whether the given `jerry_value_t` is an ArrayBuffer object.
|
||||
|
||||
*Notes*:
|
||||
- This API depends on a build option (`JERRY_ES2015_BUILTIN_TYPEDARRAY`) and can be checked
|
||||
- This API depends on a build option (`JERRY_BUILTIN_TYPEDARRAY`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_TYPEDARRAY` feature enum value,
|
||||
see: [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- The ES2015-subset profile enables this by default.
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -1584,10 +1584,10 @@ jerry_value_is_constructor (const jerry_value_t value)
|
||||
Returns whether the given `jerry_value_t` is a DataView object value.
|
||||
|
||||
*Notes*:
|
||||
- This API depends on a build option (`JERRY_ES2015_BUILTIN_DATAVIEW`) and can be checked
|
||||
- This API depends on a build option (`JERRY_BUILTIN_DATAVIEW`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_DATAVIEW` feature enum value,
|
||||
see: [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- The ES2015-subset profile enables this by default.
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -1841,10 +1841,10 @@ 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_ES2015_BUILTIN_PROMISE`) and can be checked
|
||||
- This API depends on a build option (`JERRY_BUILTIN_PROMISE`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_PROMISE` feature enum value,
|
||||
see: [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- The ES2015-subset profile enables this by default.
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
|
||||
**Prototype**
|
||||
@@ -1890,10 +1890,10 @@ jerry_value_is_promise (const jerry_value_t value)
|
||||
Returns whether the given `jerry_value_t` is a proxy value.
|
||||
|
||||
*Notes*:
|
||||
- This API depends on a build option (`JERRY_ES2015_BUILTIN_PROXY`) and can be checked
|
||||
- This API depends on a build option (`JERRY_BUILTIN_PROXY`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_PROXY` feature enum value,
|
||||
see: [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- The ES2015-subset profile enables this by default.
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
|
||||
**Prototype**
|
||||
@@ -1978,10 +1978,10 @@ 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_ES2015_BUILTIN_SYMBOL`) and can be checked
|
||||
- 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_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- The ES2015-subset profile enables this by default.
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -2038,10 +2038,10 @@ main (void)
|
||||
Checks whether the given `jerry_value_t` is a TypedArray object or not.
|
||||
|
||||
*Notes*:
|
||||
- This API depends on a build option (`JERRY_ES2015_BUILTIN_TYPEDARRAY`) and can be checked
|
||||
- This API depends on a build option (`JERRY_BUILTIN_TYPEDARRAY`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_TYPEDARRAY` feature enum value,
|
||||
see: [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- The ES2015-subset profile enables this by default.
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -2096,11 +2096,11 @@ main (void)
|
||||
Checks whether the given `jerry_value_t` is the given `jerry_container_type_t` type container object.
|
||||
|
||||
*Notes*
|
||||
- This API function depends on a build option (`JERRY_ES2015_BUILTIN_CONTAINER`) and can be checked
|
||||
- This API function depends on a build option (`JERRY_BUILTIN_CONTAINER`) and can be checked
|
||||
runtime with the `JERRY_FEATURE_MAP, JERRY_FEATURE_SET, JERRY_FEATURE_WEAKMAP, JERRY_FEATURE_WEAKSET`
|
||||
feature enum values.
|
||||
see: [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- The ES2015-subset profile enables this by default.
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
*New in version 2.3*.
|
||||
|
||||
@@ -3376,7 +3376,7 @@ jerry_value_to_string (const jerry_value_t value);
|
||||
|
||||
# Functions for promise objects
|
||||
|
||||
These APIs all depend on the ES2015-subset profile (or on some build options).
|
||||
These APIs all depend on the es.next profile (or on some build options).
|
||||
|
||||
## jerry_get_promise_result
|
||||
|
||||
@@ -3387,10 +3387,10 @@ The function returns the result of a Promise object.
|
||||
*Notes*:
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
|
||||
is no longer needed.
|
||||
- This API depends on a build option (`JERRY_ES2015_BUILTIN_PROMISE`) and can be checked
|
||||
- This API depends on a build option (`JERRY_BUILTIN_PROMISE`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_PROMISE` feature enum value,
|
||||
see: [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- The ES2015-subset profile enables this by default.
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
|
||||
**Prototype**
|
||||
@@ -3454,10 +3454,10 @@ example (void)
|
||||
*Notes*:
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
|
||||
is no longer needed.
|
||||
- This API depends on a build option (`JERRY_ES2015_BUILTIN_PROMISE`) and can be checked
|
||||
- This API depends on a build option (`JERRY_BUILTIN_PROMISE`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_PROMISE` feature enum value,
|
||||
see: [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- The ES2015-subset profile enables this by default.
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
|
||||
**Prototype**
|
||||
@@ -3525,10 +3525,10 @@ Resolve or reject the promise with an argument.
|
||||
*Note*:
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
|
||||
is no longer needed.
|
||||
- This API depends on a build option (`JERRY_ES2015_BUILTIN_PROMISE`) and can be checked
|
||||
- This API depends on a build option (`JERRY_BUILTIN_PROMISE`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_PROMISE` feature enum value,
|
||||
see: [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- The ES2015-subset profile enables this by default.
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
|
||||
**Prototype**
|
||||
@@ -3582,7 +3582,7 @@ jerry_resolve_or_reject_promise (jerry_value_t promise,
|
||||
|
||||
# Functions for symbols
|
||||
|
||||
These APIs all depend on the ES2015-subset profile (or on build options).
|
||||
These APIs all depend on the es.next profile (or on build options).
|
||||
|
||||
## jerry_get_symbol_descriptive_string
|
||||
|
||||
@@ -3594,10 +3594,10 @@ 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_release_value](#jerry_release_value) when it
|
||||
is no longer needed.
|
||||
- This API depends on a build option (`JERRY_ES2015_BUILTIN_SYMBOL`) and can be checked
|
||||
- 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_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- The ES2015-subset profile enables this by default.
|
||||
- The es.next profile enables this by default.
|
||||
- If the symbol support is not enabled an error will be returned.
|
||||
|
||||
**Prototype**
|
||||
@@ -3767,7 +3767,7 @@ jerry_create_array (uint32_t size);
|
||||
Create a jerry_value_t representing an ArrayBuffer object.
|
||||
|
||||
*Note*:
|
||||
- This API depends on the ES2015-subset profile.
|
||||
- This API depends on the es.next profile.
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value)
|
||||
when it is no longer needed.
|
||||
|
||||
@@ -3815,7 +3815,7 @@ After the object is not needed the GC will call the `free_cb`
|
||||
so the user can release the buffer which was provided.
|
||||
|
||||
*Note*:
|
||||
- This API depends on the ES2015-subset profile.
|
||||
- This API depends on the es.next profile.
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value)
|
||||
when it is no longer needed.
|
||||
|
||||
@@ -3988,7 +3988,7 @@ jerry_create_error_sz (jerry_error_t error_type,
|
||||
Create new JavaScript DataView object.
|
||||
|
||||
*Note*:
|
||||
- This API depends on the ES2015-subset profile.
|
||||
- This API depends on the es.next profile.
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value)
|
||||
when it is no longer needed.
|
||||
|
||||
@@ -4304,7 +4304,7 @@ Create an empty promise object which can be resolved or rejected later
|
||||
by calling jerry_resolve_or_reject_promise.
|
||||
|
||||
*Note*:
|
||||
- This API depends on the ES2015-subset profile.
|
||||
- This API depends on the es.next profile.
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value)
|
||||
when it is no longer needed.
|
||||
|
||||
@@ -4344,7 +4344,7 @@ jerry_create_promise (void)
|
||||
Create a new Proxy object with the given target and handler.
|
||||
|
||||
*Note*:
|
||||
- This API depends on the ES2015-subset profile.
|
||||
- This API depends on the es.next profile.
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value)
|
||||
when it is no longer needed.
|
||||
|
||||
@@ -4572,7 +4572,7 @@ Create symbol from an API value.
|
||||
|
||||
*Note*:
|
||||
- The given argument is converted to string. This operation can throw an error.
|
||||
- This API depends on the ES2015-subset profile.
|
||||
- This API depends on the es.next profile.
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value)
|
||||
when it is no longer needed.
|
||||
|
||||
@@ -4714,10 +4714,10 @@ and element count can be specified.
|
||||
*Notes*:
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value)
|
||||
when it is no longer needed.
|
||||
- This API depends on a build option (`JERRY_ES2015_BUILTIN_TYPEDARRAY`) and can be checked
|
||||
- This API depends on a build option (`JERRY_BUILTIN_TYPEDARRAY`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_TYPEDARRAY` feature enum value,
|
||||
see: [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- The ES2015-subset profile enables this by default.
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -4770,10 +4770,10 @@ one of the allowed TypedArray functions.
|
||||
*Notes*:
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value)
|
||||
when it is no longer needed.
|
||||
- This API depends on a build option (`JERRY_ES2015_BUILTIN_TYPEDARRAY`) and can be checked
|
||||
- This API depends on a build option (`JERRY_BUILTIN_TYPEDARRAY`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_TYPEDARRAY` feature enum value,
|
||||
see: [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- The ES2015-subset profile enables this by default.
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -4831,10 +4831,10 @@ one of the allowed TypedArray functions.
|
||||
*Notes*:
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value)
|
||||
when it is no longer needed.
|
||||
- This API depends on a build option (`JERRY_ES2015_BUILTIN_TYPEDARRAY`) and can be checked
|
||||
- This API depends on a build option (`JERRY_BUILTIN_TYPEDARRAY`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_TYPEDARRAY` feature enum value,
|
||||
see: [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- The ES2015-subset profile enables this by default.
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -4887,11 +4887,11 @@ Create a jerry_value_t representing a given type container object.
|
||||
- This method is expected to work the same way as the JavaScript Map constructor.
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value)
|
||||
when it is no longer needed.
|
||||
- This API depends on a build option (`JERRY_ES2015_BUILTIN_CONTAINER`) and can be checked
|
||||
- This API depends on a build option (`JERRY_BUILTIN_CONTAINER`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_MAP, JERRY_FEATURE_SET, JERRY_FEATURE_WEAKMAP, JERRY_FEATURE_WEAKSET`
|
||||
feature enum values.
|
||||
see: [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- The ES2015-subset profile enables this by default.
|
||||
- The es.next profile enables this by default.
|
||||
|
||||
*New in version 2.3*.
|
||||
|
||||
@@ -7926,10 +7926,10 @@ If used outside of a native C function it will return "undefined" value.
|
||||
*Notes*:
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
|
||||
is no longer needed.
|
||||
- This feature depends on build option (`JERRY_ES2015`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_SYMBOL` feature enum value (as symbols are enabled in case of ES2015),
|
||||
- This feature depends on build option (`JERRY_ESNEXT`) and can be checked
|
||||
in runtime with the `JERRY_FEATURE_SYMBOL` feature enum value (as symbols are enabled in case of ES.next),
|
||||
see: [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
- If the ES2015 mode is not enabled this method will always return the "undefined" value.
|
||||
- If the ES.next mode is not enabled this method will always return the "undefined" value.
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -8050,7 +8050,7 @@ main (int argc, char** argv)
|
||||
|
||||
# ArrayBuffer and TypedArray functions
|
||||
|
||||
These APIs all depend on the ES2015-subset profile.
|
||||
These APIs all depend on the es.next profile.
|
||||
|
||||
## jerry_get_arraybuffer_byte_length
|
||||
|
||||
|
||||
+2
-2
@@ -83,7 +83,7 @@ information.
|
||||
void jerry_port_print_char (char c);
|
||||
```
|
||||
|
||||
### ES2015 Module system
|
||||
### Jerry Module system
|
||||
|
||||
The port API provides functions that can be used by the module system to open
|
||||
and close source files, and normalize file paths.
|
||||
@@ -135,7 +135,7 @@ jerry_port_normalize_path (const char *in_path_p, /**< input file path */
|
||||
* Get the module object of a native module.
|
||||
*
|
||||
* Note:
|
||||
* This port function is called by jerry-core when ES2015_MODULE_SYSTEM
|
||||
* This port function is called by jerry-core when JERRY_MODULE_SYSTEM
|
||||
* is enabled.
|
||||
*
|
||||
* @param name String value of the module specifier.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
The module system allows users to write import and export statements in scripts, which can be used to separate the logic of the application into custom modules.
|
||||
The standard's relevant part can be found [here](https://www.ecma-international.org/ecma-262/6.0/#sec-modules).
|
||||
Embedders wishing to use native builtin modules with ES6 imports can use the [Port API](05.PORT-API.md#es2015-module-system) to do so.
|
||||
Embedders wishing to use native builtin modules with ES6 imports can use the [Port API](05.PORT-API.md#jerry-module-system) to do so.
|
||||
|
||||
## General
|
||||
|
||||
@@ -76,7 +76,7 @@ export var version = "1.0 (e92ae0fb)";
|
||||
|
||||
```js
|
||||
// module_2.js
|
||||
var featureName = "EcmaScript 2015 modules";
|
||||
var featureName = "EcmaScript modules";
|
||||
var year = 2018;
|
||||
|
||||
export function getFeatureDetails() {
|
||||
|
||||
+27
-23
@@ -17,31 +17,31 @@ set(JERRY_CORE_NAME jerry-core)
|
||||
project (${JERRY_CORE_NAME} C)
|
||||
|
||||
# Optional build settings
|
||||
set(ENABLE_ALL_IN_ONE OFF CACHE BOOL "Enable all-in-one build?")
|
||||
set(ENABLE_ALL_IN_ONE OFF CACHE BOOL "Enable all-in-one build?")
|
||||
|
||||
# Optional features
|
||||
set(JERRY_CPOINTER_32_BIT OFF CACHE BOOL "Enable 32 bit compressed pointers?")
|
||||
set(JERRY_DEBUGGER OFF CACHE BOOL "Enable JerryScript debugger?")
|
||||
set(JERRY_ERROR_MESSAGES OFF CACHE BOOL "Enable error messages?")
|
||||
set(JERRY_EXTERNAL_CONTEXT OFF CACHE BOOL "Enable external context?")
|
||||
set(JERRY_PARSER ON CACHE BOOL "Enable javascript-parser?")
|
||||
set(JERRY_LINE_INFO OFF CACHE BOOL "Enable line info?")
|
||||
set(JERRY_LOGGING OFF CACHE BOOL "Enable logging?")
|
||||
set(JERRY_MEM_STATS OFF CACHE BOOL "Enable memory statistics?")
|
||||
set(JERRY_MEM_GC_BEFORE_EACH_ALLOC OFF CACHE BOOL "Enable mem-stress test?")
|
||||
set(JERRY_PARSER_DUMP_BYTE_CODE OFF CACHE BOOL "Enable parser byte-code dumps?")
|
||||
set(JERRY_PROFILE "es5.1" CACHE STRING "Use default or other profile?")
|
||||
set(JERRY_REGEXP_STRICT_MODE OFF CACHE BOOL "Enable regexp strict mode?")
|
||||
set(JERRY_REGEXP_DUMP_BYTE_CODE OFF CACHE BOOL "Enable regexp byte-code dumps?")
|
||||
set(JERRY_SNAPSHOT_EXEC OFF CACHE BOOL "Enable executing snapshot files?")
|
||||
set(JERRY_SNAPSHOT_SAVE OFF CACHE BOOL "Enable saving snapshot files?")
|
||||
set(JERRY_SYSTEM_ALLOCATOR OFF CACHE BOOL "Enable system allocator?")
|
||||
set(JERRY_VALGRIND OFF CACHE BOOL "Enable Valgrind support?")
|
||||
set(JERRY_VM_EXEC_STOP OFF CACHE BOOL "Enable VM execution stopping?")
|
||||
set(JERRY_GLOBAL_HEAP_SIZE "(512)" CACHE STRING "Size of memory heap, in kilobytes")
|
||||
set(JERRY_GC_LIMIT "(0)" CACHE STRING "Heap usage limit to trigger garbage collection")
|
||||
set(JERRY_STACK_LIMIT "(0)" CACHE STRING "Maximum stack usage size, in kilobytes")
|
||||
set(JERRY_GC_MARK_LIMIT "(8)" CACHE STRING "Maximum depth of recursion during GC mark phase")
|
||||
set(JERRY_CPOINTER_32_BIT OFF CACHE BOOL "Enable 32 bit compressed pointers?")
|
||||
set(JERRY_DEBUGGER OFF CACHE BOOL "Enable JerryScript debugger?")
|
||||
set(JERRY_ERROR_MESSAGES OFF CACHE BOOL "Enable error messages?")
|
||||
set(JERRY_EXTERNAL_CONTEXT OFF CACHE BOOL "Enable external context?")
|
||||
set(JERRY_PARSER ON CACHE BOOL "Enable javascript-parser?")
|
||||
set(JERRY_LINE_INFO OFF CACHE BOOL "Enable line info?")
|
||||
set(JERRY_LOGGING OFF CACHE BOOL "Enable logging?")
|
||||
set(JERRY_MEM_STATS OFF CACHE BOOL "Enable memory statistics?")
|
||||
set(JERRY_MEM_GC_BEFORE_EACH_ALLOC OFF CACHE BOOL "Enable mem-stress test?")
|
||||
set(JERRY_PARSER_DUMP_BYTE_CODE OFF CACHE BOOL "Enable parser byte-code dumps?")
|
||||
set(JERRY_PROFILE "es.next" CACHE STRING "Use default or other profile?")
|
||||
set(JERRY_REGEXP_STRICT_MODE OFF CACHE BOOL "Enable regexp strict mode?")
|
||||
set(JERRY_REGEXP_DUMP_BYTE_CODE OFF CACHE BOOL "Enable regexp byte-code dumps?")
|
||||
set(JERRY_SNAPSHOT_EXEC OFF CACHE BOOL "Enable executing snapshot files?")
|
||||
set(JERRY_SNAPSHOT_SAVE OFF CACHE BOOL "Enable saving snapshot files?")
|
||||
set(JERRY_SYSTEM_ALLOCATOR OFF CACHE BOOL "Enable system allocator?")
|
||||
set(JERRY_VALGRIND OFF CACHE BOOL "Enable Valgrind support?")
|
||||
set(JERRY_VM_EXEC_STOP OFF CACHE BOOL "Enable VM execution stopping?")
|
||||
set(JERRY_GLOBAL_HEAP_SIZE "(512)" CACHE STRING "Size of memory heap, in kilobytes")
|
||||
set(JERRY_GC_LIMIT "(0)" CACHE STRING "Heap usage limit to trigger garbage collection")
|
||||
set(JERRY_STACK_LIMIT "(0)" CACHE STRING "Maximum stack usage size, in kilobytes")
|
||||
set(JERRY_GC_MARK_LIMIT "(8)" CACHE STRING "Maximum depth of recursion during GC mark phase")
|
||||
|
||||
# Option overrides
|
||||
if(USING_MSVC)
|
||||
@@ -254,6 +254,10 @@ jerry_add_define01(JERRY_MEM_GC_BEFORE_EACH_ALLOC)
|
||||
jerry_add_define01(JERRY_PARSER_DUMP_BYTE_CODE)
|
||||
|
||||
# Profile
|
||||
if (${JERRY_PROFILE} STREQUAL "es2015-subset")
|
||||
message(DEPRECATION "'es2015-subset' profile is deprecated, please use 'es.next' instead.")
|
||||
endif()
|
||||
|
||||
if (NOT IS_ABSOLUTE ${JERRY_PROFILE})
|
||||
set(JERRY_PROFILE "${CMAKE_CURRENT_SOURCE_DIR}/profiles/${JERRY_PROFILE}.profile")
|
||||
endif()
|
||||
|
||||
@@ -45,9 +45,9 @@ snapshot_get_global_flags (bool has_regex, /**< regex literal is present */
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
flags |= (has_regex ? JERRY_SNAPSHOT_HAS_REGEX_LITERAL : 0);
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
flags |= (has_class ? JERRY_SNAPSHOT_HAS_CLASS_LITERAL : 0);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
return flags;
|
||||
} /* snapshot_get_global_flags */
|
||||
@@ -63,9 +63,9 @@ snapshot_check_global_flags (uint32_t global_flags) /**< global flags */
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
global_flags &= (uint32_t) ~JERRY_SNAPSHOT_HAS_REGEX_LITERAL;
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
global_flags &= (uint32_t) ~JERRY_SNAPSHOT_HAS_CLASS_LITERAL;
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
return global_flags == snapshot_get_global_flags (false, false);
|
||||
} /* snapshot_check_global_flags */
|
||||
@@ -160,7 +160,7 @@ snapshot_add_compiled_code (ecma_compiled_code_t *compiled_code_p, /**< compiled
|
||||
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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (compiled_code_p->status_flags & CBC_CODE_FLAG_HAS_TAGGED_LITERALS)
|
||||
{
|
||||
const char * const error_message_p = "Unsupported feature: tagged template literals.";
|
||||
@@ -172,7 +172,7 @@ snapshot_add_compiled_code (ecma_compiled_code_t *compiled_code_p, /**< compiled
|
||||
{
|
||||
globals_p->class_found = true;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
if (!(compiled_code_p->status_flags & CBC_CODE_FLAGS_FUNCTION))
|
||||
@@ -618,7 +618,7 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/* function name */
|
||||
if (!(bytecode_p->status_flags & CBC_CODE_FLAGS_CLASS_CONSTRUCTOR))
|
||||
{
|
||||
@@ -630,7 +630,7 @@ snapshot_load_compiled_code (const uint8_t *base_addr_p, /**< base address of th
|
||||
{
|
||||
extra_bytes += (uint32_t) sizeof (ecma_value_t);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if ENABLED (JERRY_RESOURCE_NAME)
|
||||
/* resource name */
|
||||
@@ -1000,12 +1000,12 @@ jerry_snapshot_result (const uint32_t *snapshot_p, /**< snapshot */
|
||||
|
||||
if (as_function)
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (bytecode_p->status_flags & CBC_CODE_FLAGS_LEXICAL_BLOCK_NEEDED)
|
||||
{
|
||||
ecma_create_global_lexical_block ();
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_object_t *lex_env_p = ecma_get_global_scope ();
|
||||
ecma_object_t *func_obj_p = ecma_op_create_simple_function_object (lex_env_p, bytecode_p);
|
||||
|
||||
+155
-155
@@ -74,12 +74,12 @@ JERRY_STATIC_ASSERT ((int) RE_FLAG_GLOBAL == (int) JERRY_REGEXP_FLAG_GLOBAL
|
||||
re_flags_t_must_be_equal_to_jerry_regexp_flags_t);
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
/* 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 /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
|
||||
/**
|
||||
* Offset between internal and external arithmetic operator types
|
||||
@@ -232,9 +232,9 @@ jerry_cleanup (void)
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
ecma_free_all_enqueued_jobs ();
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
ecma_finalize ();
|
||||
jerry_make_api_unavailable ();
|
||||
|
||||
@@ -628,11 +628,11 @@ jerry_run_all_enqueued_jobs (void)
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
return ecma_process_all_enqueued_jobs ();
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
return ECMA_VALUE_UNDEFINED;
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
} /* jerry_run_all_enqueued_jobs */
|
||||
|
||||
/**
|
||||
@@ -796,13 +796,13 @@ bool
|
||||
jerry_value_is_promise (const jerry_value_t value) /**< api value */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
return (ecma_is_value_object (value)
|
||||
&& ecma_is_promise (ecma_get_object_from_value (value)));
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
JERRY_UNUSED (value);
|
||||
return false;
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
} /* jerry_value_is_promise */
|
||||
|
||||
/**
|
||||
@@ -815,13 +815,13 @@ bool
|
||||
jerry_value_is_proxy (const jerry_value_t value) /**< api value */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
return (ecma_is_value_object (value)
|
||||
&& ECMA_OBJECT_IS_PROXY (ecma_get_object_from_value (value)));
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
JERRY_UNUSED (value);
|
||||
return false;
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
} /* jerry_value_is_proxy */
|
||||
|
||||
/**
|
||||
@@ -849,12 +849,12 @@ jerry_value_is_symbol (const jerry_value_t value) /**< api value */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
return ecma_is_value_symbol (value);
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
JERRY_UNUSED (value);
|
||||
return false;
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
} /* jerry_value_is_symbol */
|
||||
|
||||
/**
|
||||
@@ -908,12 +908,12 @@ jerry_value_get_type (const jerry_value_t value) /**< input value to check */
|
||||
{
|
||||
return JERRY_TYPE_STRING;
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case LIT_MAGIC_STRING_SYMBOL:
|
||||
{
|
||||
return JERRY_TYPE_SYMBOL;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
case LIT_MAGIC_STRING_FUNCTION:
|
||||
{
|
||||
return JERRY_TYPE_FUNCTION;
|
||||
@@ -975,21 +975,21 @@ jerry_is_feature_enabled (const jerry_feature_t feature) /**< feature to check *
|
||||
#if ENABLED (JERRY_BUILTIN_JSON)
|
||||
|| feature == JERRY_FEATURE_JSON
|
||||
#endif /* ENABLED (JERRY_BUILTIN_JSON) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
|| feature == JERRY_FEATURE_PROMISE
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|| feature == JERRY_FEATURE_SYMBOL
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
|| feature == JERRY_FEATURE_TYPEDARRAY
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_BUILTIN_DATAVIEW)
|
||||
|| feature == JERRY_FEATURE_DATAVIEW
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATAVIEW) */
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
|| feature == JERRY_FEATURE_PROXY
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
#if ENABLED (JERRY_BUILTIN_DATE)
|
||||
|| feature == JERRY_FEATURE_DATE
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATE) */
|
||||
@@ -1002,18 +1002,18 @@ jerry_is_feature_enabled (const jerry_feature_t feature) /**< feature to check *
|
||||
#if ENABLED (JERRY_LOGGING)
|
||||
|| feature == JERRY_FEATURE_LOGGING
|
||||
#endif /* ENABLED (JERRY_LOGGING) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
#if ENABLED (JERRY_BUILTIN_MAP)
|
||||
|| feature == JERRY_FEATURE_MAP
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
|
||||
#if ENABLED (JERRY_BUILTIN_SET)
|
||||
|| feature == JERRY_FEATURE_SET
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_SET) */
|
||||
#if ENABLED (JERRY_BUILTIN_WEAKMAP)
|
||||
|| feature == JERRY_FEATURE_WEAKMAP
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_WEAKMAP) */
|
||||
#if ENABLED (JERRY_BUILTIN_WEAKSET)
|
||||
|| feature == JERRY_FEATURE_WEAKSET
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_WEAKSET) */
|
||||
);
|
||||
} /* jerry_is_feature_enabled */
|
||||
|
||||
@@ -1614,7 +1614,7 @@ jerry_create_promise (void)
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target);
|
||||
|
||||
if (old_new_target_p == NULL)
|
||||
@@ -1626,9 +1626,9 @@ jerry_create_promise (void)
|
||||
|
||||
JERRY_CONTEXT (current_new_target) = old_new_target_p;
|
||||
return promise_value;
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Promise not supported.")));
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
} /* jerry_create_promise */
|
||||
|
||||
/**
|
||||
@@ -1651,12 +1651,12 @@ jerry_create_proxy (const jerry_value_t target, /**< target argument */
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p)));
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
ecma_object_t *proxy_p = ecma_proxy_create (target, handler);
|
||||
return jerry_return (proxy_p == NULL ? ECMA_VALUE_ERROR : ecma_make_object_value (proxy_p));
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Proxy is not supported.")));
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
} /* jerry_create_proxy */
|
||||
|
||||
/**
|
||||
@@ -1746,11 +1746,11 @@ jerry_create_symbol (const jerry_value_t value) /**< api value */
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p)));
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
return jerry_return (ecma_op_create_symbol (&value, 1));
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Symbol is not supported.")));
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
} /* jerry_create_symbol */
|
||||
|
||||
/**
|
||||
@@ -2109,7 +2109,7 @@ jerry_has_own_property (const jerry_value_t obj_val, /**< object value */
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (obj_val);
|
||||
ecma_string_t *prop_name_p = ecma_get_prop_name_from_value (prop_name_val);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (obj_p))
|
||||
{
|
||||
ecma_property_descriptor_t prop_desc;
|
||||
@@ -2123,7 +2123,7 @@ jerry_has_own_property (const jerry_value_t obj_val, /**< object value */
|
||||
|
||||
return jerry_return (status);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
return ecma_make_boolean_value (ecma_op_ordinary_object_has_own_property (obj_p, prop_name_p));
|
||||
} /* jerry_has_own_property */
|
||||
@@ -2190,13 +2190,13 @@ jerry_delete_property (const jerry_value_t obj_val, /**< object value */
|
||||
ecma_get_prop_name_from_value (prop_name_val),
|
||||
false);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_IS_VALUE_ERROR (ret_value))
|
||||
{
|
||||
// TODO: Due to Proxies the return value must be changed to jerry_value_t on next release
|
||||
jcontext_release_exception ();
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
return ecma_is_value_true (ret_value);
|
||||
} /* jerry_delete_property */
|
||||
@@ -2224,13 +2224,13 @@ jerry_delete_property_by_index (const jerry_value_t obj_val, /**< object value *
|
||||
false);
|
||||
ecma_deref_ecma_string (str_idx_p);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_IS_VALUE_ERROR (ret_value))
|
||||
{
|
||||
// TODO: Due to Proxies the return value must be changed to jerry_value_t on next release
|
||||
jcontext_release_exception ();
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
return ecma_is_value_true (ret_value);
|
||||
} /* jerry_delete_property_by_index */
|
||||
@@ -2678,13 +2678,13 @@ jerry_get_own_property_descriptor (const jerry_value_t obj_val, /**< object val
|
||||
ecma_get_prop_name_from_value (prop_name_val),
|
||||
&prop_desc);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_IS_VALUE_ERROR (status))
|
||||
{
|
||||
// TODO: Due to Proxies the return value must be changed to jerry_value_t on next release
|
||||
jcontext_release_exception ();
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
if (!ecma_is_value_true (status))
|
||||
{
|
||||
@@ -2927,12 +2927,12 @@ jerry_get_prototype (const jerry_value_t obj_val) /**< object value */
|
||||
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (obj_val);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (obj_p))
|
||||
{
|
||||
return jerry_return (ecma_proxy_object_get_prototype_of (obj_p));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
if (obj_p->u2.prototype_cp == JMEM_CP_NULL)
|
||||
{
|
||||
@@ -2965,12 +2965,12 @@ jerry_set_prototype (const jerry_value_t obj_val, /**< object value */
|
||||
}
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (obj_val);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (obj_p))
|
||||
{
|
||||
return jerry_return (ecma_proxy_object_set_prototype_of (obj_p, proto_obj_val));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
return ecma_op_ordinary_object_set_prototype_of (obj_p, proto_obj_val);
|
||||
} /* jerry_set_prototype */
|
||||
@@ -3201,14 +3201,14 @@ jerry_foreach_object_property (const jerry_value_t obj_val, /**< object value */
|
||||
ecma_object_t *object_p = ecma_get_object_from_value (obj_val);
|
||||
ecma_collection_t *names_p = ecma_op_object_get_property_names (object_p, ECMA_LIST_ENUMERABLE_PROTOTYPE);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (names_p == NULL)
|
||||
{
|
||||
// TODO: Due to Proxies the return value must be changed to jerry_value_t on next release
|
||||
jcontext_release_exception ();
|
||||
return false;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
ecma_value_t *buffer_p = names_p->buffer_p;
|
||||
|
||||
@@ -3255,7 +3255,7 @@ jerry_resolve_or_reject_promise (jerry_value_t promise, /**< the promise value *
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
if (!ecma_is_value_object (promise) || !ecma_is_promise (ecma_get_object_from_value (promise)))
|
||||
{
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p)));
|
||||
@@ -3279,13 +3279,13 @@ jerry_resolve_or_reject_promise (jerry_value_t promise, /**< the promise value *
|
||||
ecma_free_value (function);
|
||||
|
||||
return ret;
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
JERRY_UNUSED (promise);
|
||||
JERRY_UNUSED (argument);
|
||||
JERRY_UNUSED (is_resolve);
|
||||
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Promise not supported.")));
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
} /* jerry_resolve_or_reject_promise */
|
||||
|
||||
/**
|
||||
@@ -3299,17 +3299,17 @@ jerry_get_promise_result (const jerry_value_t promise) /**< promise object to ge
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
if (!jerry_value_is_promise (promise))
|
||||
{
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p)));
|
||||
}
|
||||
|
||||
return ecma_promise_get_result (ecma_get_object_from_value (promise));
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
JERRY_UNUSED (promise);
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Promise not supported.")));
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
} /* jerry_get_promise_result */
|
||||
|
||||
/**
|
||||
@@ -3324,7 +3324,7 @@ jerry_get_promise_state (const jerry_value_t promise) /**< promise object to get
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
if (!jerry_value_is_promise (promise))
|
||||
{
|
||||
return JERRY_PROMISE_STATE_NONE;
|
||||
@@ -3334,10 +3334,10 @@ jerry_get_promise_state (const jerry_value_t promise) /**< promise object to get
|
||||
flags &= (ECMA_PROMISE_IS_PENDING | ECMA_PROMISE_IS_FULFILLED);
|
||||
|
||||
return (flags ? flags : JERRY_PROMISE_STATE_REJECTED);
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
JERRY_UNUSED (promise);
|
||||
return JERRY_PROMISE_STATE_NONE;
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
} /* jerry_get_promise_state */
|
||||
|
||||
/**
|
||||
@@ -3354,7 +3354,7 @@ jerry_get_symbol_descriptive_string (const jerry_value_t symbol) /**< symbol val
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (!ecma_is_value_symbol (symbol))
|
||||
{
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p)));
|
||||
@@ -3362,11 +3362,11 @@ jerry_get_symbol_descriptive_string (const jerry_value_t symbol) /**< symbol val
|
||||
|
||||
/* Note: This operation cannot throw an error */
|
||||
return ecma_get_symbol_descriptive_string (symbol);
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
JERRY_UNUSED (symbol);
|
||||
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Symbol is not supported.")));
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
} /** jerry_get_symbol_descriptive_string */
|
||||
|
||||
/**
|
||||
@@ -3589,7 +3589,7 @@ jerry_get_resource_name (const jerry_value_t value) /**< jerry api value */
|
||||
jerry_value_t
|
||||
jerry_get_new_target (void)
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_object_t *current_new_target = JERRY_CONTEXT (current_new_target);
|
||||
|
||||
if (current_new_target == NULL)
|
||||
@@ -3599,9 +3599,9 @@ jerry_get_new_target (void)
|
||||
|
||||
ecma_ref_object (current_new_target);
|
||||
return ecma_make_object_value (current_new_target);
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
return jerry_create_undefined ();
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
} /* jerry_get_new_target */
|
||||
|
||||
/**
|
||||
@@ -3615,12 +3615,12 @@ jerry_value_is_arraybuffer (const jerry_value_t value) /**< value to check if it
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
return ecma_is_arraybuffer (value);
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
return false;
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_value_is_arraybuffer */
|
||||
|
||||
/**
|
||||
@@ -3638,12 +3638,12 @@ jerry_create_arraybuffer (const jerry_length_t size) /**< size of the ArrayBuffe
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
return jerry_return (ecma_make_object_value (ecma_arraybuffer_new_object (size)));
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (size);
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer not supported.")));
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_create_arraybuffer */
|
||||
|
||||
/**
|
||||
@@ -3664,7 +3664,7 @@ jerry_create_arraybuffer_external (const jerry_length_t size, /**< size of the b
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
ecma_object_t *arraybuffer;
|
||||
|
||||
if (JERRY_UNLIKELY (size == 0 || buffer_p == NULL))
|
||||
@@ -3679,12 +3679,12 @@ jerry_create_arraybuffer_external (const jerry_length_t size, /**< size of the b
|
||||
}
|
||||
|
||||
return jerry_return (ecma_make_object_value (arraybuffer));
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (size);
|
||||
JERRY_UNUSED (buffer_p);
|
||||
JERRY_UNUSED (free_cb);
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer not supported.")));
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_create_arraybuffer_external */
|
||||
|
||||
/**
|
||||
@@ -3703,7 +3703,7 @@ jerry_arraybuffer_write (const jerry_value_t value, /**< target ArrayBuffer */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
if (!ecma_is_arraybuffer (value))
|
||||
{
|
||||
return 0;
|
||||
@@ -3727,13 +3727,13 @@ jerry_arraybuffer_write (const jerry_value_t value, /**< target ArrayBuffer */
|
||||
}
|
||||
|
||||
return copy_count;
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
JERRY_UNUSED (offset);
|
||||
JERRY_UNUSED (buf_p);
|
||||
JERRY_UNUSED (buf_size);
|
||||
return 0;
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_arraybuffer_write */
|
||||
|
||||
/**
|
||||
@@ -3752,7 +3752,7 @@ jerry_arraybuffer_read (const jerry_value_t value, /**< ArrayBuffer to read from
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
if (!ecma_is_arraybuffer (value))
|
||||
{
|
||||
return 0;
|
||||
@@ -3776,13 +3776,13 @@ jerry_arraybuffer_read (const jerry_value_t value, /**< ArrayBuffer to read from
|
||||
}
|
||||
|
||||
return copy_count;
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
JERRY_UNUSED (offset);
|
||||
JERRY_UNUSED (buf_p);
|
||||
JERRY_UNUSED (buf_size);
|
||||
return 0;
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_arraybuffer_read */
|
||||
|
||||
/**
|
||||
@@ -3798,15 +3798,15 @@ jerry_get_arraybuffer_byte_length (const jerry_value_t value) /**< ArrayBuffer *
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
if (ecma_is_arraybuffer (value))
|
||||
{
|
||||
ecma_object_t *buffer_p = ecma_get_object_from_value (value);
|
||||
return ecma_arraybuffer_get_length (buffer_p);
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
return 0;
|
||||
} /* jerry_get_arraybuffer_byte_length */
|
||||
|
||||
@@ -3825,7 +3825,7 @@ jerry_get_arraybuffer_pointer (const jerry_value_t array_buffer) /**< Array Buff
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
if (ecma_is_value_error_reference (array_buffer)
|
||||
|| !ecma_is_arraybuffer (array_buffer))
|
||||
{
|
||||
@@ -3835,9 +3835,9 @@ jerry_get_arraybuffer_pointer (const jerry_value_t array_buffer) /**< Array Buff
|
||||
ecma_object_t *buffer_p = ecma_get_object_from_value (array_buffer);
|
||||
lit_utf8_byte_t *mem_buffer_p = ecma_arraybuffer_get_buffer (buffer_p);
|
||||
return (uint8_t *const) mem_buffer_p;
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (array_buffer);
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
return NULL;
|
||||
} /* jerry_get_arraybuffer_pointer */
|
||||
@@ -3853,15 +3853,15 @@ jerry_is_arraybuffer_detachable (const jerry_value_t value) /**< ArrayBuffer */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
if (ecma_is_arraybuffer (value))
|
||||
{
|
||||
ecma_object_t *buffer_p = ecma_get_object_from_value (value);
|
||||
return ecma_arraybuffer_is_detachable (buffer_p) ? ECMA_VALUE_TRUE : ECMA_VALUE_FALSE;
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Expects an ArrayBuffer")));
|
||||
} /* jerry_is_arraybuffer_detachable */
|
||||
|
||||
@@ -3878,7 +3878,7 @@ jerry_detach_arraybuffer (const jerry_value_t value) /**< ArrayBuffer */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
if (ecma_is_arraybuffer (value))
|
||||
{
|
||||
ecma_object_t *buffer_p = ecma_get_object_from_value (value);
|
||||
@@ -3889,9 +3889,9 @@ jerry_detach_arraybuffer (const jerry_value_t value) /**< ArrayBuffer */
|
||||
}
|
||||
return ECMA_VALUE_NULL;
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Expects an ArrayBuffer")));
|
||||
} /* jerry_detach_arraybuffer */
|
||||
|
||||
@@ -3916,7 +3916,7 @@ jerry_create_dataview (const jerry_value_t array_buffer, /**< arraybuffer to cre
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
|
||||
#if ENABLED (JERRY_BUILTIN_DATAVIEW)
|
||||
if (ecma_is_value_error_reference (array_buffer))
|
||||
{
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p)));
|
||||
@@ -3930,12 +3930,12 @@ jerry_create_dataview (const jerry_value_t array_buffer, /**< arraybuffer to cre
|
||||
};
|
||||
|
||||
return jerry_return (ecma_op_dataview_create (arguments_p, 3));
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_DATAVIEW) */
|
||||
JERRY_UNUSED (array_buffer);
|
||||
JERRY_UNUSED (byte_offset);
|
||||
JERRY_UNUSED (byte_length);
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("DataView is not supported.")));
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATAVIEW */
|
||||
} /* jerry_create_dataview */
|
||||
|
||||
/**
|
||||
@@ -3949,12 +3949,12 @@ jerry_value_is_dataview (const jerry_value_t value) /**< value to check if it is
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
|
||||
#if ENABLED (JERRY_BUILTIN_DATAVIEW)
|
||||
return ecma_is_dataview (value);
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_DATAVIEW) */
|
||||
JERRY_UNUSED (value);
|
||||
return false;
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATAVIEW */
|
||||
} /* jerry_value_is_dataview */
|
||||
|
||||
/**
|
||||
@@ -3976,7 +3976,7 @@ jerry_get_dataview_buffer (const jerry_value_t value, /**< DataView to get the a
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
|
||||
#if ENABLED (JERRY_BUILTIN_DATAVIEW)
|
||||
if (ecma_is_value_error_reference (value))
|
||||
{
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p)));
|
||||
@@ -4003,12 +4003,12 @@ jerry_get_dataview_buffer (const jerry_value_t value, /**< DataView to get the a
|
||||
ecma_ref_object (arraybuffer_p);
|
||||
|
||||
return ecma_make_object_value (arraybuffer_p);
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_DATAVIEW) */
|
||||
JERRY_UNUSED (value);
|
||||
JERRY_UNUSED (byte_offset);
|
||||
JERRY_UNUSED (byte_length);
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("DataView is not supported.")));
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATAVIEW */
|
||||
} /* jerry_get_dataview_buffer */
|
||||
|
||||
/**
|
||||
@@ -4026,15 +4026,15 @@ jerry_value_is_typedarray (jerry_value_t value) /**< value to check if it is a T
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
return ecma_is_typedarray (value);
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
return false;
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_value_is_typedarray */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
/**
|
||||
* TypedArray mapping type
|
||||
*/
|
||||
@@ -4101,7 +4101,7 @@ jerry_typedarray_find_by_type (jerry_typedarray_type_t type_name, /**< type of t
|
||||
return false;
|
||||
} /* jerry_typedarray_find_by_type */
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
/**
|
||||
* Create a TypedArray object with a given type and length.
|
||||
@@ -4119,7 +4119,7 @@ jerry_create_typedarray (jerry_typedarray_type_t type_name, /**< type of TypedAr
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
ecma_builtin_id_t prototype_id = 0;
|
||||
ecma_typedarray_type_t id = 0;
|
||||
uint8_t element_size_shift = 0;
|
||||
@@ -4140,11 +4140,11 @@ jerry_create_typedarray (jerry_typedarray_type_t type_name, /**< type of TypedAr
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (array_value));
|
||||
|
||||
return array_value;
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (type_name);
|
||||
JERRY_UNUSED (length);
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("TypedArray not supported.")));
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_create_typedarray */
|
||||
|
||||
/**
|
||||
@@ -4164,7 +4164,7 @@ jerry_create_typedarray_for_arraybuffer_sz (jerry_typedarray_type_t type_name, /
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
if (ecma_is_value_error_reference (arraybuffer))
|
||||
{
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG (error_value_msg_p)));
|
||||
@@ -4197,13 +4197,13 @@ jerry_create_typedarray_for_arraybuffer_sz (jerry_typedarray_type_t type_name, /
|
||||
ecma_free_value (arguments_p[2]);
|
||||
|
||||
return jerry_return (array_value);
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (type_name);
|
||||
JERRY_UNUSED (arraybuffer);
|
||||
JERRY_UNUSED (byte_offset);
|
||||
JERRY_UNUSED (length);
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("TypedArray not supported.")));
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_create_typedarray_for_arraybuffer_sz */
|
||||
|
||||
/**
|
||||
@@ -4221,7 +4221,7 @@ jerry_create_typedarray_for_arraybuffer (jerry_typedarray_type_t type_name, /**<
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
if (ecma_is_value_error_reference (arraybuffer))
|
||||
{
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG (error_value_msg_p)));
|
||||
@@ -4229,11 +4229,11 @@ jerry_create_typedarray_for_arraybuffer (jerry_typedarray_type_t type_name, /**<
|
||||
|
||||
jerry_length_t byteLength = jerry_get_arraybuffer_byte_length (arraybuffer);
|
||||
return jerry_create_typedarray_for_arraybuffer_sz (type_name, arraybuffer, 0, byteLength);
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (type_name);
|
||||
JERRY_UNUSED (arraybuffer);
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("TypedArray not supported.")));
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_create_typedarray_for_arraybuffer */
|
||||
|
||||
/**
|
||||
@@ -4247,7 +4247,7 @@ jerry_get_typedarray_type (jerry_value_t value) /**< object to get the TypedArra
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
if (!ecma_is_typedarray (value))
|
||||
{
|
||||
return JERRY_TYPEDARRAY_INVALID;
|
||||
@@ -4263,9 +4263,9 @@ jerry_get_typedarray_type (jerry_value_t value) /**< object to get the TypedArra
|
||||
return jerry_typedarray_mappings[i].api_type;
|
||||
}
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
return JERRY_TYPEDARRAY_INVALID;
|
||||
} /* jerry_get_typedarray_type */
|
||||
@@ -4280,15 +4280,15 @@ jerry_get_typedarray_length (jerry_value_t value) /**< TypedArray to query */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
if (ecma_is_typedarray (value))
|
||||
{
|
||||
ecma_object_t *array_p = ecma_get_object_from_value (value);
|
||||
return ecma_typedarray_get_length (array_p);
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
return 0;
|
||||
} /* jerry_get_typedarray_length */
|
||||
@@ -4312,7 +4312,7 @@ jerry_get_typedarray_buffer (jerry_value_t value, /**< TypedArray to get the arr
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
if (!ecma_is_typedarray (value))
|
||||
{
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Object is not a TypedArray.")));
|
||||
@@ -4334,12 +4334,12 @@ jerry_get_typedarray_buffer (jerry_value_t value, /**< TypedArray to get the arr
|
||||
ecma_object_t *arraybuffer_p = ecma_typedarray_get_arraybuffer (array_p);
|
||||
ecma_ref_object (arraybuffer_p);
|
||||
return jerry_return (ecma_make_object_value (arraybuffer_p));
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
JERRY_UNUSED (byte_length);
|
||||
JERRY_UNUSED (byte_offset);
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("TypedArray is not supported.")));
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_get_typedarray_buffer */
|
||||
|
||||
/**
|
||||
@@ -4420,7 +4420,7 @@ jerry_create_container (jerry_container_type_t container_type, /**< Type of the
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_CONTAINER)
|
||||
#if ENABLED (JERRY_BUILTIN_CONTAINER)
|
||||
for (jerry_length_t i = 0; i < arguments_list_len; i++)
|
||||
{
|
||||
if (ecma_is_value_error_reference (arguments_list_p[i]))
|
||||
@@ -4435,7 +4435,7 @@ jerry_create_container (jerry_container_type_t container_type, /**< Type of the
|
||||
|
||||
switch (container_type)
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
#if ENABLED (JERRY_BUILTIN_MAP)
|
||||
case JERRY_CONTAINER_TYPE_MAP:
|
||||
{
|
||||
lit_id = LIT_MAGIC_STRING_MAP_UL;
|
||||
@@ -4443,8 +4443,8 @@ jerry_create_container (jerry_container_type_t container_type, /**< Type of the
|
||||
ctor_id = ECMA_BUILTIN_ID_MAP;
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
|
||||
#if ENABLED (JERRY_BUILTIN_SET)
|
||||
case JERRY_CONTAINER_TYPE_SET:
|
||||
{
|
||||
lit_id = LIT_MAGIC_STRING_SET_UL;
|
||||
@@ -4452,8 +4452,8 @@ jerry_create_container (jerry_container_type_t container_type, /**< Type of the
|
||||
ctor_id = ECMA_BUILTIN_ID_SET;
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_SET) */
|
||||
#if ENABLED (JERRY_BUILTIN_WEAKMAP)
|
||||
case JERRY_CONTAINER_TYPE_WEAKMAP:
|
||||
{
|
||||
lit_id = LIT_MAGIC_STRING_WEAKMAP_UL;
|
||||
@@ -4461,8 +4461,8 @@ jerry_create_container (jerry_container_type_t container_type, /**< Type of the
|
||||
ctor_id = ECMA_BUILTIN_ID_WEAKMAP;
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_WEAKMAP) */
|
||||
#if ENABLED (JERRY_BUILTIN_WEAKSET)
|
||||
case JERRY_CONTAINER_TYPE_WEAKSET:
|
||||
{
|
||||
lit_id = LIT_MAGIC_STRING_WEAKSET_UL;
|
||||
@@ -4470,7 +4470,7 @@ jerry_create_container (jerry_container_type_t container_type, /**< Type of the
|
||||
ctor_id = ECMA_BUILTIN_ID_WEAKSET;
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_WEAKSET) */
|
||||
default:
|
||||
{
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Invalid container type.")));
|
||||
@@ -4490,12 +4490,12 @@ jerry_create_container (jerry_container_type_t container_type, /**< Type of the
|
||||
|
||||
JERRY_CONTEXT (current_new_target) = old_new_target_p;
|
||||
return container_value;
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_CONTAINER) */
|
||||
JERRY_UNUSED (arguments_list_p);
|
||||
JERRY_UNUSED (arguments_list_len);
|
||||
JERRY_UNUSED (container_type);
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Containers are disabled.")));
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_CONTAINER) */
|
||||
} /* jerry_create_container */
|
||||
|
||||
/**
|
||||
@@ -4508,7 +4508,7 @@ jerry_get_container_type (const jerry_value_t value) /**< the container object *
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_CONTAINER)
|
||||
#if ENABLED (JERRY_BUILTIN_CONTAINER)
|
||||
if (ecma_is_value_object (value))
|
||||
{
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (value);
|
||||
@@ -4519,30 +4519,30 @@ jerry_get_container_type (const jerry_value_t value) /**< the container object *
|
||||
|
||||
switch (type)
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
#if ENABLED (JERRY_BUILTIN_MAP)
|
||||
case LIT_MAGIC_STRING_MAP_UL:
|
||||
{
|
||||
return JERRY_CONTAINER_TYPE_MAP;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
|
||||
#if ENABLED (JERRY_BUILTIN_SET)
|
||||
case LIT_MAGIC_STRING_SET_UL:
|
||||
{
|
||||
return JERRY_CONTAINER_TYPE_SET;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_SET) */
|
||||
#if ENABLED (JERRY_BUILTIN_WEAKMAP)
|
||||
case LIT_MAGIC_STRING_WEAKMAP_UL:
|
||||
{
|
||||
return JERRY_CONTAINER_TYPE_WEAKMAP;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_WEAKMAP) */
|
||||
#if ENABLED (JERRY_BUILTIN_WEAKSET)
|
||||
case LIT_MAGIC_STRING_WEAKSET_UL:
|
||||
{
|
||||
return JERRY_CONTAINER_TYPE_WEAKSET;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_WEAKSET) */
|
||||
default:
|
||||
{
|
||||
return JERRY_CONTAINER_TYPE_INVALID;
|
||||
@@ -4551,9 +4551,9 @@ jerry_get_container_type (const jerry_value_t value) /**< the container object *
|
||||
}
|
||||
}
|
||||
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_CONTAINER) */
|
||||
JERRY_UNUSED (value);
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_CONTAINER) */
|
||||
return JERRY_CONTAINER_TYPE_INVALID;
|
||||
} /* jerry_get_container_type */
|
||||
|
||||
|
||||
+73
-73
@@ -73,51 +73,51 @@
|
||||
#endif /* !defined (JERRY_BUILTIN_STRING) */
|
||||
|
||||
/**
|
||||
* ES2015 (a.k.a es6) related features, by default all of them are enabled.
|
||||
* ES2015+ related features, by default all of them are enabled.
|
||||
*/
|
||||
#ifndef JERRY_ES2015
|
||||
# define JERRY_ES2015 1
|
||||
#endif /* !defined (JERRY_ES2015) */
|
||||
#ifndef JERRY_ESNEXT
|
||||
# define JERRY_ESNEXT 1
|
||||
#endif /* !defined (JERRY_ESNEXT) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_DATAVIEW
|
||||
# define JERRY_ES2015_BUILTIN_DATAVIEW JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_DATAVIEW) */
|
||||
#ifndef JERRY_BUILTIN_DATAVIEW
|
||||
# define JERRY_BUILTIN_DATAVIEW JERRY_ESNEXT
|
||||
#endif /* !defined (JERRY_BUILTIN_DATAVIEW) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_MAP
|
||||
# define JERRY_ES2015_BUILTIN_MAP JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_MAP) */
|
||||
#ifndef JERRY_BUILTIN_MAP
|
||||
# define JERRY_BUILTIN_MAP JERRY_ESNEXT
|
||||
#endif /* !defined (JERRY_BUILTIN_MAP) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_SET
|
||||
# define JERRY_ES2015_BUILTIN_SET JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_SET) */
|
||||
#ifndef JERRY_BUILTIN_SET
|
||||
# define JERRY_BUILTIN_SET JERRY_ESNEXT
|
||||
#endif /* !defined (JERRY_BUILTIN_SET) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_WEAKMAP
|
||||
# define JERRY_ES2015_BUILTIN_WEAKMAP JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_WEAKMAP) */
|
||||
#ifndef JERRY_BUILTIN_WEAKMAP
|
||||
# define JERRY_BUILTIN_WEAKMAP JERRY_ESNEXT
|
||||
#endif /* !defined (JERRY_BUILTIN_WEAKMAP) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_WEAKSET
|
||||
# define JERRY_ES2015_BUILTIN_WEAKSET JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_WEAKSET) */
|
||||
#ifndef JERRY_BUILTIN_WEAKSET
|
||||
# define JERRY_BUILTIN_WEAKSET JERRY_ESNEXT
|
||||
#endif /* !defined (JERRY_BUILTIN_WEAKSET) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_PROMISE
|
||||
# define JERRY_ES2015_BUILTIN_PROMISE JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#ifndef JERRY_BUILTIN_PROMISE
|
||||
# define JERRY_BUILTIN_PROMISE JERRY_ESNEXT
|
||||
#endif /* !defined (JERRY_BUILTIN_PROMISE) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_PROXY
|
||||
# define JERRY_ES2015_BUILTIN_PROXY JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#ifndef JERRY_BUILTIN_PROXY
|
||||
# define JERRY_BUILTIN_PROXY JERRY_ESNEXT
|
||||
#endif /* !defined (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_REFLECT
|
||||
# define JERRY_ES2015_BUILTIN_REFLECT JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_REFLECT) */
|
||||
#ifndef JERRY_BUILTIN_REFLECT
|
||||
# define JERRY_BUILTIN_REFLECT JERRY_ESNEXT
|
||||
#endif /* !defined (JERRY_BUILTIN_REFLECT) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_TYPEDARRAY
|
||||
# define JERRY_ES2015_BUILTIN_TYPEDARRAY JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#ifndef JERRY_BUILTIN_TYPEDARRAY
|
||||
# define JERRY_BUILTIN_TYPEDARRAY JERRY_ESNEXT
|
||||
#endif /* !defined (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
#ifndef JERRY_ES2015_MODULE_SYSTEM
|
||||
# define JERRY_ES2015_MODULE_SYSTEM JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_MODULE_SYSTEM) */
|
||||
#ifndef JERRY_MODULE_SYSTEM
|
||||
# define JERRY_MODULE_SYSTEM JERRY_ESNEXT
|
||||
#endif /* !defined (JERRY_MODULE_SYSTEM) */
|
||||
|
||||
/**
|
||||
* Engine internal and misc configurations.
|
||||
@@ -513,51 +513,51 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Check ES2015 features
|
||||
* Check ES2015+ features
|
||||
*/
|
||||
#if !defined (JERRY_ES2015) \
|
||||
|| ((JERRY_ES2015 != 0) && (JERRY_ES2015 != 1))
|
||||
# error "Invalid value for JERRY_ES2015 macro."
|
||||
#if !defined (JERRY_ESNEXT) \
|
||||
|| ((JERRY_ESNEXT != 0) && (JERRY_ESNEXT != 1))
|
||||
# error "Invalid value for JERRY_ESNEXT macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_BUILTIN_DATAVIEW) \
|
||||
|| ((JERRY_ES2015_BUILTIN_DATAVIEW != 0) && (JERRY_ES2015_BUILTIN_DATAVIEW != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN_DATAVIEW macro."
|
||||
#if !defined (JERRY_BUILTIN_DATAVIEW) \
|
||||
|| ((JERRY_BUILTIN_DATAVIEW != 0) && (JERRY_BUILTIN_DATAVIEW != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_DATAVIEW macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_BUILTIN_MAP) \
|
||||
|| ((JERRY_ES2015_BUILTIN_MAP != 0) && (JERRY_ES2015_BUILTIN_MAP != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN_MAP macro."
|
||||
#if !defined (JERRY_BUILTIN_MAP) \
|
||||
|| ((JERRY_BUILTIN_MAP != 0) && (JERRY_BUILTIN_MAP != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_MAP macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_BUILTIN_REFLECT) \
|
||||
|| ((JERRY_ES2015_BUILTIN_REFLECT != 0) && (JERRY_ES2015_BUILTIN_REFLECT != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN_REFLECT macro."
|
||||
#if !defined (JERRY_BUILTIN_REFLECT) \
|
||||
|| ((JERRY_BUILTIN_REFLECT != 0) && (JERRY_BUILTIN_REFLECT != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_REFLECT macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_BUILTIN_SET) \
|
||||
|| ((JERRY_ES2015_BUILTIN_SET != 0) && (JERRY_ES2015_BUILTIN_SET != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN_SET macro."
|
||||
#if !defined (JERRY_BUILTIN_SET) \
|
||||
|| ((JERRY_BUILTIN_SET != 0) && (JERRY_BUILTIN_SET != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_SET macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_BUILTIN_WEAKMAP) \
|
||||
|| ((JERRY_ES2015_BUILTIN_WEAKMAP != 0) && (JERRY_ES2015_BUILTIN_WEAKMAP != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN_WEAKMAP macro."
|
||||
#if !defined (JERRY_BUILTIN_WEAKMAP) \
|
||||
|| ((JERRY_BUILTIN_WEAKMAP != 0) && (JERRY_BUILTIN_WEAKMAP != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_WEAKMAP macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_BUILTIN_WEAKSET) \
|
||||
|| ((JERRY_ES2015_BUILTIN_WEAKSET != 0) && (JERRY_ES2015_BUILTIN_WEAKSET != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN_WEAKSET macro."
|
||||
#if !defined (JERRY_BUILTIN_WEAKSET) \
|
||||
|| ((JERRY_BUILTIN_WEAKSET != 0) && (JERRY_BUILTIN_WEAKSET != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_WEAKSET macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_BUILTIN_PROMISE) \
|
||||
|| ((JERRY_ES2015_BUILTIN_PROMISE != 0) && (JERRY_ES2015_BUILTIN_PROMISE != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN_PROMISE macro."
|
||||
#if !defined (JERRY_BUILTIN_PROMISE) \
|
||||
|| ((JERRY_BUILTIN_PROMISE != 0) && (JERRY_BUILTIN_PROMISE != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_PROMISE macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_BUILTIN_PROXY) \
|
||||
|| ((JERRY_ES2015_BUILTIN_PROXY != 0) && (JERRY_ES2015_BUILTIN_PROXY != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN_PROXY macro."
|
||||
#if !defined (JERRY_BUILTIN_PROXY) \
|
||||
|| ((JERRY_BUILTIN_PROXY != 0) && (JERRY_BUILTIN_PROXY != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_PROXY macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_BUILTIN_TYPEDARRAY) \
|
||||
|| ((JERRY_ES2015_BUILTIN_TYPEDARRAY != 0) && (JERRY_ES2015_BUILTIN_TYPEDARRAY != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN_TYPEDARRAY macro."
|
||||
#if !defined (JERRY_BUILTIN_TYPEDARRAY) \
|
||||
|| ((JERRY_BUILTIN_TYPEDARRAY != 0) && (JERRY_BUILTIN_TYPEDARRAY != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_TYPEDARRAY macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_MODULE_SYSTEM) \
|
||||
|| ((JERRY_ES2015_MODULE_SYSTEM != 0) && (JERRY_ES2015_MODULE_SYSTEM != 1))
|
||||
# error "Invalid value for JERRY_ES2015_MODULE_SYSTEM macro."
|
||||
#if !defined (JERRY_MODULE_SYSTEM) \
|
||||
|| ((JERRY_MODULE_SYSTEM != 0) && (JERRY_MODULE_SYSTEM != 1))
|
||||
# error "Invalid value for JERRY_MODULE_SYSTEM macro."
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -677,17 +677,17 @@
|
||||
/**
|
||||
* Wrap container types into a single guard
|
||||
*/
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET) \
|
||||
|| ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) || ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
|
||||
# define JERRY_ES2015_BUILTIN_CONTAINER 1
|
||||
#if ENABLED (JERRY_BUILTIN_MAP) || ENABLED (JERRY_BUILTIN_SET) \
|
||||
|| ENABLED (JERRY_BUILTIN_WEAKMAP) || ENABLED (JERRY_BUILTIN_WEAKSET)
|
||||
# define JERRY_BUILTIN_CONTAINER 1
|
||||
#else
|
||||
# define JERRY_ES2015_BUILTIN_CONTAINER 0
|
||||
# define JERRY_BUILTIN_CONTAINER 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Resource name relatey types into a single guard
|
||||
*/
|
||||
#if ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ERROR_MESSAGES) || ENABLED (JERRY_ES2015_MODULE_SYSTEM)
|
||||
#if ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ERROR_MESSAGES) || ENABLED (JERRY_MODULE_SYSTEM)
|
||||
# define JERRY_RESOURCE_NAME 1
|
||||
#else
|
||||
# define JERRY_RESOURCE_NAME 0
|
||||
|
||||
@@ -35,12 +35,12 @@
|
||||
#include "vm-defines.h"
|
||||
#include "vm-stack.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
#include "ecma-typedarray-object.h"
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
#include "ecma-promise-object.h"
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
|
||||
/* TODO: Extract GC to a separate component */
|
||||
|
||||
@@ -249,7 +249,7 @@ ecma_gc_mark_bound_function_object (ecma_object_t *object_p) /**< bound function
|
||||
}
|
||||
} /* ecma_gc_mark_bound_function_object */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
/**
|
||||
* Mark objects referenced by Promise built-in.
|
||||
*/
|
||||
@@ -292,9 +292,9 @@ ecma_gc_mark_promise_object (ecma_extended_object_t *ext_object_p) /**< extended
|
||||
}
|
||||
} /* ecma_gc_mark_promise_object */
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
#if ENABLED (JERRY_BUILTIN_MAP)
|
||||
/**
|
||||
* Mark objects referenced by Map built-in.
|
||||
*/
|
||||
@@ -329,9 +329,9 @@ ecma_gc_mark_map_object (ecma_object_t *object_p) /**< object */
|
||||
}
|
||||
}
|
||||
} /* ecma_gc_mark_map_object */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP)
|
||||
#if ENABLED (JERRY_BUILTIN_WEAKMAP)
|
||||
/**
|
||||
* Mark objects referenced by WeakMap built-in.
|
||||
*/
|
||||
@@ -361,9 +361,9 @@ ecma_gc_mark_weakmap_object (ecma_object_t *object_p) /**< object */
|
||||
}
|
||||
}
|
||||
} /* ecma_gc_mark_weakmap_object */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_WEAKMAP) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
|
||||
#if ENABLED (JERRY_BUILTIN_SET)
|
||||
/**
|
||||
* Mark objects referenced by Set built-in.
|
||||
*/
|
||||
@@ -393,9 +393,9 @@ ecma_gc_mark_set_object (ecma_object_t *object_p) /**< object */
|
||||
}
|
||||
}
|
||||
} /* ecma_gc_mark_set_object */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_SET) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* Mark objects referenced by inactive generator functions, async functions, etc.
|
||||
*/
|
||||
@@ -465,9 +465,9 @@ ecma_gc_mark_executable_object (ecma_object_t *object_p) /**< object */
|
||||
}
|
||||
} /* ecma_gc_mark_executable_object */
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
/**
|
||||
* Mark the objects referenced by a proxy object
|
||||
*/
|
||||
@@ -488,7 +488,7 @@ ecma_gc_mark_proxy_object (ecma_object_t *object_p) /**< proxy object */
|
||||
ecma_gc_set_object_visited (ecma_get_object_from_value (proxy_p->handler));
|
||||
}
|
||||
} /* ecma_gc_mark_proxy_object */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
/**
|
||||
* Mark objects as visited starting from specified object as root
|
||||
@@ -533,57 +533,57 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
|
||||
switch (ext_object_p->u.class_prop.class_id)
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
case LIT_MAGIC_STRING_PROMISE_UL:
|
||||
{
|
||||
ecma_gc_mark_promise_object (ext_object_p);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
#if ENABLED (JERRY_BUILTIN_DATAVIEW)
|
||||
case LIT_MAGIC_STRING_DATAVIEW_UL:
|
||||
{
|
||||
ecma_dataview_object_t *dataview_p = (ecma_dataview_object_t *) object_p;
|
||||
ecma_gc_set_object_visited (dataview_p->buffer_p);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_CONTAINER)
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATAVIEW) */
|
||||
#if ENABLED (JERRY_BUILTIN_CONTAINER)
|
||||
#if ENABLED (JERRY_BUILTIN_WEAKSET)
|
||||
case LIT_MAGIC_STRING_WEAKSET_UL:
|
||||
{
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_WEAKSET) */
|
||||
#if ENABLED (JERRY_BUILTIN_SET)
|
||||
case LIT_MAGIC_STRING_SET_UL:
|
||||
{
|
||||
ecma_gc_mark_set_object (object_p);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_SET) */
|
||||
#if ENABLED (JERRY_BUILTIN_WEAKMAP)
|
||||
case LIT_MAGIC_STRING_WEAKMAP_UL:
|
||||
{
|
||||
ecma_gc_mark_weakmap_object (object_p);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_WEAKMAP) */
|
||||
#if ENABLED (JERRY_BUILTIN_MAP)
|
||||
case LIT_MAGIC_STRING_MAP_UL:
|
||||
{
|
||||
ecma_gc_mark_map_object (object_p);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_CONTAINER) */
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case LIT_MAGIC_STRING_GENERATOR_UL:
|
||||
{
|
||||
ecma_gc_mark_executable_object (object_p);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
default:
|
||||
{
|
||||
break;
|
||||
@@ -598,15 +598,15 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
|
||||
switch (ext_object_p->u.pseudo_array.type)
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
case ECMA_PSEUDO_ARRAY_TYPEDARRAY:
|
||||
case ECMA_PSEUDO_ARRAY_TYPEDARRAY_WITH_INFO:
|
||||
{
|
||||
ecma_gc_set_object_visited (ecma_typedarray_get_arraybuffer (object_p));
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case ECMA_PSEUDO_ARRAY_ITERATOR:
|
||||
case ECMA_PSEUDO_SET_ITERATOR:
|
||||
case ECMA_PSEUDO_MAP_ITERATOR:
|
||||
@@ -622,7 +622,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
{
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS);
|
||||
@@ -660,13 +660,13 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
}
|
||||
break;
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
case ECMA_OBJECT_TYPE_PROXY:
|
||||
{
|
||||
ecma_gc_mark_proxy_object (object_p);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
|
||||
{
|
||||
ecma_gc_mark_bound_function_object (object_p);
|
||||
@@ -680,7 +680,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
ecma_gc_set_object_visited (ECMA_GET_NON_NULL_POINTER_FROM_POINTER_TAG (ecma_object_t,
|
||||
ext_func_p->u.function.scope_cp));
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
const ecma_compiled_code_t *byte_code_p = ecma_op_function_get_compiled_code (ext_func_p);
|
||||
|
||||
if (byte_code_p->status_flags & CBC_CODE_FLAGS_ARROW_FUNCTION)
|
||||
@@ -697,11 +697,11 @@ 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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
}
|
||||
break;
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION:
|
||||
{
|
||||
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
|
||||
@@ -717,7 +717,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
default:
|
||||
{
|
||||
break;
|
||||
@@ -809,7 +809,7 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/**
|
||||
* Free non-objects referenced by inactive generator functions, async functions, etc.
|
||||
@@ -901,7 +901,7 @@ ecma_gc_free_executable_object (ecma_object_t *object_p) /**< object */
|
||||
return size;
|
||||
} /* ecma_gc_free_executable_object */
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* Free properties of an object
|
||||
@@ -947,7 +947,7 @@ ecma_gc_free_properties (ecma_object_t *object_p) /**< object */
|
||||
{
|
||||
ecma_gc_free_native_pointer (property_p);
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) || ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
|
||||
#if ENABLED (JERRY_BUILTIN_WEAKMAP) || ENABLED (JERRY_BUILTIN_WEAKSET)
|
||||
else if (JERRY_UNLIKELY (name_cp == LIT_INTERNAL_MAGIC_STRING_WEAK_REFS))
|
||||
{
|
||||
ecma_collection_t *refs_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_collection_t,
|
||||
@@ -966,7 +966,7 @@ ecma_gc_free_properties (ecma_object_t *object_p) /**< object */
|
||||
|
||||
ecma_collection_destroy (refs_p);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) || ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_WEAKMAP) || ENABLED (JERRY_BUILTIN_WEAKSET) */
|
||||
}
|
||||
|
||||
if (prop_iter_p->types[i] != ECMA_PROPERTY_TYPE_DELETED)
|
||||
@@ -1050,14 +1050,14 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
}
|
||||
case ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION:
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
|
||||
|
||||
if (ext_func_p->u.external_handler_cb == ecma_proxy_revoke_cb)
|
||||
{
|
||||
ext_object_size = sizeof (ecma_revocable_proxy_object_t);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
break;
|
||||
}
|
||||
case ECMA_OBJECT_TYPE_CLASS:
|
||||
@@ -1066,9 +1066,9 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
|
||||
switch (ext_object_p->u.class_prop.class_id)
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case LIT_MAGIC_STRING_SYMBOL_UL:
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
case LIT_MAGIC_STRING_STRING_UL:
|
||||
case LIT_MAGIC_STRING_NUMBER_UL:
|
||||
{
|
||||
@@ -1092,7 +1092,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
|
||||
break;
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
case LIT_MAGIC_STRING_ARRAY_BUFFER_UL:
|
||||
{
|
||||
ecma_length_t arraybuffer_length = ext_object_p->u.class_prop.u.length;
|
||||
@@ -1117,8 +1117,8 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
case LIT_MAGIC_STRING_PROMISE_UL:
|
||||
{
|
||||
ecma_free_value_if_not_object (ext_object_p->u.class_prop.u.value);
|
||||
@@ -1129,20 +1129,20 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
ext_object_size = sizeof (ecma_promise_object_t);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_CONTAINER)
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
#if ENABLED (JERRY_BUILTIN_CONTAINER)
|
||||
#if ENABLED (JERRY_BUILTIN_MAP)
|
||||
case LIT_MAGIC_STRING_MAP_UL:
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
|
||||
#if ENABLED (JERRY_BUILTIN_SET)
|
||||
case LIT_MAGIC_STRING_SET_UL:
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_SET) */
|
||||
#if ENABLED (JERRY_BUILTIN_WEAKMAP)
|
||||
case LIT_MAGIC_STRING_WEAKMAP_UL:
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_WEAKMAP) */
|
||||
#if ENABLED (JERRY_BUILTIN_WEAKSET)
|
||||
case LIT_MAGIC_STRING_WEAKSET_UL:
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_WEAKSET) */
|
||||
{
|
||||
ecma_extended_object_t *map_object_p = (ecma_extended_object_t *) object_p;
|
||||
ecma_collection_t *container_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_collection_t,
|
||||
@@ -1152,21 +1152,21 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_CONTAINER) */
|
||||
#if ENABLED (JERRY_BUILTIN_DATAVIEW)
|
||||
case LIT_MAGIC_STRING_DATAVIEW_UL:
|
||||
{
|
||||
ext_object_size = sizeof (ecma_dataview_object_t);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATAVIEW) */
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case LIT_MAGIC_STRING_GENERATOR_UL:
|
||||
{
|
||||
ext_object_size = ecma_gc_free_executable_object (object_p);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
default:
|
||||
{
|
||||
/* The undefined id represents an uninitialized class. */
|
||||
@@ -1181,13 +1181,13 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
|
||||
break;
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
case ECMA_OBJECT_TYPE_PROXY:
|
||||
{
|
||||
ext_object_size = sizeof (ecma_proxy_object_t);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
case ECMA_OBJECT_TYPE_FUNCTION:
|
||||
{
|
||||
/* Function with byte-code (not a built-in function). */
|
||||
@@ -1200,14 +1200,14 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (byte_code_p->status_flags & CBC_CODE_FLAGS_ARROW_FUNCTION)
|
||||
{
|
||||
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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_bytecode_deref (byte_code_p);
|
||||
#if ENABLED (JERRY_SNAPSHOT_EXEC)
|
||||
@@ -1245,14 +1245,14 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
ext_object_size += formal_params_size;
|
||||
break;
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
case ECMA_PSEUDO_ARRAY_TYPEDARRAY_WITH_INFO:
|
||||
{
|
||||
ext_object_size = sizeof (ecma_extended_typedarray_object_t);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case ECMA_PSEUDO_STRING_ITERATOR:
|
||||
{
|
||||
ecma_value_t iterated_value = ext_object_p->u.pseudo_array.u2.iterated_value;
|
||||
@@ -1264,7 +1264,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_TYPEDARRAY
|
||||
|
||||
@@ -346,10 +346,10 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ECMA_LIST_SYMBOLS = (1 << 3), /**< list symbol properties */
|
||||
ECMA_LIST_SYMBOLS_ONLY = (1 << 4), /**< list symbol properties only */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (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;
|
||||
@@ -413,11 +413,11 @@ typedef enum
|
||||
/**
|
||||
* Default flag of length property.
|
||||
*/
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#define ECMA_PROPERTY_FLAG_DEFAULT_LENGTH ECMA_PROPERTY_FLAG_CONFIGURABLE
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
#define ECMA_PROPERTY_FLAG_DEFAULT_LENGTH ECMA_PROPERTY_FIXED
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* Shift for property name part.
|
||||
@@ -677,7 +677,7 @@ typedef enum
|
||||
ECMA_LEXICAL_ENVIRONMENT_TYPE__MAX = ECMA_LEXICAL_ENVIRONMENT_HOME_OBJECT_BOUND /**< maximum value */
|
||||
} ecma_lexical_environment_type_t;
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/**
|
||||
* Types of array iterators.
|
||||
@@ -689,7 +689,7 @@ typedef enum
|
||||
ECMA_ITERATOR_KEYS_VALUES, /**< List key indices and values */
|
||||
} ecma_array_iterator_type_t;
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* Offset for JERRY_CONTEXT (status_flags) top 8 bits.
|
||||
@@ -975,9 +975,9 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
ecma_extended_object_t header; /**< extended object header */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_integer_value_t target_length; /**< length of target function */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
} ecma_bound_function_t;
|
||||
|
||||
#if ENABLED (JERRY_SNAPSHOT_EXEC)
|
||||
@@ -993,7 +993,7 @@ typedef struct
|
||||
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/**
|
||||
* Description of arrow function objects.
|
||||
@@ -1018,9 +1018,9 @@ typedef struct
|
||||
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_CONTAINER)
|
||||
#if ENABLED (JERRY_BUILTIN_CONTAINER)
|
||||
/**
|
||||
* Flags for container objects
|
||||
*/
|
||||
@@ -1073,7 +1073,7 @@ typedef struct
|
||||
#define ECMA_CONTAINER_START(collection_p) \
|
||||
(collection_p->buffer_p + 1)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_CONTAINER) */
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@@ -1765,7 +1765,7 @@ typedef struct
|
||||
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
|
||||
/**
|
||||
* Function callback descriptor of a %TypedArray% object getter
|
||||
@@ -1849,9 +1849,9 @@ typedef struct
|
||||
uint8_t element_size; /**< element size based on [[TypedArrayName]] in Table 49 */
|
||||
} ecma_typedarray_info_t;
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/**
|
||||
* Executable (e.g. generator, async) object flags.
|
||||
@@ -1870,9 +1870,9 @@ typedef enum
|
||||
#define ECMA_EXECUTABLE_OBJECT_IS_SUSPENDED(extra_info) \
|
||||
(!((extra_info) & (ECMA_EXECUTABLE_OBJECT_COMPLETED | ECMA_EXECUTABLE_OBJECT_RUNNING)))
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
|
||||
#if ENABLED (JERRY_BUILTIN_DATAVIEW)
|
||||
/**
|
||||
* Description of DataView objects.
|
||||
*/
|
||||
@@ -1882,7 +1882,7 @@ typedef struct
|
||||
ecma_object_t *buffer_p; /**< [[ViewedArrayBuffer]] internal slot */
|
||||
uint32_t byte_offset; /**< [[ByteOffset]] internal slot */
|
||||
} ecma_dataview_object_t;
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATAVIEW */
|
||||
|
||||
/**
|
||||
* Flag for indicating whether the symbol is a well known symbol
|
||||
@@ -1927,7 +1927,7 @@ do \
|
||||
*/
|
||||
#define ECMA_OBJECT_POINTER_ERROR ((ecma_object_t *) 0x01)
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
/**
|
||||
* Description of Proxy objects.
|
||||
*/
|
||||
@@ -1946,7 +1946,7 @@ typedef struct
|
||||
ecma_extended_object_t header; /**< header part */
|
||||
ecma_value_t proxy; /**< [[RevocableProxy]] internal slot */
|
||||
} ecma_revocable_proxy_object_t;
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -298,7 +298,7 @@ ecma_utf8_string_to_number_by_radix (const lit_utf8_byte_t *str_p, /**< utf-8 st
|
||||
JERRY_ASSERT (radix == 2 || radix == 8 || radix == 16);
|
||||
ecma_number_t num = ECMA_NUMBER_ZERO;
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (radix <= 8)
|
||||
{
|
||||
lit_code_point_t upper_limit = LIT_CHAR_0 + radix;
|
||||
@@ -321,7 +321,7 @@ ecma_utf8_string_to_number_by_radix (const lit_utf8_byte_t *str_p, /**< utf-8 st
|
||||
|
||||
return num;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
for (const lit_utf8_byte_t * iter_p = str_p; iter_p <= end_p; iter_p++)
|
||||
{
|
||||
|
||||
@@ -204,7 +204,7 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* Allocate new ecma-string and fill it with reference to the symbol descriptor
|
||||
*
|
||||
@@ -238,7 +238,7 @@ 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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* Allocate new UTF8 ecma-string and fill it with characters from the given utf8 buffer
|
||||
@@ -457,7 +457,7 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/**
|
||||
* Allocate new ecma-string and fill it with cesu-8 character which represents specified code units
|
||||
@@ -475,7 +475,7 @@ 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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* Allocate new ecma-string and fill it with ecma-number
|
||||
@@ -845,7 +845,7 @@ ecma_destroy_ecma_string (ecma_string_t *string_p) /**< ecma-string */
|
||||
((ecma_ascii_string_t *) string_p)->size + sizeof (ecma_ascii_string_t));
|
||||
return;
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case ECMA_STRING_CONTAINER_SYMBOL:
|
||||
{
|
||||
ecma_extended_string_t * symbol_p = (ecma_extended_string_t *) string_p;
|
||||
@@ -853,7 +853,7 @@ ecma_destroy_ecma_string (ecma_string_t *string_p) /**< ecma-string */
|
||||
ecma_dealloc_extended_string (symbol_p);
|
||||
return;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_UINT32_IN_DESC
|
||||
@@ -1735,12 +1735,12 @@ ecma_compare_ecma_strings (const ecma_string_t *string1_p, /**< ecma-string */
|
||||
return true;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (string1_container == ECMA_STRING_CONTAINER_SYMBOL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
return ecma_compare_ecma_strings_longpath (string1_p, string2_p);
|
||||
} /* ecma_compare_ecma_strings */
|
||||
@@ -1781,12 +1781,12 @@ ecma_compare_ecma_non_direct_strings (const ecma_string_t *string1_p, /**< ecma-
|
||||
return true;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (string1_container == ECMA_STRING_CONTAINER_SYMBOL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
return ecma_compare_ecma_strings_longpath (string1_p, string2_p);
|
||||
} /* ecma_compare_ecma_non_direct_strings */
|
||||
@@ -2730,7 +2730,7 @@ ecma_stringbuilder_destroy (ecma_stringbuilder_t *builder_p) /**< string builder
|
||||
#endif /* ENABLED (JERRY_MEM_STATS) */
|
||||
} /* ecma_stringbuilder_destroy */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* AdvanceStringIndex operation
|
||||
*
|
||||
@@ -2780,7 +2780,7 @@ ecma_op_advance_string_index (ecma_string_t *str_p, /**< input string */
|
||||
|
||||
return next_index + 1;
|
||||
} /* ecma_op_advance_string_index */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -316,7 +316,7 @@ ecma_is_value_string (ecma_value_t value) /**< ecma value */
|
||||
return ((value & (ECMA_VALUE_TYPE_MASK - 0x4)) == ECMA_TYPE_STRING);
|
||||
} /* ecma_is_value_string */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* Check if the value is symbol.
|
||||
*
|
||||
@@ -328,7 +328,7 @@ ecma_is_value_symbol (ecma_value_t value) /**< ecma value */
|
||||
{
|
||||
return (ecma_get_value_type_field (value) == ECMA_TYPE_SYMBOL);
|
||||
} /* ecma_is_value_symbol */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* Check if the value can be property name.
|
||||
@@ -339,11 +339,11 @@ ecma_is_value_symbol (ecma_value_t value) /**< ecma value */
|
||||
inline bool JERRY_ATTR_CONST JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_is_value_prop_name (ecma_value_t value) /**< ecma value */
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
return ecma_is_value_string (value) || ecma_is_value_symbol (value);
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
return ecma_is_value_string (value);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
} /* ecma_is_value_prop_name */
|
||||
|
||||
/**
|
||||
@@ -431,7 +431,7 @@ ecma_is_value_array (ecma_value_t arg) /**< argument */
|
||||
return ECMA_VALUE_TRUE;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (arg_obj_p))
|
||||
{
|
||||
ecma_proxy_object_t *proxy_obj_p = (ecma_proxy_object_t *) arg_obj_p;
|
||||
@@ -444,7 +444,7 @@ ecma_is_value_array (ecma_value_t arg) /**< argument */
|
||||
|
||||
return ecma_is_value_array (proxy_obj_p->target);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
return ECMA_VALUE_FALSE;
|
||||
} /* ecma_is_value_array */
|
||||
@@ -591,9 +591,9 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
JERRY_ASSERT (!ecma_prop_name_is_symbol ((ecma_string_t *) ecma_string_p));
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
if ((((uintptr_t) ecma_string_p) & ECMA_VALUE_TYPE_MASK) != 0)
|
||||
{
|
||||
@@ -603,7 +603,7 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* Symbol value constructor
|
||||
*
|
||||
@@ -617,7 +617,7 @@ 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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* Property-name value constructor
|
||||
@@ -629,12 +629,12 @@ ecma_make_prop_name_value (const ecma_string_t *ecma_prop_name_p) /**< property
|
||||
{
|
||||
JERRY_ASSERT (ecma_prop_name_p != NULL);
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
return ecma_make_string_value (ecma_prop_name_p);
|
||||
} /* ecma_make_prop_name_value */
|
||||
@@ -749,7 +749,7 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* Get pointer to ecma-string from ecma value
|
||||
*
|
||||
@@ -762,7 +762,7 @@ 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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* Get pointer to a property name from ecma value
|
||||
@@ -842,13 +842,13 @@ ecma_copy_value (ecma_value_t value) /**< value description */
|
||||
ecma_ref_ecma_string (ecma_get_string_from_value (value));
|
||||
return value;
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case ECMA_TYPE_SYMBOL:
|
||||
{
|
||||
ecma_ref_ecma_string (ecma_get_symbol_from_value (value));
|
||||
return value;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
case ECMA_TYPE_OBJECT:
|
||||
{
|
||||
ecma_ref_object (ecma_get_object_from_value (value));
|
||||
@@ -1063,13 +1063,13 @@ ecma_free_value (ecma_value_t value) /**< value description */
|
||||
ecma_deref_ecma_string (string_p);
|
||||
break;
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case ECMA_TYPE_SYMBOL:
|
||||
{
|
||||
ecma_deref_ecma_string (ecma_get_symbol_from_value (value));
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
case ECMA_TYPE_OBJECT:
|
||||
{
|
||||
ecma_deref_object (ecma_get_object_from_value (value));
|
||||
@@ -1169,12 +1169,12 @@ ecma_get_typeof_lit_id (ecma_value_t value) /**< input ecma value */
|
||||
{
|
||||
ret_value = LIT_MAGIC_STRING_STRING;
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
else if (ecma_is_value_symbol (value))
|
||||
{
|
||||
ret_value = LIT_MAGIC_STRING_SYMBOL;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
else
|
||||
{
|
||||
JERRY_ASSERT (ecma_is_value_object (value));
|
||||
|
||||
@@ -139,12 +139,12 @@ ecma_create_object_lex_env (ecma_object_t *outer_lexical_environment_p, /**< out
|
||||
ecma_object_t *binding_obj_p, /**< binding object */
|
||||
ecma_lexical_environment_type_t type) /**< type of the new lexical environment */
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
JERRY_ASSERT (type == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND
|
||||
|| type == ECMA_LEXICAL_ENVIRONMENT_HOME_OBJECT_BOUND);
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
JERRY_ASSERT (type == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
JERRY_ASSERT (binding_obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (binding_obj_p));
|
||||
@@ -286,12 +286,12 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (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_HOME_OBJECT_BOUND);
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
JERRY_ASSERT (ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
return ECMA_GET_NON_NULL_POINTER (ecma_object_t, object_p->u1.bound_object_cp);
|
||||
} /* ecma_get_lex_env_binding_object */
|
||||
@@ -1438,7 +1438,7 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
|
||||
}
|
||||
#endif /* ENABLED (JERRY_DEBUGGER) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (bytecode_p->status_flags & CBC_CODE_FLAG_HAS_TAGGED_LITERALS)
|
||||
{
|
||||
ecma_collection_t *collection_p = ecma_compiled_code_get_tagged_template_collection (bytecode_p);
|
||||
@@ -1448,7 +1448,7 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
|
||||
JERRY_CONTEXT (ecma_gc_new_objects) += collection_p->item_count;
|
||||
ecma_collection_free (collection_p);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if ENABLED (JERRY_MEM_STATS)
|
||||
jmem_stats_free_byte_code_bytes (((size_t) bytecode_p->size) << JMEM_ALIGNMENT_LOG);
|
||||
@@ -1467,7 +1467,7 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
|
||||
((size_t) bytecode_p->size) << JMEM_ALIGNMENT_LOG);
|
||||
} /* ecma_bytecode_deref */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* Get the tagged template collection of the compiled code
|
||||
*
|
||||
@@ -1487,9 +1487,9 @@ 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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if ENABLED (JERRY_RESOURCE_NAME) || ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_RESOURCE_NAME) || ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* Get the number of formal parameters of the compiled code
|
||||
*
|
||||
@@ -1538,16 +1538,16 @@ ecma_compiled_code_resolve_function_name (const ecma_compiled_code_t *bytecode_h
|
||||
JERRY_ASSERT (bytecode_header_p != NULL);
|
||||
ecma_value_t *base_p = ecma_compiled_code_resolve_arguments_start (bytecode_header_p);
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (!(bytecode_header_p->status_flags & CBC_CODE_FLAGS_CLASS_CONSTRUCTOR))
|
||||
{
|
||||
base_p--;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
return base_p;
|
||||
} /* ecma_compiled_code_resolve_function_name */
|
||||
#endif /* ENABLED (JERRY_RESOURCE_NAME) || ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_RESOURCE_NAME) || ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if (JERRY_STACK_LIMIT != 0)
|
||||
/**
|
||||
|
||||
@@ -180,17 +180,17 @@ typedef enum
|
||||
*/
|
||||
#define ECMA_BOOL_TO_BITFIELD(x) ((x) ? 1 : 0)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* JERRY_ASSERT compatible macro for checking whether the given ecma-value is symbol
|
||||
*/
|
||||
#define ECMA_ASSERT_VALUE_IS_SYMBOL(value) (ecma_is_value_symbol ((value)))
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
/**
|
||||
* JERRY_ASSERT compatible macro for checking whether the given ecma-value is symbol
|
||||
*/
|
||||
#define ECMA_ASSERT_VALUE_IS_SYMBOL(value) (false)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* Check whether the given type is ECMA_OBJECT_TYPE_PROXY
|
||||
@@ -204,11 +204,11 @@ typedef enum
|
||||
*
|
||||
* @param obj_p ecma-object
|
||||
*/
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
#define ECMA_OBJECT_IS_PROXY(obj_p) (ECMA_OBJECT_TYPE_IS_PROXY (ecma_get_object_type ((obj_p))))
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
#define ECMA_OBJECT_IS_PROXY(obj_p) (false)
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
/* ecma-helpers-value.c */
|
||||
ecma_type_t JERRY_ATTR_CONST ecma_get_value_type_field (ecma_value_t value);
|
||||
@@ -228,9 +228,9 @@ bool JERRY_ATTR_CONST ecma_are_values_integer_numbers (ecma_value_t first_value,
|
||||
bool JERRY_ATTR_CONST ecma_is_value_float_number (ecma_value_t value);
|
||||
bool JERRY_ATTR_CONST ecma_is_value_number (ecma_value_t value);
|
||||
bool JERRY_ATTR_CONST ecma_is_value_string (ecma_value_t value);
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
bool JERRY_ATTR_CONST ecma_is_value_symbol (ecma_value_t value);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
bool JERRY_ATTR_CONST ecma_is_value_prop_name (ecma_value_t value);
|
||||
bool JERRY_ATTR_CONST ecma_is_value_direct_string (ecma_value_t value);
|
||||
bool JERRY_ATTR_CONST ecma_is_value_non_direct_string (ecma_value_t value);
|
||||
@@ -248,9 +248,9 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_value_t JERRY_ATTR_PURE ecma_make_symbol_value (const ecma_string_t *ecma_symbol_p);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (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);
|
||||
@@ -260,9 +260,9 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_string_t JERRY_ATTR_PURE *ecma_get_symbol_from_value (ecma_value_t value);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (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_error_reference_t JERRY_ATTR_PURE *ecma_get_error_reference_from_value (ecma_value_t value);
|
||||
@@ -282,22 +282,22 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (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);
|
||||
uint32_t ecma_op_advance_string_index (ecma_string_t *str_p, uint32_t index, bool is_unicode);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET)
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#if ENABLED (JERRY_BUILTIN_MAP) || ENABLED (JERRY_BUILTIN_SET)
|
||||
ecma_string_t *ecma_new_map_key_string (ecma_value_t value);
|
||||
bool ecma_prop_name_is_map_key (ecma_string_t *string_p);
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MAP) || ENABLED (JERRY_BUILTIN_SET) */
|
||||
ecma_string_t *ecma_new_ecma_string_from_utf8 (const lit_utf8_byte_t *string_p, lit_utf8_size_t string_size);
|
||||
ecma_string_t *ecma_new_ecma_string_from_utf8_converted_to_cesu8 (const lit_utf8_byte_t *string_p,
|
||||
lit_utf8_size_t string_size);
|
||||
ecma_string_t *ecma_new_ecma_string_from_code_unit (ecma_char_t code_unit);
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
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);
|
||||
ecma_string_t *ecma_get_ecma_string_from_uint32 (uint32_t uint32_number);
|
||||
@@ -485,14 +485,14 @@ void ecma_raise_error_from_error_reference (ecma_value_t value);
|
||||
|
||||
void ecma_bytecode_ref (ecma_compiled_code_t *bytecode_p);
|
||||
void ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p);
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_collection_t *ecma_compiled_code_get_tagged_template_collection (const ecma_compiled_code_t *bytecode_header_p);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#if ENABLED (JERRY_RESOURCE_NAME) || ENABLED (JERRY_ES2015)
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#if ENABLED (JERRY_RESOURCE_NAME) || ENABLED (JERRY_ESNEXT)
|
||||
ecma_length_t ecma_compiled_code_get_formal_params (const ecma_compiled_code_t *bytecode_p);
|
||||
ecma_value_t *ecma_compiled_code_resolve_arguments_start (const ecma_compiled_code_t *bytecode_header_p);
|
||||
ecma_value_t *ecma_compiled_code_resolve_function_name (const ecma_compiled_code_t *bytecode_header_p);
|
||||
#endif /* ENABLED (JERRY_RESOURCE_NAME) || ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_RESOURCE_NAME) || ENABLED (JERRY_ESNEXT) */
|
||||
#if (JERRY_STACK_LIMIT != 0)
|
||||
uintptr_t ecma_get_current_stack_usage (void);
|
||||
#endif /* (JERRY_STACK_LIMIT != 0) */
|
||||
|
||||
@@ -56,14 +56,14 @@ ecma_init (void)
|
||||
JERRY_CONTEXT (stack_base) = (uintptr_t) &sp;
|
||||
#endif /* (JERRY_STACK_LIMIT != 0) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
ecma_job_queue_init ();
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
JERRY_CONTEXT (current_new_target) = NULL;
|
||||
JERRY_CONTEXT (current_function_obj_p) = NULL;
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
} /* ecma_init */
|
||||
|
||||
/**
|
||||
@@ -72,10 +72,10 @@ ecma_init (void)
|
||||
void
|
||||
ecma_finalize (void)
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
JERRY_ASSERT (JERRY_CONTEXT (current_new_target) == NULL);
|
||||
JERRY_ASSERT (JERRY_CONTEXT (current_function_obj_p) == NULL);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_finalize_global_environment ();
|
||||
uint8_t runs = 0;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* Free symbol list
|
||||
*/
|
||||
@@ -53,7 +53,7 @@ ecma_free_symbol_list (jmem_cpointer_t symbol_list_cp) /**< symbol list */
|
||||
symbol_list_cp = next_item_cp;
|
||||
}
|
||||
} /* ecma_free_symbol_list */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* Free string list
|
||||
@@ -115,9 +115,9 @@ ecma_free_number_list (jmem_cpointer_t number_list_cp) /**< string list */
|
||||
void
|
||||
ecma_finalize_lit_storage (void)
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_free_symbol_list (JERRY_CONTEXT (symbol_list_first_cp));
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
ecma_free_string_list (JERRY_CONTEXT (string_list_first_cp));
|
||||
ecma_free_number_list (JERRY_CONTEXT (number_list_first_cp));
|
||||
} /* ecma_finalize_lit_storage */
|
||||
@@ -542,7 +542,7 @@ ecma_snapshot_get_literal (const uint8_t *literal_base_p, /**< literal start */
|
||||
* Compute the start of the serializable ecma-values of the bytecode
|
||||
* Related values:
|
||||
* - function argument names, if CBC_CODE_FLAGS_MAPPED_ARGUMENTS_NEEDED is present
|
||||
* - function name, if CBC_CODE_FLAGS_CLASS_CONSTRUCTOR is not present and ES2015 profile is enabled
|
||||
* - function name, if CBC_CODE_FLAGS_CLASS_CONSTRUCTOR is not present and ES.next profile is enabled
|
||||
* - resource name, if JERRY_RESOURCE_NAME is enabled
|
||||
*
|
||||
* @return pointer to the beginning of the serializable ecma-values
|
||||
@@ -568,13 +568,13 @@ ecma_snapshot_resolve_serializable_values (ecma_compiled_code_t *compiled_code_p
|
||||
base_p -= argument_end;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/* function name */
|
||||
if (!(compiled_code_p->status_flags & CBC_CODE_FLAGS_CLASS_CONSTRUCTOR))
|
||||
{
|
||||
base_p--;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if ENABLED (JERRY_RESOURCE_NAME)
|
||||
/* resource name */
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "lit-char-helpers.h"
|
||||
#include "vm.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_MODULE_SYSTEM)
|
||||
#if ENABLED (JERRY_MODULE_SYSTEM)
|
||||
|
||||
/**
|
||||
* Takes a ModuleSpecifier and applies path normalization to it.
|
||||
@@ -695,12 +695,12 @@ ecma_module_connect_imports (void)
|
||||
|
||||
ecma_value_t status = ecma_op_has_binding (lex_env_p, import_names_p->local_name_p);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_IS_VALUE_ERROR (status))
|
||||
{
|
||||
return status;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
if (ecma_is_value_true (status))
|
||||
{
|
||||
@@ -1076,4 +1076,4 @@ ecma_module_cleanup (void)
|
||||
JERRY_CONTEXT (module_top_context_p) = NULL;
|
||||
} /* ecma_module_cleanup */
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */
|
||||
#endif /* ENABLED (JERRY_MODULE_SYSTEM) */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifndef ECMA_MODULE_H
|
||||
#define ECMA_MODULE_H
|
||||
|
||||
#if ENABLED (JERRY_ES2015_MODULE_SYSTEM)
|
||||
#if ENABLED (JERRY_MODULE_SYSTEM)
|
||||
|
||||
#include "common.h"
|
||||
#include "ecma-globals.h"
|
||||
@@ -139,6 +139,6 @@ ecma_value_t ecma_module_check_indirect_exports (void);
|
||||
|
||||
void ecma_module_release_module_nodes (ecma_module_node_t *module_node_p);
|
||||
void ecma_module_cleanup (void);
|
||||
#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */
|
||||
#endif /* ENABLED (JERRY_MODULE_SYSTEM) */
|
||||
|
||||
#endif /* !ECMA_MODULE_H */
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "ecma-iterator-object.h"
|
||||
#include "ecma-typedarray-object.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -172,4 +172,4 @@ ecma_builtin_array_iterator_prototype_object_next (ecma_value_t this_val) /**< t
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
|
||||
LIT_MAGIC_STRING_ARRAY_ITERATOR_UL,
|
||||
@@ -29,6 +29,6 @@ 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_array_iterator_prototype_object_next, 0, 0)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "ecma-builtin-helpers.h"
|
||||
#include "ecma-builtins.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -25,4 +25,4 @@
|
||||
#define BUILTIN_UNDERSCORED_ID array_prototype_unscopables
|
||||
#include "ecma-builtin-internal-routines-template.inc.h"
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
SIMPLE_VALUE (LIT_MAGIC_STRING_COPY_WITHIN,
|
||||
ECMA_VALUE_TRUE,
|
||||
@@ -49,6 +49,6 @@ SIMPLE_VALUE (LIT_MAGIC_STRING_VALUES,
|
||||
ECMA_VALUE_TRUE,
|
||||
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -221,17 +221,17 @@ ecma_builtin_array_prototype_object_concat (const ecma_value_t args[], /**< argu
|
||||
ecma_object_t *obj_p) /**< array object */
|
||||
{
|
||||
/* 2. */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_value_t new_array = ecma_op_array_species_create (obj_p, 0);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (new_array))
|
||||
{
|
||||
return new_array;
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
ecma_value_t new_array = ecma_op_create_array_object (NULL, 0, false);
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
|
||||
uint32_t new_length = 0;
|
||||
@@ -576,18 +576,18 @@ ecma_builtin_array_prototype_object_reverse (ecma_value_t this_arg, /**< this ar
|
||||
ecma_string_t *lower_str_p = ecma_new_ecma_string_from_uint32 (lower);
|
||||
ecma_string_t *upper_str_p = ecma_new_ecma_string_from_uint32 (upper);
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_value_t lower_value = ECMA_VALUE_EMPTY;
|
||||
ecma_value_t upper_value = ECMA_VALUE_EMPTY;
|
||||
|
||||
ecma_value_t has_lower = ecma_op_object_has_property (obj_p, lower_str_p);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_IS_VALUE_ERROR (has_lower))
|
||||
{
|
||||
goto clean_up;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
bool lower_exist = ecma_is_value_true (has_lower);
|
||||
|
||||
@@ -603,12 +603,12 @@ ecma_builtin_array_prototype_object_reverse (ecma_value_t this_arg, /**< this ar
|
||||
|
||||
ecma_value_t has_upper = ecma_op_object_has_property (obj_p, upper_str_p);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_IS_VALUE_ERROR (has_upper))
|
||||
{
|
||||
goto clean_up;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
bool upper_exist = ecma_is_value_true (has_upper);
|
||||
|
||||
@@ -621,7 +621,7 @@ ecma_builtin_array_prototype_object_reverse (ecma_value_t this_arg, /**< this ar
|
||||
goto clean_up;
|
||||
}
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
ecma_value_t lower_value = ecma_op_object_get (obj_p, lower_str_p);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (lower_value))
|
||||
@@ -643,7 +643,7 @@ ecma_builtin_array_prototype_object_reverse (ecma_value_t this_arg, /**< this ar
|
||||
|
||||
bool lower_exist = ecma_is_value_true (has_lower);
|
||||
bool upper_exist = ecma_is_value_true (has_upper);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
if (lower_exist && upper_exist)
|
||||
{
|
||||
@@ -867,7 +867,7 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */
|
||||
|
||||
bool use_fast_path = ecma_op_object_is_fast_array (obj_p);
|
||||
uint32_t copied_length = (end > start) ? end - start : 0;
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_value_t new_array = ecma_op_array_species_create (obj_p, copied_length);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (new_array))
|
||||
@@ -875,10 +875,10 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */
|
||||
return new_array;
|
||||
}
|
||||
use_fast_path &= ecma_op_object_is_fast_array (ecma_get_object_from_value (new_array));
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
ecma_value_t new_array = ecma_op_create_array_object (NULL, 0, false);
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
|
||||
|
||||
@@ -902,7 +902,7 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
uint32_t target_length = ext_to_obj_p->u.array.length;
|
||||
ecma_value_t *to_buffer_p;
|
||||
if (copied_length == target_length)
|
||||
@@ -918,17 +918,17 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */
|
||||
ecma_delete_fast_array_properties (new_array_p, copied_length);
|
||||
to_buffer_p = ECMA_GET_NON_NULL_POINTER (ecma_value_t, new_array_p->u1.property_list_cp);
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
ecma_value_t *to_buffer_p = ecma_fast_array_extend (new_array_p, copied_length);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_value_t *from_buffer_p = ECMA_GET_NON_NULL_POINTER (ecma_value_t, obj_p->u1.property_list_cp);
|
||||
|
||||
for (uint32_t k = start; k < end; k++, n++)
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_free_value_if_not_object (to_buffer_p[n]);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
to_buffer_p[n] = ecma_copy_value_if_not_object (from_buffer_p[k]);
|
||||
}
|
||||
|
||||
@@ -959,19 +959,19 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */
|
||||
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE);
|
||||
ecma_free_value (get_value);
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (ECMA_IS_VALUE_ERROR (put_comp))
|
||||
{
|
||||
ecma_deref_object (new_array_p);
|
||||
return put_comp;
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
JERRY_ASSERT (ecma_is_value_true (put_comp));
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (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))
|
||||
@@ -979,7 +979,7 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */
|
||||
ecma_deref_object (new_array_p);
|
||||
return set_length_value;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
return new_array;
|
||||
} /* ecma_builtin_array_prototype_object_slice */
|
||||
@@ -1117,12 +1117,12 @@ ecma_builtin_array_prototype_object_sort (ecma_value_t this_arg, /**< this argum
|
||||
|
||||
ecma_collection_t *array_index_props_p = ecma_op_object_get_property_names (obj_p, ECMA_LIST_ARRAY_INDICES);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (array_index_props_p == NULL)
|
||||
{
|
||||
return ECMA_VALUE_ERROR;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
uint32_t defined_prop_count = 0;
|
||||
|
||||
@@ -1262,17 +1262,17 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu
|
||||
ecma_object_t *obj_p, /**< array object */
|
||||
uint32_t len) /**< array object's length */
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_value_t new_array = ecma_op_array_species_create (obj_p, 0);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (new_array))
|
||||
{
|
||||
return new_array;
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
ecma_value_t new_array = ecma_op_create_array_object (NULL, 0, false);
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
|
||||
|
||||
@@ -1355,19 +1355,19 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu
|
||||
get_value,
|
||||
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE);
|
||||
ecma_free_value (get_value);
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (ECMA_IS_VALUE_ERROR (put_comp))
|
||||
{
|
||||
ecma_deref_object (new_array_p);
|
||||
return put_comp;
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
JERRY_ASSERT (ecma_is_value_true (put_comp));
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_value_t new_set_length_value = ecma_builtin_array_prototype_helper_set_length (new_array_p,
|
||||
((ecma_number_t) delete_count));
|
||||
|
||||
@@ -1376,7 +1376,7 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu
|
||||
ecma_deref_object (new_array_p);
|
||||
return new_set_length_value;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/* 11. */
|
||||
ecma_length_t item_count;
|
||||
@@ -1956,19 +1956,19 @@ ecma_builtin_array_prototype_object_map (ecma_value_t arg1, /**< callbackfn */
|
||||
}
|
||||
|
||||
/* 6. */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_value_t new_array = ecma_op_array_species_create (obj_p, len);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (new_array))
|
||||
{
|
||||
return new_array;
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
ecma_value_t length_value = ecma_make_number_value (len);
|
||||
ecma_value_t new_array = ecma_op_create_array_object (&length_value, 1, true);
|
||||
ecma_free_value (length_value);
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
|
||||
|
||||
@@ -2012,15 +2012,15 @@ ecma_builtin_array_prototype_object_map (ecma_value_t arg1, /**< callbackfn */
|
||||
|
||||
ecma_free_value (mapped_value);
|
||||
ecma_free_value (current_value);
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (ECMA_IS_VALUE_ERROR (put_comp))
|
||||
{
|
||||
ecma_deref_object (new_array_p);
|
||||
return put_comp;
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
JERRY_ASSERT (ecma_is_value_true (put_comp));
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2049,17 +2049,17 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t arg1, /**< callbackfn *
|
||||
}
|
||||
|
||||
/* 6. */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_value_t new_array = ecma_op_array_species_create (obj_p, 0);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (new_array))
|
||||
{
|
||||
return new_array;
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
ecma_value_t new_array = ecma_op_create_array_object (NULL, 0, false);
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
|
||||
|
||||
@@ -2106,7 +2106,7 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t arg1, /**< callbackfn *
|
||||
new_array_index,
|
||||
get_value,
|
||||
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE);
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (ECMA_IS_VALUE_ERROR (put_comp))
|
||||
{
|
||||
ecma_free_value (call_value);
|
||||
@@ -2115,9 +2115,9 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t arg1, /**< callbackfn *
|
||||
|
||||
return put_comp;
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
JERRY_ASSERT (ecma_is_value_true (put_comp));
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
new_array_index++;
|
||||
}
|
||||
|
||||
@@ -2253,7 +2253,7 @@ ecma_builtin_array_reduce_from (const ecma_value_t args_p[], /**< routine's argu
|
||||
return accumulator;
|
||||
} /* ecma_builtin_array_reduce_from */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/**
|
||||
* The Array.prototype object's 'fill' routine
|
||||
@@ -2579,7 +2579,7 @@ ecma_builtin_array_prototype_object_copy_within (const ecma_value_t args[], /**<
|
||||
|
||||
return ecma_copy_value (ecma_make_object_value (obj_p));
|
||||
} /* ecma_builtin_array_prototype_object_copy_within */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* Dispatcher of the built-in's routines
|
||||
@@ -2624,7 +2624,7 @@ ecma_builtin_array_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (JERRY_UNLIKELY (builtin_routine_id >= ECMA_ARRAY_PROTOTYPE_ENTRIES
|
||||
&& builtin_routine_id <= ECMA_ARRAY_PROTOTYPE_KEYS))
|
||||
{
|
||||
@@ -2643,7 +2643,7 @@ ecma_builtin_array_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
|
||||
ecma_deref_object (obj_p);
|
||||
return ret_value;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
uint32_t length;
|
||||
ecma_value_t len_value = ecma_op_object_get_length (obj_p, &length);
|
||||
@@ -2770,7 +2770,7 @@ ecma_builtin_array_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
|
||||
length);
|
||||
break;
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case ECMA_ARRAY_PROTOTYPE_COPY_WITHIN:
|
||||
{
|
||||
ret_value = ecma_builtin_array_prototype_object_copy_within (arguments_list_p,
|
||||
@@ -2798,7 +2798,7 @@ ecma_builtin_array_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
|
||||
length);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (builtin_routine_id == ECMA_ARRAY_PROTOTYPE_FILTER);
|
||||
|
||||
@@ -29,12 +29,12 @@ OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
|
||||
ECMA_BUILTIN_ID_ARRAY,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/* Number properties:
|
||||
* (property name, object pointer getter) */
|
||||
@@ -69,7 +69,7 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (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)
|
||||
@@ -80,7 +80,7 @@ INTRINSIC_PROPERTY (LIT_MAGIC_STRING_VALUES, LIT_INTERNAL_MAGIC_STRING_ARRAY_PRO
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
INTRINSIC_PROPERTY (LIT_GLOBAL_SYMBOL_ITERATOR, LIT_INTERNAL_MAGIC_STRING_ARRAY_PROTOTYPE_VALUES,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ARRAY) */
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ ecma_builtin_array_object_is_array (ecma_value_t this_arg, /**< 'this' argument
|
||||
return ecma_is_value_array (arg);
|
||||
} /* ecma_builtin_array_object_is_array */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* The Array object's 'from' routine
|
||||
*
|
||||
@@ -473,7 +473,7 @@ ecma_builtin_array_species_get (ecma_value_t this_value) /**< This Value */
|
||||
{
|
||||
return ecma_copy_value (this_value);
|
||||
} /* ecma_builtin_array_species_get */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* Handle calling [[Call]] of built-in Array object
|
||||
@@ -500,9 +500,9 @@ ecma_builtin_array_dispatch_construct (const ecma_value_t *arguments_list_p, /**
|
||||
{
|
||||
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
|
||||
|
||||
#if !ENABLED (JERRY_ES2015)
|
||||
#if !ENABLED (JERRY_ESNEXT)
|
||||
return ecma_op_create_array_object (arguments_list_p, arguments_list_len, true);
|
||||
#else /* ENABLED (JERRY_ES2015) */
|
||||
#else /* ENABLED (JERRY_ESNEXT) */
|
||||
ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target),
|
||||
ECMA_BUILTIN_ID_ARRAY_PROTOTYPE);
|
||||
|
||||
@@ -523,7 +523,7 @@ 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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
} /* ecma_builtin_array_dispatch_construct */
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,16 +36,16 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
|
||||
1,
|
||||
ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
LIT_MAGIC_STRING_ARRAY_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (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_builtin_array_object_is_array, 1, 1)
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ROUTINE (LIT_MAGIC_STRING_FROM, ecma_builtin_array_object_from, NON_FIXED, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_OF, ecma_builtin_array_object_of, NON_FIXED, 0)
|
||||
|
||||
@@ -53,7 +53,7 @@ ROUTINE (LIT_MAGIC_STRING_OF, ecma_builtin_array_object_of, NON_FIXED, 0)
|
||||
ACCESSOR_READ_ONLY (LIT_GLOBAL_SYMBOL_SPECIES,
|
||||
ecma_builtin_array_species_get,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#endif /* !(ENABLED (JERRY_BUILTIN_ARRAY)) */
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "jrt.h"
|
||||
#include "jrt-libc-includes.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -150,4 +150,4 @@ ecma_builtin_arraybuffer_prototype_object_slice (ecma_value_t this_arg, /**< thi
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@@ -33,17 +33,17 @@ ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_BYTE_LENGTH_UL,
|
||||
ecma_builtin_arraybuffer_prototype_bytelength_getter,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/* ECMA-262 v6, 24.1.4.4 */
|
||||
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
|
||||
LIT_MAGIC_STRING_ARRAY_BUFFER_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (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_SLICE, ecma_builtin_arraybuffer_prototype_object_slice, 2, 2)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "ecma-typedarray-object.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -111,4 +111,4 @@ ecma_builtin_arraybuffer_species_get (ecma_value_t this_value) /**< This Value *
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@@ -50,6 +50,6 @@ ACCESSOR_READ_ONLY (LIT_GLOBAL_SYMBOL_SPECIES,
|
||||
ecma_builtin_arraybuffer_species_get,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -36,11 +36,11 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
|
||||
1,
|
||||
ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
LIT_MAGIC_STRING_BOOLEAN_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_BOOLEAN) */
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
#include "ecma-dataview-object.h"
|
||||
#include "ecma-gc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
|
||||
#if ENABLED (JERRY_BUILTIN_DATAVIEW)
|
||||
|
||||
#ifdef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if !ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
#error "DataView builtin requires ES2015 TypedArray builtin"
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -208,4 +208,4 @@ ecma_builtin_dataview_prototype_dispatch_routine (uint16_t builtin_routine_id, /
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATAVIEW */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
|
||||
#if ENABLED (JERRY_BUILTIN_DATAVIEW)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@@ -29,12 +29,12 @@ OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
|
||||
ECMA_BUILTIN_ID_DATAVIEW,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/* ECMA-262 v6, 23.2.4.21 */
|
||||
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
|
||||
LIT_MAGIC_STRING_DATAVIEW_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/* Routine properties:
|
||||
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
|
||||
@@ -74,6 +74,6 @@ ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_BYTE_OFFSET_UL,
|
||||
ECMA_DATAVIEW_PROTOTYPE_BYTE_OFFSET_GETTER,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATAVIEW */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "ecma-exceptions.h"
|
||||
#include "ecma-dataview-object.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
|
||||
#if ENABLED (JERRY_BUILTIN_DATAVIEW)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -68,4 +68,4 @@ ecma_builtin_dataview_dispatch_construct (const ecma_value_t *arguments_list_p,
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATAVIEW */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
|
||||
#if ENABLED (JERRY_BUILTIN_DATAVIEW)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@@ -42,6 +42,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_DATAVIEW_PROTOTYPE,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATAVIEW */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -100,9 +100,9 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ECMA_DATE_PROTOTYPE_TO_PRIMITIVE, /* ECMA-262 v6 20.3.4.45 */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
};
|
||||
|
||||
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-date-prototype.inc.h"
|
||||
@@ -184,7 +184,7 @@ ecma_builtin_date_prototype_to_json (ecma_value_t this_arg) /**< this argument *
|
||||
return ret_value;
|
||||
} /* ecma_builtin_date_prototype_to_json */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* The Date.prototype object's toPrimitive routine
|
||||
*
|
||||
@@ -222,7 +222,7 @@ ecma_builtin_date_prototype_to_primitive (ecma_value_t this_arg, /**< this argum
|
||||
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument type in toPrimitive."));
|
||||
} /* ecma_builtin_date_prototype_to_primitive */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* Dispatch get date functions
|
||||
@@ -605,13 +605,13 @@ ecma_builtin_date_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
|
||||
return ecma_builtin_date_prototype_to_json (this_arg);
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (JERRY_UNLIKELY (builtin_routine_id == ECMA_DATE_PROTOTYPE_TO_PRIMITIVE))
|
||||
{
|
||||
ecma_value_t argument = arguments_number > 0 ? arguments_list[0] : ECMA_VALUE_UNDEFINED;
|
||||
return ecma_builtin_date_prototype_to_primitive (this_arg, argument);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
if (!ecma_is_value_object (this_arg)
|
||||
|| !ecma_object_class_is (ecma_get_object_from_value (this_arg), LIT_MAGIC_STRING_DATE_UL))
|
||||
|
||||
@@ -68,9 +68,9 @@ ROUTINE (LIT_MAGIC_STRING_SET_UTC_FULL_YEAR_UL, ECMA_DATE_PROTOTYPE_SET_UTC_FULL
|
||||
ROUTINE (LIT_MAGIC_STRING_TO_UTC_STRING_UL, ECMA_DATE_PROTOTYPE_TO_UTC_STRING, 0, 0)
|
||||
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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ROUTINE_CONFIGURABLE_ONLY (LIT_GLOBAL_SYMBOL_TO_PRIMITIVE, ECMA_DATE_PROTOTYPE_TO_PRIMITIVE, 1, 1)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
|
||||
|
||||
@@ -736,7 +736,7 @@ ecma_builtin_date_dispatch_construct (const ecma_value_t *arguments_list_p, /**<
|
||||
ecma_number_t prim_value_num = ECMA_NUMBER_ZERO;
|
||||
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_DATE_PROTOTYPE);
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (JERRY_CONTEXT (current_new_target))
|
||||
{
|
||||
prototype_obj_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target),
|
||||
@@ -746,7 +746,7 @@ ecma_builtin_date_dispatch_construct (const ecma_value_t *arguments_list_p, /**<
|
||||
return ECMA_VALUE_ERROR;
|
||||
}
|
||||
}
|
||||
#endif /* !(ENABLED (JERRY_ES2015) */
|
||||
#endif /* !(ENABLED (JERRY_ESNEXT) */
|
||||
ecma_object_t *obj_p = ecma_create_object (prototype_obj_p,
|
||||
sizeof (ecma_extended_object_t),
|
||||
ECMA_OBJECT_TYPE_CLASS);
|
||||
@@ -823,12 +823,12 @@ ecma_builtin_date_dispatch_construct (const ecma_value_t *arguments_list_p, /**<
|
||||
JERRY_ASSERT (ECMA_IS_VALUE_ERROR (ret_value));
|
||||
ecma_deref_object (obj_p);
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (JERRY_CONTEXT (current_new_target))
|
||||
{
|
||||
ecma_deref_object (prototype_obj_p);
|
||||
}
|
||||
#endif /* !(ENABLED (JERRY_ES2015) */
|
||||
#endif /* !(ENABLED (JERRY_ESNEXT) */
|
||||
return ret_value;
|
||||
} /* ecma_builtin_date_dispatch_construct */
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@ ROUTINE (LIT_MAGIC_STRING_PARSE, ecma_builtin_date_parse, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_UTC_U, ecma_builtin_date_utc, NON_FIXED, 7)
|
||||
ROUTINE (LIT_MAGIC_STRING_NOW, ecma_builtin_date_now, 0, 0)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
LIT_MAGIC_STRING_DATE_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATE) */
|
||||
|
||||
|
||||
@@ -34,10 +34,10 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
LIT_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -36,11 +36,11 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
LIT_MAGIC_STRING_EVAL_ERROR_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
|
||||
@@ -46,9 +46,9 @@ enum
|
||||
ECMA_FUNCTION_PROTOTYPE_CALL,
|
||||
ECMA_FUNCTION_PROTOTYPE_APPLY,
|
||||
ECMA_FUNCTION_PROTOTYPE_BIND,
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ECMA_FUNCTION_PROTOTYPE_SYMBOL_HAS_INSTANCE,
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
};
|
||||
|
||||
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-function-prototype.inc.h"
|
||||
@@ -211,10 +211,10 @@ ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p , /**
|
||||
/* 4. 11. 18. */
|
||||
ecma_object_t *prototype_obj_p;
|
||||
|
||||
#if !ENABLED (JERRY_ES2015)
|
||||
#if !ENABLED (JERRY_ESNEXT)
|
||||
prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE);
|
||||
#else /* ENABLED (JERRY_ES2015) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#else /* ENABLED (JERRY_ESNEXT) */
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (this_arg_obj_p))
|
||||
{
|
||||
ecma_value_t proto = ecma_proxy_object_get_prototype_of (this_arg_obj_p);
|
||||
@@ -227,7 +227,7 @@ ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p , /**
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
jmem_cpointer_t proto_cp = ecma_op_ordinary_object_get_prototype_of (this_arg_obj_p);
|
||||
if (proto_cp != JMEM_CP_NULL)
|
||||
{
|
||||
@@ -238,10 +238,10 @@ ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p , /**
|
||||
{
|
||||
prototype_obj_p = NULL;
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* !ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
#endif /* !ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_object_t *function_p;
|
||||
ecma_bound_function_t *bound_func_p;
|
||||
@@ -296,7 +296,7 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (prototype_obj_p != NULL)
|
||||
{
|
||||
ecma_deref_object (prototype_obj_p);
|
||||
@@ -309,13 +309,13 @@ ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p , /**
|
||||
len_string,
|
||||
&prop_desc);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_IS_VALUE_ERROR (status))
|
||||
{
|
||||
ecma_deref_object (function_p);
|
||||
return status;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
if (ecma_is_value_true (status))
|
||||
{
|
||||
@@ -371,7 +371,7 @@ ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p , /**
|
||||
NULL);
|
||||
|
||||
name_prop_value_p->value = bound_function_name;
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/*
|
||||
* [[Class]] property is not stored explicitly for objects of ECMA_OBJECT_TYPE_FUNCTION type.
|
||||
@@ -427,12 +427,12 @@ ecma_builtin_function_prototype_dispatch_routine (uint16_t builtin_routine_id, /
|
||||
{
|
||||
if (!ecma_op_is_callable (this_arg))
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (JERRY_UNLIKELY (builtin_routine_id == ECMA_FUNCTION_PROTOTYPE_SYMBOL_HAS_INSTANCE))
|
||||
{
|
||||
return ECMA_VALUE_FALSE;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a function."));
|
||||
}
|
||||
@@ -459,12 +459,12 @@ ecma_builtin_function_prototype_dispatch_routine (uint16_t builtin_routine_id, /
|
||||
{
|
||||
return ecma_builtin_function_prototype_object_bind (func_obj_p, arguments_list_p, arguments_number);
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case ECMA_FUNCTION_PROTOTYPE_SYMBOL_HAS_INSTANCE:
|
||||
{
|
||||
return ecma_op_object_has_instance (func_obj_p, arguments_list_p[0]);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
default:
|
||||
{
|
||||
JERRY_UNREACHABLE ();
|
||||
|
||||
@@ -34,11 +34,11 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
|
||||
0,
|
||||
ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
LIT_MAGIC_STRING__EMPTY,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/* Routine properties:
|
||||
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
|
||||
@@ -47,7 +47,7 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* ECMA-262 v6.0 19.2.3.6 @@hasInstance
|
||||
* the property attributes are: { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
|
||||
@@ -61,6 +61,6 @@ ACCESSOR_BUILTIN_FUNCTION (LIT_MAGIC_STRING_CALLER,
|
||||
ECMA_BUILTIN_ID_TYPE_ERROR_THROWER,
|
||||
ECMA_BUILTIN_ID_TYPE_ERROR_THROWER,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -34,10 +34,10 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
|
||||
1,
|
||||
ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
LIT_MAGIC_STRING_FUNCTION_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include "ecma-globals.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -69,4 +69,4 @@ ecma_builtin_generator_function_dispatch_construct (const ecma_value_t *argument
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/* ECMA-262 v6, 25.2.2 */
|
||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
@@ -36,6 +36,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_GENERATOR,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "opcodes.h"
|
||||
#include "vm-defines.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -247,4 +247,4 @@ ecma_builtin_generator_prototype_object_throw (ecma_value_t this_arg, /**< this
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@@ -40,6 +40,6 @@ ROUTINE (LIT_MAGIC_STRING_NEXT, ecma_builtin_generator_prototype_object_next, 1,
|
||||
ROUTINE (LIT_MAGIC_STRING_RETURN, ecma_builtin_generator_prototype_object_return, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_THROW, ecma_builtin_generator_prototype_object_throw, 1, 1)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include "ecma-globals.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -40,4 +40,4 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/* ECMA-262 v6, 25.3.2.3.1 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
|
||||
@@ -36,6 +36,6 @@ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
|
||||
LIT_MAGIC_STRING_GENERATOR_FUNCTION_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -100,12 +100,12 @@ ecma_builtin_global_object_eval (ecma_value_t x) /**< routine's first argument *
|
||||
parse_opts |= ECMA_PARSE_STRICT_MODE;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (vm_is_direct_eval_form_call ())
|
||||
{
|
||||
parse_opts |= ECMA_GET_LOCAL_PARSE_OPTS ();
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/* steps 2 to 8 */
|
||||
return ecma_op_eval (ecma_get_string_from_value (x), parse_opts);
|
||||
|
||||
@@ -139,12 +139,12 @@ OBJECT_VALUE (LIT_MAGIC_STRING_MATH_UL,
|
||||
ECMA_BUILTIN_ID_MATH,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MATH) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_REFLECT)
|
||||
#if ENABLED (JERRY_BUILTIN_REFLECT)
|
||||
/* ECMA-262 v6, 26.1 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_REFLECT_UL,
|
||||
ECMA_BUILTIN_ID_REFLECT,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_REFLECT) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REFLECT) */
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_JSON)
|
||||
/* ECMA-262 v5, 15.1.5.2 */
|
||||
@@ -153,7 +153,7 @@ OBJECT_VALUE (LIT_MAGIC_STRING_JSON_U,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* ENABLED (JERRY_BUILTIN_JSON) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_ARRAY_BUFFER_UL,
|
||||
ECMA_BUILTIN_ID_ARRAYBUFFER,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
@@ -196,62 +196,62 @@ OBJECT_VALUE (LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL,
|
||||
ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_PROMISE_UL,
|
||||
ECMA_BUILTIN_ID_PROMISE,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
#if ENABLED (JERRY_BUILTIN_MAP)
|
||||
/* ECMA-262 v6, 23.1.1.1 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_MAP_UL,
|
||||
ECMA_BUILTIN_ID_MAP,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
|
||||
#if ENABLED (JERRY_BUILTIN_SET)
|
||||
/* ECMA-262 v6, 23.1.1.1 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_SET_UL,
|
||||
ECMA_BUILTIN_ID_SET,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_SET) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP)
|
||||
#if ENABLED (JERRY_BUILTIN_WEAKMAP)
|
||||
/* ECMA-262 v6, 23.1.1.1 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_WEAKMAP_UL,
|
||||
ECMA_BUILTIN_ID_WEAKMAP,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_SET) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
|
||||
#if ENABLED (JERRY_BUILTIN_WEAKSET)
|
||||
/* ECMA-262 v6, 23.1.1.1 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_WEAKSET_UL,
|
||||
ECMA_BUILTIN_ID_WEAKSET,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_SET) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/* ECMA-262 v6, 19.4.1.1 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_SYMBOL_UL,
|
||||
ECMA_BUILTIN_ID_SYMBOL,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
|
||||
#if ENABLED (JERRY_BUILTIN_DATAVIEW)
|
||||
/* ECMA-262 v6, 23.1.1.1 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_DATAVIEW_UL,
|
||||
ECMA_BUILTIN_ID_DATAVIEW,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATAVIEW */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
/* ECMA-262 v6, 26.2.1 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_PROXY_UL,
|
||||
ECMA_BUILTIN_ID_PROXY,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
/* Routine properties:
|
||||
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
|
||||
@@ -263,14 +263,14 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (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 /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
ROUTINE (LIT_MAGIC_STRING_ESCAPE, ECMA_GLOBAL_ESCAPE, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_UNESCAPE, ECMA_GLOBAL_UNESCAPE, 1, 1)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#define STRING_VALUE(name, magic_string_id, prop_attributes)
|
||||
#endif /* !STRING_VALUE */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#ifndef SYMBOL_VALUE
|
||||
#define SYMBOL_VALUE(symbol, desc_magic_string_id)
|
||||
#endif /* !SYMBOL_VALUE */
|
||||
@@ -37,7 +37,7 @@
|
||||
#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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#ifndef OBJECT_VALUE
|
||||
#define OBJECT_VALUE(name, obj_builtin_id, prop_attributes)
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
#undef SIMPLE_VALUE
|
||||
#undef NUMBER_VALUE
|
||||
#undef STRING_VALUE
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#undef SYMBOL_VALUE
|
||||
#undef INTRINSIC_PROPERTY
|
||||
#undef ACCESSOR_BUILTIN_FUNCTION_OBJECT
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#undef OBJECT_VALUE
|
||||
#undef ROUTINE
|
||||
#undef ROUTINE_CONFIGURABLE_ONLY
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* Helper function for Object.prototype.toString routine when
|
||||
* the @@toStringTag property is present
|
||||
@@ -98,7 +98,7 @@ 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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* Common implementation of the Object.prototype.toString routine
|
||||
@@ -142,7 +142,7 @@ ecma_builtin_helper_object_to_string (const ecma_value_t this_arg) /**< this arg
|
||||
|
||||
type_string = ecma_object_get_class_name (obj_p);
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_value_t tag_value = ecma_op_object_get_by_symbol_id (obj_p, LIT_GLOBAL_SYMBOL_TO_STRING_TAG);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (tag_value))
|
||||
@@ -158,7 +158,7 @@ ecma_builtin_helper_object_to_string (const ecma_value_t this_arg) /**< this arg
|
||||
}
|
||||
|
||||
ecma_free_value (tag_value);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_deref_object (obj_p);
|
||||
}
|
||||
@@ -283,12 +283,12 @@ ecma_builtin_helper_object_get_properties (ecma_object_t *obj_p, /**< object */
|
||||
|
||||
ecma_collection_t *props_p = ecma_op_object_get_property_names (obj_p, opts);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (props_p == NULL)
|
||||
{
|
||||
return ECMA_VALUE_ERROR;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
if (props_p->item_count == 0)
|
||||
{
|
||||
@@ -368,7 +368,7 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array *
|
||||
ecma_value_t value) /**< value to concat */
|
||||
{
|
||||
/* 5.b */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_value_t is_spreadable = ecma_op_is_concat_spreadable (value);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (is_spreadable))
|
||||
@@ -377,15 +377,15 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array *
|
||||
}
|
||||
|
||||
bool spread_object = is_spreadable == ECMA_VALUE_TRUE;
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
bool spread_object = ecma_is_value_true (ecma_is_value_array (value));
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
if (spread_object)
|
||||
{
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (value);
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
uint32_t arg_len;
|
||||
ecma_value_t error = ecma_op_object_get_length (obj_p, &arg_len);
|
||||
|
||||
@@ -393,10 +393,10 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array *
|
||||
{
|
||||
return error;
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
/* 5.b.ii */
|
||||
uint32_t arg_len = ecma_array_get_length (obj_p);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
/* 5.b.iii */
|
||||
for (uint32_t array_index = 0; array_index < arg_len; array_index++)
|
||||
{
|
||||
@@ -519,7 +519,7 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
|
||||
/* 5 (indexOf) -- 6 (lastIndexOf) */
|
||||
const ecma_length_t original_len = ecma_string_get_length (original_str_p);
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/* 4, 6 (startsWith, includes, endsWith) */
|
||||
if (mode >= ECMA_STRING_STARTS_WITH)
|
||||
{
|
||||
@@ -536,7 +536,7 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Search string can't be of type: RegExp"));
|
||||
}
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/* 7, 8 */
|
||||
ecma_string_t *search_str_p = ecma_op_to_string (arg1);
|
||||
@@ -549,18 +549,18 @@ 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;
|
||||
ecma_value_t ret_value;
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (mode > ECMA_STRING_LAST_INDEX_OF)
|
||||
{
|
||||
ret_value = ecma_op_to_integer (arg2, &pos_num);
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
ret_value = ecma_get_number (arg2, &pos_num);
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/* 10 (startsWith, includes), 11 (endsWith) */
|
||||
if (ECMA_IS_VALUE_ERROR (ret_value))
|
||||
@@ -582,7 +582,7 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case ECMA_STRING_STARTS_WITH:
|
||||
{
|
||||
const ecma_length_t search_len = ecma_string_get_length (search_str_p);
|
||||
@@ -635,7 +635,7 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
case ECMA_STRING_INDEX_OF:
|
||||
case ECMA_STRING_LAST_INDEX_OF:
|
||||
@@ -883,7 +883,7 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
|
||||
}
|
||||
case LIT_CHAR_AMPERSAND:
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (JERRY_UNLIKELY (ctx_p->matched_p == NULL))
|
||||
{
|
||||
JERRY_ASSERT (ctx_p->capture_count == 0);
|
||||
@@ -895,7 +895,7 @@ 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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
JERRY_ASSERT (ctx_p->matched_p != NULL);
|
||||
ecma_stringbuilder_append_raw (&(ctx_p->builder), ctx_p->matched_p, ctx_p->matched_size);
|
||||
@@ -908,7 +908,7 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
|
||||
}
|
||||
case LIT_CHAR_SINGLE_QUOTE:
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (JERRY_UNLIKELY (ctx_p->matched_p == NULL))
|
||||
{
|
||||
JERRY_ASSERT (ctx_p->capture_count == 0);
|
||||
@@ -926,7 +926,7 @@ 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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
JERRY_ASSERT (ctx_p->matched_p != NULL);
|
||||
ecma_stringbuilder_append_raw (&(ctx_p->builder),
|
||||
@@ -941,12 +941,12 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (capture_count == 0 && ctx_p->u.collection_p != NULL)
|
||||
{
|
||||
capture_count = ctx_p->u.collection_p->item_count;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
uint8_t idx = (uint8_t) (c - LIT_CHAR_0);
|
||||
if (curr_p < replace_end_p && lit_char_is_decimal_digit (*(curr_p)))
|
||||
@@ -977,7 +977,7 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
|
||||
break;
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
else if (ctx_p->u.collection_p != NULL)
|
||||
{
|
||||
const ecma_value_t capture_value = ctx_p->u.collection_p->buffer_p[idx];
|
||||
@@ -988,7 +988,7 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
|
||||
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,10 +96,10 @@ typedef struct
|
||||
void
|
||||
ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p);
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
bool
|
||||
ecma_builtin_is_regexp_exec (ecma_extended_object_t *obj_p);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_DATE)
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ const ecma_builtin_property_descriptor_t PROPERTY_DESCRIPTOR_LIST_NAME[] =
|
||||
prop_attributes, \
|
||||
magic_string_id \
|
||||
},
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#define SYMBOL_VALUE(symbol, desc_magic_string_id) \
|
||||
{ \
|
||||
symbol, \
|
||||
@@ -211,7 +211,7 @@ const ecma_builtin_property_descriptor_t PROPERTY_DESCRIPTOR_LIST_NAME[] =
|
||||
prop_attributes, \
|
||||
ECMA_ACCESSOR_READ_WRITE (getter_builtin_id, setter_builtin_id) \
|
||||
},
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#include BUILTIN_INC_HEADER_NAME
|
||||
{
|
||||
LIT_MAGIC_STRING__COUNT,
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "ecma-gc.h"
|
||||
#include "lit-char-helpers.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -140,4 +140,4 @@ ecma_builtin_intrinsic_dispatch_routine (uint16_t builtin_routine_id, /**< built
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/* ECMA-262 v6, 19.4.2.2 */
|
||||
SYMBOL_VALUE (LIT_GLOBAL_SYMBOL_HAS_INSTANCE,
|
||||
@@ -69,5 +69,5 @@ SYMBOL_VALUE (LIT_GLOBAL_SYMBOL_UNSCOPABLES,
|
||||
ROUTINE (LIT_MAGIC_STRING_PARSE_FLOAT, ECMA_INTRINSIC_PARSE_FLOAT, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_PARSE_INT, ECMA_INTRINSIC_PARSE_INT, 2, 2)
|
||||
ROUTINE (LIT_INTERNAL_MAGIC_STRING_ARRAY_PROTOTYPE_VALUES, ECMA_INTRINSIC_ARRAY_PROTOTYPE_VALUES, 0, 0)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "ecma-builtins.h"
|
||||
#include "ecma-iterator-object.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -60,4 +60,4 @@ ecma_builtin_iterator_prototype_object_iterator (ecma_value_t this_val) /**< thi
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -900,12 +900,12 @@ ecma_builtin_json_serialize_object (ecma_json_stringify_context_t *context_p, /*
|
||||
{
|
||||
property_keys_p = ecma_op_object_get_property_names (obj_p, ECMA_LIST_ENUMERABLE);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (property_keys_p == NULL)
|
||||
{
|
||||
return ECMA_VALUE_ERROR;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
}
|
||||
|
||||
/* 8. */
|
||||
@@ -1029,7 +1029,7 @@ ecma_builtin_json_serialize_array (ecma_json_stringify_context_t *context_p, /**
|
||||
/* 6. */
|
||||
uint32_t array_length;
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (obj_p))
|
||||
{
|
||||
ecma_value_t length_value = ecma_op_object_get_length (obj_p, &array_length);
|
||||
@@ -1040,7 +1040,7 @@ ecma_builtin_json_serialize_array (ecma_json_stringify_context_t *context_p, /**
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
{
|
||||
array_length = ((ecma_extended_object_t *) obj_p)->u.array.length;
|
||||
}
|
||||
@@ -1278,13 +1278,13 @@ ecma_builtin_json_serialize_property (ecma_json_stringify_context_t *context_p,
|
||||
{
|
||||
ecma_value_t is_array = ecma_is_value_array (value);
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (ECMA_IS_VALUE_ERROR (is_array))
|
||||
{
|
||||
ecma_free_value (value);
|
||||
return is_array;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (value);
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_JSON)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/* Routine properties:
|
||||
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "ecma-builtins.h"
|
||||
#include "ecma-container-object.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
#if ENABLED (JERRY_BUILTIN_MAP)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -60,4 +60,4 @@ ecma_builtin_map_iterator_prototype_object_next (ecma_value_t this_val) /**< thi
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
#if ENABLED (JERRY_BUILTIN_MAP)
|
||||
|
||||
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
|
||||
LIT_MAGIC_STRING_MAP_ITERATOR_UL,
|
||||
@@ -29,6 +29,6 @@ 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_map_iterator_prototype_object_next, 0, 0)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include "ecma-container-object.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
#if ENABLED (JERRY_BUILTIN_MAP)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -147,7 +147,7 @@ ecma_builtin_map_prototype_object_size_getter (ecma_value_t this_arg) /**< this
|
||||
return ecma_op_container_size (this_arg, LIT_MAGIC_STRING_MAP_UL);
|
||||
} /* ecma_builtin_map_prototype_object_size_getter */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/**
|
||||
* The Map.prototype object's 'entries' routine
|
||||
@@ -206,7 +206,7 @@ ecma_builtin_map_prototype_object_values (ecma_value_t this_arg) /**< this argum
|
||||
ECMA_PSEUDO_MAP_ITERATOR);
|
||||
} /* ecma_builtin_map_prototype_object_values */
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
@@ -214,4 +214,4 @@ ecma_builtin_map_prototype_object_values (ecma_value_t this_arg) /**< this argum
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
#if ENABLED (JERRY_BUILTIN_MAP)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@@ -29,12 +29,12 @@ OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
|
||||
ECMA_BUILTIN_ID_MAP,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/* ECMA-262 v6, 23.1.3.13 */
|
||||
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
|
||||
LIT_MAGIC_STRING_MAP_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/* Routine properties:
|
||||
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
|
||||
@@ -44,18 +44,18 @@ ROUTINE (LIT_MAGIC_STRING_FOR_EACH_UL, ecma_builtin_map_prototype_object_foreach
|
||||
ROUTINE (LIT_MAGIC_STRING_GET, ecma_builtin_map_prototype_object_get, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_HAS, ecma_builtin_map_prototype_object_has, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_SET, ecma_builtin_map_prototype_object_set, 2, 2)
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ROUTINE (LIT_MAGIC_STRING_ENTRIES, ecma_builtin_map_prototype_object_entries, 0, 0)
|
||||
ROUTINE (LIT_MAGIC_STRING_VALUES, ecma_builtin_map_prototype_object_values, 0, 0)
|
||||
ROUTINE (LIT_MAGIC_STRING_KEYS, ecma_builtin_map_prototype_object_keys, 0, 0)
|
||||
ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ecma_builtin_map_prototype_object_entries, 0, 0)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/* ECMA-262 v6, 23.1.3.10 */
|
||||
ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_SIZE,
|
||||
ecma_builtin_map_prototype_object_size_getter,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "ecma-exceptions.h"
|
||||
#include "ecma-container-object.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
#if ENABLED (JERRY_BUILTIN_MAP)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -83,4 +83,4 @@ ecma_builtin_map_species_get (ecma_value_t this_value) /**< This Value */
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
#if ENABLED (JERRY_BUILTIN_MAP)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@@ -47,6 +47,6 @@ ACCESSOR_READ_ONLY (LIT_GLOBAL_SYMBOL_SPECIES,
|
||||
ecma_builtin_map_species_get,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -63,7 +63,7 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (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 */
|
||||
@@ -79,17 +79,17 @@ 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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
ECMA_MATH_OBJECT_ATAN2, /* ECMA-262 v5, 15.8.2.5 */ /* first routine with 2 arguments */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ECMA_MATH_OBJECT_IMUL, /* ECMA-262 v6, 20.2.2.19 */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ECMA_MATH_OBJECT_HYPOT, /* ECMA-262 v6, 20.2.2.18 */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
ECMA_MATH_OBJECT_RANDOM, /* ECMA-262 v5, 15.8.2.14 */
|
||||
};
|
||||
|
||||
@@ -183,7 +183,7 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* The Math object's 'hypot' routine
|
||||
*
|
||||
@@ -308,7 +308,7 @@ ecma_builtin_math_object_sign (ecma_number_t arg)
|
||||
return (ecma_number_t) 1.0;
|
||||
} /* ecma_builtin_math_object_sign */
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* The Math object's 'random' routine.
|
||||
@@ -439,7 +439,7 @@ ecma_builtin_math_dispatch_routine (uint16_t builtin_routine_id, /**< built-in w
|
||||
x = DOUBLE_TO_ECMA_NUMBER_T (log (x));
|
||||
break;
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case ECMA_MATH_OBJECT_TRUNC:
|
||||
{
|
||||
x = ecma_builtin_math_object_trunc (x);
|
||||
@@ -450,7 +450,7 @@ ecma_builtin_math_dispatch_routine (uint16_t builtin_routine_id, /**< built-in w
|
||||
x = ecma_builtin_math_object_sign (x);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
case ECMA_MATH_OBJECT_ROUND:
|
||||
{
|
||||
if (ecma_number_is_nan (x)
|
||||
@@ -508,7 +508,7 @@ ecma_builtin_math_dispatch_routine (uint16_t builtin_routine_id, /**< built-in w
|
||||
x = ecma_number_pow (x, y);
|
||||
break;
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case ECMA_MATH_OBJECT_ACOSH:
|
||||
{
|
||||
x = DOUBLE_TO_ECMA_NUMBER_T (acosh (x));
|
||||
@@ -595,7 +595,7 @@ ecma_builtin_math_dispatch_routine (uint16_t builtin_routine_id, /**< built-in w
|
||||
x = (int32_t) (ecma_number_to_uint32 (x) * ecma_number_to_uint32 (y));
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
}
|
||||
return ecma_make_number_value (x);
|
||||
} /* if (builtin_routine_id <= ECMA_MATH_OBJECT_POW) */
|
||||
@@ -607,12 +607,12 @@ ecma_builtin_math_dispatch_routine (uint16_t builtin_routine_id, /**< built-in w
|
||||
arguments_number);
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (builtin_routine_id == ECMA_MATH_OBJECT_HYPOT)
|
||||
{
|
||||
return ecma_builtin_math_object_hypot (arguments_list, arguments_number);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
JERRY_ASSERT (builtin_routine_id == ECMA_MATH_OBJECT_RANDOM);
|
||||
|
||||
|
||||
@@ -64,12 +64,12 @@ NUMBER_VALUE (LIT_MAGIC_STRING_SQRT2_U,
|
||||
ECMA_BUILTIN_NUMBER_SQRT2,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/* Routine properties:
|
||||
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
|
||||
@@ -91,7 +91,7 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (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)
|
||||
@@ -109,7 +109,7 @@ 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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MATH) */
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ ecma_builtin_number_dispatch_construct (const ecma_value_t *arguments_list_p, /*
|
||||
}
|
||||
} /* ecma_builtin_number_dispatch_construct */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/**
|
||||
* The Number object 'isFinite' routine
|
||||
@@ -222,7 +222,7 @@ ecma_builtin_number_object_is_safe_integer (ecma_value_t this_arg, /**< this arg
|
||||
return ECMA_VALUE_FALSE;
|
||||
} /* ecma_builtin_number_object_is_safe_integer */
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -53,7 +53,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_NEGATIVE_INFINITY_U,
|
||||
ECMA_BUILTIN_NUMBER_NEGATIVE_INFINITY,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/* ECMA-262 v6, 20.1.2.1 */
|
||||
NUMBER_VALUE (LIT_MAGIC_STRING_EPSILON_U,
|
||||
@@ -73,7 +73,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_MIN_SAFE_INTEGER_U,
|
||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
LIT_MAGIC_STRING_NUMBER_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@@ -87,12 +87,12 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
|
||||
/* Routine properties:
|
||||
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ROUTINE (LIT_MAGIC_STRING_IS_FINITE, ecma_builtin_number_object_is_finite, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_IS_NAN, ecma_builtin_number_object_is_nan, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_IS_INTEGER, ecma_builtin_number_object_is_integer, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_IS_SAFE_INTEGER, ecma_builtin_number_object_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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -147,7 +147,7 @@ static ecma_value_t
|
||||
ecma_builtin_object_prototype_object_has_own_property (ecma_object_t *obj_p, /**< this argument */
|
||||
ecma_string_t *prop_name_p) /**< first argument */
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (obj_p))
|
||||
{
|
||||
ecma_property_descriptor_t prop_desc;
|
||||
@@ -161,7 +161,7 @@ ecma_builtin_object_prototype_object_has_own_property (ecma_object_t *obj_p, /**
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
return ecma_make_boolean_value (ecma_op_ordinary_object_has_own_property (obj_p, prop_name_p));
|
||||
} /* ecma_builtin_object_prototype_object_has_own_property */
|
||||
@@ -280,12 +280,12 @@ ecma_builtin_object_prototype_dispatch_routine (uint16_t builtin_routine_id, /**
|
||||
ret_value = ecma_builtin_object_prototype_object_is_prototype_of (obj_p, arguments_list_p[0]);
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
else if (builtin_routine_id == ECMA_OBJECT_PROTOTYPE_GET_PROTO)
|
||||
{
|
||||
ret_value = ecma_builtin_object_object_get_prototype_of (obj_p);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015)*/
|
||||
#endif /* ENABLED (JERRY_ESNEXT)*/
|
||||
|
||||
else
|
||||
{
|
||||
@@ -299,12 +299,12 @@ ecma_builtin_object_prototype_dispatch_routine (uint16_t builtin_routine_id, /**
|
||||
|
||||
JERRY_ASSERT (builtin_routine_id >= ECMA_OBJECT_PROTOTYPE_HAS_OWN_PROPERTY);
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (builtin_routine_id == ECMA_OBJECT_PROTOTYPE_SET_PROTO)
|
||||
{
|
||||
return ecma_builtin_object_object_set_proto (this_arg, arguments_list_p[0]);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015)*/
|
||||
#endif /* ENABLED (JERRY_ESNEXT)*/
|
||||
|
||||
ecma_string_t *prop_name_p = ecma_op_to_prop_name (arguments_list_p[0]);
|
||||
|
||||
|
||||
@@ -137,12 +137,12 @@ ecma_builtin_object_dispatch_construct (const ecma_value_t *arguments_list_p, /*
|
||||
ecma_value_t
|
||||
ecma_builtin_object_object_get_prototype_of (ecma_object_t *obj_p) /**< routine's argument */
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (obj_p))
|
||||
{
|
||||
return ecma_proxy_object_get_prototype_of (obj_p);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
jmem_cpointer_t proto_cp = ecma_op_ordinary_object_get_prototype_of (obj_p);
|
||||
|
||||
@@ -156,7 +156,7 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* The Object object's 'setPrototypeOf' routine
|
||||
*
|
||||
@@ -192,7 +192,7 @@ ecma_builtin_object_object_set_prototype_of (ecma_value_t arg1, /**< routine's f
|
||||
ecma_value_t status;
|
||||
|
||||
/* 5. */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (obj_p))
|
||||
{
|
||||
status = ecma_proxy_object_set_prototype_of (obj_p, arg2);
|
||||
@@ -204,11 +204,11 @@ ecma_builtin_object_object_set_prototype_of (ecma_value_t arg1, /**< routine's f
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
status = ecma_op_ordinary_object_set_prototype_of (obj_p, arg2);
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
if (ecma_is_value_false (status))
|
||||
{
|
||||
@@ -256,7 +256,7 @@ ecma_builtin_object_object_set_proto (ecma_value_t arg1, /**< routine's first ar
|
||||
ecma_value_t status;
|
||||
|
||||
/* 5. */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (obj_p))
|
||||
{
|
||||
status = ecma_proxy_object_set_prototype_of (obj_p, arg2);
|
||||
@@ -268,11 +268,11 @@ ecma_builtin_object_object_set_proto (ecma_value_t arg1, /**< routine's first ar
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
status = ecma_op_ordinary_object_set_prototype_of (obj_p, arg2);
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
if (ecma_is_value_false (status))
|
||||
{
|
||||
@@ -283,7 +283,7 @@ 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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* The Object object's 'getOwnPropertyNames' routine
|
||||
@@ -300,7 +300,7 @@ ecma_builtin_object_object_get_own_property_names (ecma_object_t *obj_p) /**< ro
|
||||
return ecma_builtin_helper_object_get_properties (obj_p, ECMA_LIST_NO_OPTS);
|
||||
} /* ecma_builtin_object_object_get_own_property_names */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/**
|
||||
* The Object object's 'getOwnPropertySymbols' routine
|
||||
@@ -317,7 +317,7 @@ ecma_builtin_object_object_get_own_property_symbols (ecma_object_t *obj_p) /**<
|
||||
return ecma_builtin_helper_object_get_properties (obj_p, ECMA_LIST_SYMBOLS_ONLY);
|
||||
} /* ecma_builtin_object_object_get_own_property_symbols */
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* SetIntegrityLevel operation
|
||||
@@ -334,7 +334,7 @@ ecma_builtin_object_set_integrity_level (ecma_object_t *obj_p, /**< object */
|
||||
* false - set "frozen" */
|
||||
{
|
||||
/* 3. */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (obj_p))
|
||||
{
|
||||
ecma_value_t status = ecma_proxy_object_prevent_extensions (obj_p);
|
||||
@@ -346,26 +346,26 @@ ecma_builtin_object_set_integrity_level (ecma_object_t *obj_p, /**< object */
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
ecma_op_ordinary_object_prevent_extensions (obj_p);
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
/* 6. */
|
||||
uint32_t opts = ECMA_LIST_CONVERT_FAST_ARRAYS;
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
opts |= ECMA_LIST_SYMBOLS;
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_collection_t *props_p = ecma_op_object_get_property_names (obj_p, opts);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (props_p == NULL)
|
||||
{
|
||||
return ECMA_VALUE_ERROR;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
ecma_value_t *buffer_p = props_p->buffer_p;
|
||||
|
||||
@@ -379,12 +379,12 @@ ecma_builtin_object_set_integrity_level (ecma_object_t *obj_p, /**< object */
|
||||
ecma_property_descriptor_t prop_desc;
|
||||
ecma_value_t status = ecma_op_object_get_own_property_descriptor (obj_p, property_name_p, &prop_desc);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_IS_VALUE_ERROR (status))
|
||||
{
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
if (ecma_is_value_false (status))
|
||||
{
|
||||
@@ -422,12 +422,12 @@ ecma_builtin_object_set_integrity_level (ecma_object_t *obj_p, /**< object */
|
||||
ecma_property_descriptor_t prop_desc;
|
||||
ecma_value_t status = ecma_op_object_get_own_property_descriptor (obj_p, property_name_p, &prop_desc);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_IS_VALUE_ERROR (status))
|
||||
{
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
if (ecma_is_value_false (status))
|
||||
{
|
||||
@@ -487,12 +487,12 @@ ecma_builtin_object_object_seal (ecma_object_t *obj_p) /**< routine's argument *
|
||||
return status;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ecma_is_value_false (status))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Object cannot be sealed."));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
/* 4. */
|
||||
ecma_ref_object (obj_p);
|
||||
@@ -518,12 +518,12 @@ ecma_builtin_object_object_freeze (ecma_object_t *obj_p) /**< routine's argument
|
||||
return status;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ecma_is_value_false (status))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Object cannot be frozen."));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
/* 4. */
|
||||
ecma_ref_object (obj_p);
|
||||
@@ -542,7 +542,7 @@ ecma_builtin_object_object_freeze (ecma_object_t *obj_p) /**< routine's argument
|
||||
ecma_value_t
|
||||
ecma_builtin_object_object_prevent_extensions (ecma_object_t *obj_p) /**< routine's argument */
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (obj_p))
|
||||
{
|
||||
ecma_value_t status = ecma_proxy_object_prevent_extensions (obj_p);
|
||||
@@ -561,11 +561,11 @@ ecma_builtin_object_object_prevent_extensions (ecma_object_t *obj_p) /**< routin
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
ecma_op_ordinary_object_prevent_extensions (obj_p);
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
ecma_ref_object (obj_p);
|
||||
|
||||
return ecma_make_object_value (obj_p);
|
||||
@@ -589,7 +589,7 @@ ecma_builtin_object_test_integrity_level (ecma_object_t *obj_p, /**< routine's a
|
||||
|
||||
/* 3. */
|
||||
bool is_extensible;
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (obj_p))
|
||||
{
|
||||
ecma_value_t status = ecma_proxy_object_is_extensible (obj_p);
|
||||
@@ -603,11 +603,11 @@ ecma_builtin_object_test_integrity_level (ecma_object_t *obj_p, /**< routine's a
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
is_extensible = ecma_op_ordinary_object_is_extensible (obj_p);
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
if (is_extensible)
|
||||
{
|
||||
@@ -620,12 +620,12 @@ ecma_builtin_object_test_integrity_level (ecma_object_t *obj_p, /**< routine's a
|
||||
/* 2. */
|
||||
ecma_collection_t *props_p = ecma_op_object_get_property_names (obj_p, ECMA_LIST_NO_OPTS);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (props_p == NULL)
|
||||
{
|
||||
return ECMA_VALUE_ERROR;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
ecma_value_t *buffer_p = props_p->buffer_p;
|
||||
|
||||
@@ -637,13 +637,13 @@ ecma_builtin_object_test_integrity_level (ecma_object_t *obj_p, /**< routine's a
|
||||
ecma_property_descriptor_t prop_desc;
|
||||
ecma_value_t status = ecma_op_object_get_own_property_descriptor (obj_p, property_name_p, &prop_desc);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_IS_VALUE_ERROR (status))
|
||||
{
|
||||
ret_value = status;
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
if (ecma_is_value_false (status))
|
||||
{
|
||||
@@ -683,12 +683,12 @@ ecma_builtin_object_test_integrity_level (ecma_object_t *obj_p, /**< routine's a
|
||||
ecma_value_t
|
||||
ecma_builtin_object_object_is_extensible (ecma_object_t *obj_p) /**< routine's argument */
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (obj_p))
|
||||
{
|
||||
return ecma_proxy_object_is_extensible (obj_p);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
return ecma_make_boolean_value (ecma_op_ordinary_object_is_extensible (obj_p));
|
||||
} /* ecma_builtin_object_object_is_extensible */
|
||||
@@ -726,12 +726,12 @@ ecma_builtin_object_object_get_own_property_descriptor (ecma_object_t *obj_p, /*
|
||||
|
||||
ecma_value_t status = ecma_op_object_get_own_property_descriptor (obj_p, name_str_p, &prop_desc);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_IS_VALUE_ERROR (status))
|
||||
{
|
||||
return status;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
if (ecma_is_value_true (status))
|
||||
{
|
||||
@@ -773,13 +773,13 @@ ecma_builtin_object_object_define_properties (ecma_object_t *obj_p, /**< routine
|
||||
| ECMA_LIST_ENUMERABLE);
|
||||
ecma_value_t ret_value = ECMA_VALUE_ERROR;
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (prop_names_p == NULL)
|
||||
{
|
||||
ecma_deref_object (props_p);
|
||||
return ret_value;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
ecma_value_t *buffer_p = prop_names_p->buffer_p;
|
||||
|
||||
@@ -941,7 +941,7 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/**
|
||||
* The Object object's 'assign' routine
|
||||
@@ -981,13 +981,13 @@ ecma_builtin_object_object_assign (ecma_object_t *target_p, /**< target object *
|
||||
ecma_collection_t *props_p = ecma_op_object_get_property_names (from_obj_p, ECMA_LIST_CONVERT_FAST_ARRAYS
|
||||
| ECMA_LIST_ENUMERABLE
|
||||
| ECMA_LIST_SYMBOLS);
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (props_p == NULL)
|
||||
{
|
||||
ecma_deref_object (from_obj_p);
|
||||
return ECMA_VALUE_ERROR;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
ecma_value_t *buffer_p = props_p->buffer_p;
|
||||
|
||||
@@ -999,13 +999,13 @@ ecma_builtin_object_object_assign (ecma_object_t *target_p, /**< target object *
|
||||
ecma_property_descriptor_t prop_desc;
|
||||
ecma_value_t desc_status = ecma_op_object_get_own_property_descriptor (from_obj_p, property_name_p, &prop_desc);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_IS_VALUE_ERROR (desc_status))
|
||||
{
|
||||
ret_value = desc_status;
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
if (ecma_is_value_false (desc_status))
|
||||
{
|
||||
@@ -1072,7 +1072,7 @@ ecma_builtin_object_object_is (ecma_value_t arg1, /**< routine's first argument
|
||||
return ecma_op_same_value (arg1, arg2) ? ECMA_VALUE_TRUE : ECMA_VALUE_FALSE;
|
||||
} /* ecma_builtin_object_object_is */
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* Dispatcher of the built-in's routines
|
||||
@@ -1102,7 +1102,7 @@ ecma_builtin_object_dispatch_routine (uint16_t builtin_routine_id, /**< built-in
|
||||
{
|
||||
return ecma_builtin_object_object_create (arg1, arg2);
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case ECMA_OBJECT_ROUTINE_SET_PROTOTYPE_OF:
|
||||
{
|
||||
return ecma_builtin_object_object_set_prototype_of (arg1, arg2);
|
||||
@@ -1111,7 +1111,7 @@ ecma_builtin_object_dispatch_routine (uint16_t builtin_routine_id, /**< built-in
|
||||
{
|
||||
return ecma_builtin_object_object_is (arg1, arg2);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
default:
|
||||
{
|
||||
break;
|
||||
@@ -1119,21 +1119,21 @@ ecma_builtin_object_dispatch_routine (uint16_t builtin_routine_id, /**< built-in
|
||||
}
|
||||
|
||||
ecma_object_t *obj_p;
|
||||
#if !ENABLED (JERRY_ES2015)
|
||||
#if !ENABLED (JERRY_ESNEXT)
|
||||
if (!ecma_is_value_object (arg1))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
|
||||
}
|
||||
#endif /* !ENABLED (JERRY_ES2015) */
|
||||
#endif /* !ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
if (builtin_routine_id <= ECMA_OBJECT_ROUTINE_DEFINE_PROPERTIES)
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (!ecma_is_value_object (arg1))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
obj_p = ecma_get_object_from_value (arg1);
|
||||
|
||||
@@ -1157,7 +1157,7 @@ ecma_builtin_object_dispatch_routine (uint16_t builtin_routine_id, /**< built-in
|
||||
}
|
||||
else if (builtin_routine_id <= ECMA_OBJECT_ROUTINE_KEYS)
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_value_t object = ecma_op_to_object (arg1);
|
||||
if (ECMA_IS_VALUE_ERROR (object))
|
||||
{
|
||||
@@ -1165,9 +1165,9 @@ ecma_builtin_object_dispatch_routine (uint16_t builtin_routine_id, /**< built-in
|
||||
}
|
||||
|
||||
obj_p = ecma_get_object_from_value (object);
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
obj_p = ecma_get_object_from_value (arg1);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_value_t result;
|
||||
switch (builtin_routine_id)
|
||||
@@ -1182,7 +1182,7 @@ ecma_builtin_object_dispatch_routine (uint16_t builtin_routine_id, /**< built-in
|
||||
result = ecma_builtin_object_object_get_own_property_names (obj_p);
|
||||
break;
|
||||
}
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
case ECMA_OBJECT_ROUTINE_ASSIGN:
|
||||
{
|
||||
result = ecma_builtin_object_object_assign (obj_p, arguments_list_p + 1, arguments_number - 1);
|
||||
@@ -1193,7 +1193,7 @@ ecma_builtin_object_dispatch_routine (uint16_t builtin_routine_id, /**< built-in
|
||||
result = ecma_builtin_object_object_get_own_property_symbols (obj_p);
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
case ECMA_OBJECT_ROUTINE_KEYS:
|
||||
{
|
||||
result = ecma_builtin_object_object_keys (obj_p);
|
||||
@@ -1219,19 +1219,19 @@ ecma_builtin_object_dispatch_routine (uint16_t builtin_routine_id, /**< built-in
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_deref_object (obj_p);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
return result;
|
||||
}
|
||||
else if (builtin_routine_id <= ECMA_OBJECT_ROUTINE_SEAL)
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (!ecma_is_value_object (arg1))
|
||||
{
|
||||
return ecma_copy_value (arg1);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
obj_p = ecma_get_object_from_value (arg1);
|
||||
switch (builtin_routine_id)
|
||||
@@ -1257,12 +1257,12 @@ ecma_builtin_object_dispatch_routine (uint16_t builtin_routine_id, /**< built-in
|
||||
else
|
||||
{
|
||||
JERRY_ASSERT (builtin_routine_id <= ECMA_OBJECT_ROUTINE_IS_SEALED);
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (!ecma_is_value_object (arg1))
|
||||
{
|
||||
return ecma_make_boolean_value (builtin_routine_id != ECMA_OBJECT_ROUTINE_IS_EXTENSIBLE);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
obj_p = ecma_get_object_from_value (arg1);
|
||||
switch (builtin_routine_id)
|
||||
|
||||
@@ -34,19 +34,19 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
LIT_MAGIC_STRING_OBJECT_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_SYMBOLS_UL, ECMA_OBJECT_ROUTINE_GET_OWN_PROPERTY_SYMBOLS, 1, 1)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (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)
|
||||
@@ -59,10 +59,10 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "ecma-globals.h"
|
||||
#include "ecma-promise-object.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -76,4 +76,4 @@ ecma_builtin_promise_prototype_catch (ecma_value_t this_arg, /**< this argument
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@@ -24,16 +24,16 @@ OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
|
||||
ECMA_BUILTIN_ID_PROMISE,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/* ECMA-262 v6, 25.4.5.4 */
|
||||
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
|
||||
LIT_MAGIC_STRING_PROMISE_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ROUTINE (LIT_MAGIC_STRING_THEN, ecma_builtin_promise_prototype_then, 2, 2)
|
||||
ROUTINE (LIT_MAGIC_STRING_CATCH, ecma_builtin_promise_prototype_catch, 1, 1)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "ecma-promise-object.h"
|
||||
#include "jcontext.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -654,4 +654,4 @@ ecma_builtin_promise_species_get (ecma_value_t this_value) /**< This Value */
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#if ENABLED (JERRY_BUILTIN_PROMISE)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@@ -51,6 +51,6 @@ ACCESSOR_READ_ONLY (LIT_GLOBAL_SYMBOL_SPECIES,
|
||||
ecma_builtin_promise_species_get,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "ecma-proxy-object.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -117,4 +117,4 @@ ecma_builtin_proxy_dispatch_construct (const ecma_value_t *arguments_list_p, /**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@@ -37,6 +37,6 @@ STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
|
||||
ROUTINE (LIT_MAGIC_STRING_REVOCABLE, ecma_builtin_proxy_object_revocable, 2, 2)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -36,11 +36,11 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
LIT_MAGIC_STRING_RANGE_ERROR_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
|
||||
@@ -36,11 +36,11 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
LIT_MAGIC_STRING_REFERENCE_ERROR_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "ecma-proxy-object.h"
|
||||
#include "jcontext.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_REFLECT)
|
||||
#if ENABLED (JERRY_BUILTIN_REFLECT)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -236,13 +236,13 @@ ecma_builtin_reflect_dispatch_routine (uint16_t builtin_routine_id, /**< built-i
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (arguments_list[0]);
|
||||
ecma_value_t status;
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (obj_p))
|
||||
{
|
||||
status = ecma_proxy_object_set_prototype_of (obj_p, arguments_list[1]);
|
||||
}
|
||||
else
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
{
|
||||
status = ecma_op_ordinary_object_set_prototype_of (obj_p, arguments_list[1]);
|
||||
}
|
||||
@@ -318,12 +318,12 @@ ecma_builtin_reflect_dispatch_routine (uint16_t builtin_routine_id, /**< built-i
|
||||
JERRY_ASSERT (builtin_routine_id == ECMA_REFLECT_OBJECT_PREVENT_EXTENSIONS);
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (arguments_list[0]);
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (obj_p))
|
||||
{
|
||||
return ecma_proxy_object_prevent_extensions (obj_p);
|
||||
}
|
||||
#endif /* !ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
|
||||
#endif /* !ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
ecma_op_ordinary_object_prevent_extensions (obj_p);
|
||||
|
||||
@@ -338,4 +338,4 @@ ecma_builtin_reflect_dispatch_routine (uint16_t builtin_routine_id, /**< built-i
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_REFLECT) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REFLECT) */
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_REFLECT)
|
||||
#if ENABLED (JERRY_BUILTIN_REFLECT)
|
||||
|
||||
/* Routine properties:
|
||||
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
|
||||
@@ -33,6 +33,6 @@ ROUTINE (LIT_MAGIC_STRING_IS_EXTENSIBLE, ECMA_REFLECT_OBJECT_IS_EXTENSIBLE, 1, 1
|
||||
ROUTINE (LIT_MAGIC_STRING_PREVENT_EXTENSIONS_UL, ECMA_REFLECT_OBJECT_PREVENT_EXTENSIONS, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_SET_PROTOTYPE_OF_UL, ECMA_REFLECT_OBJECT_SET_PROTOTYPE_OF, 2, 2)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_REFLECT) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REFLECT) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* Helper function to retrieve the flags associated with a RegExp object
|
||||
*
|
||||
@@ -352,7 +352,7 @@ ecma_builtin_regexp_prototype_get_unicode (ecma_value_t this_arg) /**< this argu
|
||||
|
||||
return ecma_make_boolean_value (flags & RE_FLAG_UNICODE);
|
||||
} /* ecma_builtin_regexp_prototype_get_unicode */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
|
||||
@@ -373,9 +373,9 @@ ecma_builtin_regexp_prototype_compile (ecma_value_t this_arg, /**< this argument
|
||||
ecma_value_t flags_arg) /**< flags */
|
||||
{
|
||||
if (!ecma_object_is_regexp_object (this_arg)
|
||||
#if !ENABLED (JERRY_ES2015)
|
||||
#if !ENABLED (JERRY_ESNEXT)
|
||||
|| ecma_get_object_from_value (this_arg) == ecma_builtin_get (ECMA_BUILTIN_ID_REGEXP_PROTOTYPE)
|
||||
#endif /* !ENABLED (JERRY_ES2015) */
|
||||
#endif /* !ENABLED (JERRY_ESNEXT) */
|
||||
)
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not a RegExp object"));
|
||||
@@ -481,7 +481,7 @@ static ecma_value_t
|
||||
ecma_builtin_regexp_prototype_test (ecma_value_t this_arg, /**< this argument */
|
||||
ecma_value_t arg) /**< routine's argument */
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (!ecma_is_value_object (this_arg))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("'this' value is not an object"));
|
||||
@@ -502,14 +502,14 @@ ecma_builtin_regexp_prototype_test (ecma_value_t this_arg, /**< this argument */
|
||||
{
|
||||
return result;
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
ecma_value_t result = ecma_builtin_regexp_prototype_exec (this_arg, arg);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (result))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_value_t ret_value = ecma_make_boolean_value (!ecma_is_value_null (result));
|
||||
ecma_free_value (result);
|
||||
@@ -529,7 +529,7 @@ ecma_builtin_regexp_prototype_test (ecma_value_t this_arg, /**< this argument */
|
||||
static ecma_value_t
|
||||
ecma_builtin_regexp_prototype_to_string (ecma_value_t this_arg) /**< this argument */
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (!ecma_is_value_object (this_arg))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("'this' value is not an object."));
|
||||
@@ -577,7 +577,7 @@ ecma_builtin_regexp_prototype_to_string (ecma_value_t this_arg) /**< this argume
|
||||
ecma_deref_ecma_string (flags_p);
|
||||
|
||||
return ecma_make_string_value (ecma_stringbuilder_finalize (&builder));
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
if (!ecma_object_is_regexp_object (this_arg))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("'this' value is not a RegExp object."));
|
||||
@@ -613,10 +613,10 @@ ecma_builtin_regexp_prototype_to_string (ecma_value_t this_arg) /**< this argume
|
||||
}
|
||||
|
||||
return ecma_make_string_value (ecma_stringbuilder_finalize (&result));
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
} /* ecma_builtin_regexp_prototype_to_string */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* Helper function to determine if method is the builtin exec method
|
||||
*
|
||||
@@ -695,7 +695,7 @@ ecma_builtin_regexp_prototype_symbol_match (ecma_value_t this_arg, /**< this arg
|
||||
{
|
||||
return ecma_regexp_match_helper (this_arg, string_arg);
|
||||
} /* ecma_builtin_regexp_prototype_symbol_match */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -26,7 +26,7 @@ OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
|
||||
ECMA_BUILTIN_ID_REGEXP,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_FLAGS,
|
||||
ecma_builtin_regexp_prototype_get_flags,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
@@ -59,7 +59,7 @@ ROUTINE (LIT_GLOBAL_SYMBOL_REPLACE, ecma_builtin_regexp_prototype_symbol_replace
|
||||
ROUTINE (LIT_GLOBAL_SYMBOL_SEARCH, ecma_builtin_regexp_prototype_symbol_search, 1, 1)
|
||||
ROUTINE (LIT_GLOBAL_SYMBOL_SPLIT, ecma_builtin_regexp_prototype_symbol_split, 2, 2)
|
||||
ROUTINE (LIT_GLOBAL_SYMBOL_MATCH, ecma_builtin_regexp_prototype_symbol_match, 1, 1)
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
/* ECMA-262 v5, 15.10.7.1 */
|
||||
STRING_VALUE (LIT_MAGIC_STRING_SOURCE,
|
||||
LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP,
|
||||
@@ -84,7 +84,7 @@ SIMPLE_VALUE (LIT_MAGIC_STRING_MULTILINE,
|
||||
NUMBER_VALUE (LIT_MAGIC_STRING_LASTINDEX_UL,
|
||||
0,
|
||||
ECMA_PROPERTY_FLAG_WRITABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
ROUTINE (LIT_MAGIC_STRING_COMPILE, ecma_builtin_regexp_prototype_compile, 2, 1)
|
||||
|
||||
@@ -49,13 +49,13 @@ 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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
bool create_regexp_from_bc = false;
|
||||
bool free_arguments = false;
|
||||
ecma_object_t *new_target_p = JERRY_CONTEXT (current_new_target);
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
ecma_object_t *new_target_p = NULL;
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
if (arguments_list_len > 0)
|
||||
{
|
||||
@@ -68,7 +68,7 @@ ecma_builtin_regexp_dispatch_helper (const ecma_value_t *arguments_list_p, /**<
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_value_t regexp_value = ecma_op_is_regexp (pattern_value);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (regexp_value))
|
||||
@@ -145,7 +145,7 @@ ecma_builtin_regexp_dispatch_helper (const ecma_value_t *arguments_list_p, /**<
|
||||
|
||||
free_arguments = true;
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ES2015) */
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
if (ecma_object_is_regexp_object (pattern_value))
|
||||
{
|
||||
if (ecma_is_value_undefined (flags_value))
|
||||
@@ -155,21 +155,21 @@ ecma_builtin_regexp_dispatch_helper (const ecma_value_t *arguments_list_p, /**<
|
||||
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument of RegExp call."));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (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 ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (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 /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
{
|
||||
ret_value = ecma_op_create_regexp_from_pattern (new_target_obj_p, pattern_value, flags_value);
|
||||
|
||||
@@ -180,13 +180,13 @@ ecma_builtin_regexp_dispatch_helper (const ecma_value_t *arguments_list_p, /**<
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (free_arguments)
|
||||
{
|
||||
ecma_free_value (pattern_value);
|
||||
ecma_free_value (flags_value);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
return ret_value;
|
||||
} /* ecma_builtin_regexp_dispatch_helper */
|
||||
@@ -219,7 +219,7 @@ ecma_builtin_regexp_dispatch_construct (const ecma_value_t *arguments_list_p, /*
|
||||
arguments_list_len);
|
||||
} /* ecma_builtin_regexp_dispatch_construct */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* 21.2.4.2 get RegExp [ @@species ] accessor
|
||||
*
|
||||
@@ -231,7 +231,7 @@ ecma_builtin_regexp_species_get (ecma_value_t this_value) /**< This Value */
|
||||
{
|
||||
return ecma_copy_value (this_value);
|
||||
} /* ecma_builtin_regexp_species_get */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -30,7 +30,7 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_REGEXP_PROTOTYPE,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
LIT_MAGIC_STRING_REGEXP_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
@@ -39,7 +39,7 @@ STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
ACCESSOR_READ_ONLY (LIT_GLOBAL_SYMBOL_SPECIES,
|
||||
ecma_builtin_regexp_species_get,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "ecma-builtins.h"
|
||||
#include "ecma-container-object.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
|
||||
#if ENABLED (JERRY_BUILTIN_SET)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -60,4 +60,4 @@ ecma_builtin_set_iterator_prototype_object_next (ecma_value_t this_val) /**< thi
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_SET) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
|
||||
#if ENABLED (JERRY_BUILTIN_SET)
|
||||
|
||||
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
|
||||
LIT_MAGIC_STRING_SET_ITERATOR_UL,
|
||||
@@ -29,6 +29,6 @@ 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_set_iterator_prototype_object_next, 0, 0)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_SET) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include "ecma-container-object.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
|
||||
#if ENABLED (JERRY_BUILTIN_SET)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -130,7 +130,7 @@ ecma_builtin_set_prototype_object_size_getter (ecma_value_t this_arg) /**< this
|
||||
return ecma_op_container_size (this_arg, LIT_MAGIC_STRING_SET_UL);
|
||||
} /* ecma_builtin_set_prototype_object_size_getter */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
/**
|
||||
* The Set.prototype object's 'entries' routine
|
||||
@@ -189,7 +189,7 @@ ecma_builtin_set_prototype_object_values (ecma_value_t this_arg) /**< this argum
|
||||
ECMA_PSEUDO_SET_ITERATOR);
|
||||
} /* ecma_builtin_set_prototype_object_values */
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
@@ -197,4 +197,4 @@ ecma_builtin_set_prototype_object_values (ecma_value_t this_arg) /**< this argum
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_SET) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
|
||||
#if ENABLED (JERRY_BUILTIN_SET)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@@ -29,12 +29,12 @@ OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
|
||||
ECMA_BUILTIN_ID_SET,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/* ECMA-262 v6, 23.1.3.13 */
|
||||
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
|
||||
LIT_MAGIC_STRING_SET_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/* Routine properties:
|
||||
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
|
||||
@@ -43,17 +43,17 @@ ROUTINE (LIT_MAGIC_STRING_CLEAR, ecma_builtin_set_prototype_object_clear, 0, 0)
|
||||
ROUTINE (LIT_MAGIC_STRING_DELETE, ecma_builtin_set_prototype_object_delete, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_FOR_EACH_UL, ecma_builtin_set_prototype_object_foreach, 2, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_HAS, ecma_builtin_set_prototype_object_has, 1, 1)
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ROUTINE (LIT_MAGIC_STRING_ENTRIES, ecma_builtin_set_prototype_object_entries, 0, 0)
|
||||
ROUTINE (LIT_MAGIC_STRING_VALUES, ecma_builtin_set_prototype_object_values, 0, 0)
|
||||
ROUTINE (LIT_MAGIC_STRING_KEYS, ecma_builtin_set_prototype_object_keys, 0, 0)
|
||||
ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ecma_builtin_set_prototype_object_values, 0, 0)
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_SIZE,
|
||||
ecma_builtin_set_prototype_object_size_getter,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_SET) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "ecma-exceptions.h"
|
||||
#include "ecma-container-object.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
|
||||
#if ENABLED (JERRY_BUILTIN_SET)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -83,4 +83,4 @@ ecma_builtin_set_species_get (ecma_value_t this_value) /**< This Value */
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_SET) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
|
||||
#if ENABLED (JERRY_BUILTIN_SET)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@@ -47,6 +47,6 @@ ACCESSOR_READ_ONLY (LIT_GLOBAL_SYMBOL_SPECIES,
|
||||
ecma_builtin_set_species_get,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_SET) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "ecma-builtins.h"
|
||||
#include "ecma-iterator-object.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -144,4 +144,4 @@ ecma_builtin_string_iterator_prototype_object_next (ecma_value_t this_val) /**<
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
|
||||
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
|
||||
LIT_MAGIC_STRING_STRING_ITERATOR_UL,
|
||||
@@ -29,6 +29,6 @@ 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_string_iterator_prototype_object_next, 0, 0)
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user