mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Rework usages/naming of configuration macros [part 1] (#2793)
There are quite a few configuration macros in the project. As discussed in the #2520 issue there are a few awkward constructs. Main changes: * Renamed all CONFIG_DISABLE_<name>_BUILTIN macro to JERRY_BUILTIN_<name> format. * The special JERRY_BUILTINS macro specifies the basic config for all es5.1 builtins. * Renamed all CONFIG_DISABLE_ES2015_<name> to JERRY_ES2015_<name> format. * The special JERRY_ES2015 macro specifies the basic config for all es2015 builtins. * Renamed UNICODE_CASE_CONVERSION to JERRY_UNICODE_CASE_CONVERSION. * Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE. * All options (in this change) can have a value of 0 or 1. * Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE. JERRY_REGEXP_STRICT_MODE is set to 0 by default. * Reworked CONFIG_ECMA_NUMBER_TYPE macro to JERRY_NUMBER_TYPE_FLOAT64 name and now it uses the value 1 for 64 bit floating point numbers and 0 for 32 bit floating point number. By default the 64-bit floating point number mode is enabled. * All new JERRY_ defines can be used wit the `#if ENABLED (JERRY_...)` construct to test if the feature is enabled or not. * Added/replaced a few config.h includes to correctly propagate the macro values. * Added sanity checks for each macro to avoid incorrectly set values. * Updated profile documentation. * The CMake feature names are not updated at this point. JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This commit is contained in:
parent
722d092528
commit
40f7b1c27f
@ -6,7 +6,7 @@ dist: trusty
|
||||
|
||||
# Default job task: run tests as defined in the $OPT environment variable.
|
||||
# Jobs can redefine the 'script' stage in the matrix below.
|
||||
script: travis_wait 20 tools/run-tests.py $OPTS
|
||||
script: tools/run-tests.py $OPTS
|
||||
|
||||
# All the job definitions in the matrix.
|
||||
matrix:
|
||||
@ -15,7 +15,7 @@ matrix:
|
||||
install: pip install --user pylint==1.6.5
|
||||
script:
|
||||
- tools/run-tests.py --check-signed-off=travis --check-doxygen --check-vera --check-license --check-magic-strings --check-pylint
|
||||
- travis_wait 30 tools/run-tests.py --check-cppcheck
|
||||
- travis_wait 40 tools/run-tests.py --check-cppcheck
|
||||
addons:
|
||||
apt:
|
||||
packages: [doxygen, cppcheck, vera++]
|
||||
|
||||
@ -279,7 +279,7 @@ endif()
|
||||
|
||||
# RegExp strict mode
|
||||
if(FEATURE_REGEXP_STRICT_MODE)
|
||||
set(DEFINES_JERRY ${DEFINES_JERRY} ENABLE_REGEXP_STRICT_MODE)
|
||||
set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_REGEXP_STRICT_MODE=1)
|
||||
endif()
|
||||
|
||||
# RegExp recursion depth limit
|
||||
|
||||
@ -42,12 +42,12 @@ snapshot_get_global_flags (bool has_regex, /**< regex literal is present */
|
||||
|
||||
uint32_t flags = 0;
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
flags |= (has_regex ? JERRY_SNAPSHOT_HAS_REGEX_LITERAL : 0);
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
flags |= (has_class ? JERRY_SNAPSHOT_HAS_CLASS_LITERAL : 0);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
return flags;
|
||||
} /* snapshot_get_global_flags */
|
||||
@ -60,12 +60,12 @@ snapshot_get_global_flags (bool has_regex, /**< regex literal is present */
|
||||
static inline bool JERRY_ATTR_ALWAYS_INLINE
|
||||
snapshot_check_global_flags (uint32_t global_flags) /**< global flags */
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
global_flags &= (uint32_t) ~JERRY_SNAPSHOT_HAS_REGEX_LITERAL;
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
global_flags &= (uint32_t) ~JERRY_SNAPSHOT_HAS_CLASS_LITERAL;
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
return global_flags == snapshot_get_global_flags (false, false);
|
||||
} /* snapshot_check_global_flags */
|
||||
@ -120,11 +120,11 @@ snapshot_write_to_buffer_by_offset (uint8_t *buffer_p, /**< buffer */
|
||||
/**
|
||||
* Maximum snapshot write buffer offset.
|
||||
*/
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
|
||||
#if !ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
#define JERRY_SNAPSHOT_MAXIMUM_WRITE_OFFSET (0x7fffff >> 1)
|
||||
#else
|
||||
#else /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
#define JERRY_SNAPSHOT_MAXIMUM_WRITE_OFFSET (UINT32_MAX >> 1)
|
||||
#endif
|
||||
#endif /* !ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
|
||||
/**
|
||||
* Save snapshot helper.
|
||||
@ -160,14 +160,14 @@ 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;
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
if (compiled_code_p->status_flags & CBC_CODE_FLAGS_CONSTRUCTOR)
|
||||
{
|
||||
globals_p->class_found = true;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
if (!(compiled_code_p->status_flags & CBC_CODE_FLAGS_FUNCTION))
|
||||
{
|
||||
/* Regular expression. */
|
||||
@ -219,7 +219,7 @@ snapshot_add_compiled_code (ecma_compiled_code_t *compiled_code_p, /**< compiled
|
||||
|
||||
return start_offset;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
|
||||
JERRY_ASSERT (compiled_code_p->status_flags & CBC_CODE_FLAGS_FUNCTION);
|
||||
|
||||
@ -548,7 +548,7 @@ snapshot_load_compiled_code (const uint8_t *base_addr_p, /**< base address of th
|
||||
ecma_compiled_code_t *bytecode_p = (ecma_compiled_code_t *) base_addr_p;
|
||||
uint32_t code_size = ((uint32_t) bytecode_p->size) << JMEM_ALIGNMENT_LOG;
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
if (!(bytecode_p->status_flags & CBC_CODE_FLAGS_FUNCTION))
|
||||
{
|
||||
const re_compiled_code_t *re_bytecode_p = NULL;
|
||||
@ -567,7 +567,7 @@ snapshot_load_compiled_code (const uint8_t *base_addr_p, /**< base address of th
|
||||
|
||||
return (ecma_compiled_code_t *) re_bytecode_p;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
|
||||
JERRY_ASSERT (bytecode_p->status_flags & CBC_CODE_FLAGS_FUNCTION);
|
||||
|
||||
|
||||
@ -63,12 +63,12 @@ JERRY_STATIC_ASSERT ((int) ECMA_INIT_EMPTY == (int) JERRY_INIT_EMPTY
|
||||
&& (int) ECMA_INIT_MEM_STATS == (int) JERRY_INIT_MEM_STATS,
|
||||
ecma_init_flag_t_must_be_equal_to_jerry_init_flag_t);
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
JERRY_STATIC_ASSERT ((int) RE_FLAG_GLOBAL == (int) JERRY_REGEXP_FLAG_GLOBAL
|
||||
&& (int) RE_FLAG_MULTILINE == (int) JERRY_REGEXP_FLAG_MULTILINE
|
||||
&& (int) RE_FLAG_IGNORE_CASE == (int) JERRY_REGEXP_FLAG_IGNORE_CASE,
|
||||
re_flags_t_must_be_equal_to_jerry_regexp_flags_t);
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
|
||||
#if defined JERRY_DISABLE_JS_PARSER && !defined JERRY_ENABLE_SNAPSHOT_EXEC
|
||||
#error JERRY_ENABLE_SNAPSHOT_EXEC must be defined if JERRY_DISABLE_JS_PARSER is defined!
|
||||
@ -209,9 +209,9 @@ jerry_cleanup (void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
ecma_free_all_enqueued_jobs ();
|
||||
#endif /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
ecma_finalize ();
|
||||
jerry_make_api_unavailable ();
|
||||
|
||||
@ -582,11 +582,11 @@ jerry_run_all_enqueued_jobs (void)
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
return ecma_process_all_enqueued_jobs ();
|
||||
#else /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
return ECMA_VALUE_UNDEFINED;
|
||||
#endif /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
} /* jerry_run_all_enqueued_jobs */
|
||||
|
||||
/**
|
||||
@ -750,13 +750,13 @@ bool
|
||||
jerry_value_is_promise (const jerry_value_t value) /**< api value */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
return (ecma_is_value_object (value)
|
||||
&& ecma_is_promise (ecma_get_object_from_value (value)));
|
||||
#else /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
JERRY_UNUSED (value);
|
||||
return false;
|
||||
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
} /* jerry_value_is_promise */
|
||||
|
||||
/**
|
||||
@ -784,12 +784,12 @@ jerry_value_is_symbol (const jerry_value_t value) /**< api value */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
return ecma_is_value_symbol (value);
|
||||
#else /* CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
JERRY_UNUSED (value);
|
||||
return false;
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
} /* jerry_value_is_symbol */
|
||||
|
||||
/**
|
||||
@ -843,12 +843,12 @@ jerry_value_get_type (const jerry_value_t value) /**< input value to check */
|
||||
{
|
||||
return JERRY_TYPE_STRING;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
case LIT_MAGIC_STRING_SYMBOL:
|
||||
{
|
||||
return JERRY_TYPE_SYMBOL;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
case LIT_MAGIC_STRING_FUNCTION:
|
||||
{
|
||||
return JERRY_TYPE_FUNCTION;
|
||||
@ -907,24 +907,24 @@ jerry_is_feature_enabled (const jerry_feature_t feature) /**< feature to check *
|
||||
#ifdef JERRY_VM_EXEC_STOP
|
||||
|| feature == JERRY_FEATURE_VM_EXEC_STOP
|
||||
#endif /* JERRY_VM_EXEC_STOP */
|
||||
#ifndef CONFIG_DISABLE_JSON_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_JSON)
|
||||
|| feature == JERRY_FEATURE_JSON
|
||||
#endif /* !CONFIG_DISABLE_JSON_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#endif /* ENABLED (JERRY_BUILTIN_JSON) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
|| feature == JERRY_FEATURE_PROMISE
|
||||
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
|| feature == JERRY_FEATURE_SYMBOL
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
|| feature == JERRY_FEATURE_TYPEDARRAY
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_DATE_BUILTIN
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_BUILTIN_DATE)
|
||||
|| feature == JERRY_FEATURE_DATE
|
||||
#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATE) */
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
|| feature == JERRY_FEATURE_REGEXP
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#ifdef JERRY_ENABLE_LINE_INFO
|
||||
|| feature == JERRY_FEATURE_LINE_INFO
|
||||
#endif /* JERRY_ENABLE_LINE_INFO */
|
||||
@ -1514,11 +1514,11 @@ jerry_create_promise (void)
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
return ecma_op_create_promise_object (ECMA_VALUE_EMPTY, ECMA_PROMISE_EXECUTOR_EMPTY);
|
||||
#else /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Promise not supported.")));
|
||||
#endif /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
} /* jerry_create_promise */
|
||||
|
||||
/**
|
||||
@ -1608,11 +1608,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)));
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
return jerry_return (ecma_op_create_symbol (&value, 1));
|
||||
#else /* CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Symbol is not supported.")));
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
} /* jerry_create_symbol */
|
||||
|
||||
/**
|
||||
@ -1639,7 +1639,7 @@ jerry_create_regexp_sz (const jerry_char_t *pattern_p, /**< zero-terminated UTF-
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
if (!lit_is_valid_utf8_string (pattern_p, pattern_size))
|
||||
{
|
||||
return jerry_throw (ecma_raise_common_error (ECMA_ERR_MSG ("Input must be a valid utf8 string")));
|
||||
@ -1652,13 +1652,13 @@ jerry_create_regexp_sz (const jerry_char_t *pattern_p, /**< zero-terminated UTF-
|
||||
ecma_deref_ecma_string (ecma_pattern);
|
||||
return ret_val;
|
||||
|
||||
#else /* CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
JERRY_UNUSED (pattern_p);
|
||||
JERRY_UNUSED (pattern_size);
|
||||
JERRY_UNUSED (flags);
|
||||
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("RegExp is not supported.")));
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
} /* jerry_create_regexp_sz */
|
||||
|
||||
/**
|
||||
@ -2746,7 +2746,7 @@ jerry_resolve_or_reject_promise (jerry_value_t promise, /**< the promise value *
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_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)));
|
||||
@ -2765,13 +2765,13 @@ jerry_resolve_or_reject_promise (jerry_value_t promise, /**< the promise value *
|
||||
ecma_free_value (function);
|
||||
|
||||
return ret;
|
||||
#else /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_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 /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
} /* jerry_resolve_or_reject_promise */
|
||||
|
||||
/**
|
||||
@ -2788,7 +2788,7 @@ jerry_get_symbol_descriptive_string (const jerry_value_t symbol) /**< symbol val
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
if (!ecma_is_value_symbol (symbol))
|
||||
{
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p)));
|
||||
@ -2796,11 +2796,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 /* CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
JERRY_UNUSED (symbol);
|
||||
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Symbol is not supported.")));
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
} /** jerry_get_symbol_descriptive_string */
|
||||
|
||||
/**
|
||||
@ -2978,12 +2978,12 @@ jerry_value_is_arraybuffer (const jerry_value_t value) /**< value to check if it
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
return ecma_is_arraybuffer (value);
|
||||
#else /* CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
return false;
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_value_is_arraybuffer */
|
||||
|
||||
/**
|
||||
@ -3001,12 +3001,12 @@ jerry_create_arraybuffer (const jerry_length_t size) /**< size of the ArrayBuffe
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
return jerry_return (ecma_make_object_value (ecma_arraybuffer_new_object (size)));
|
||||
#else /* CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (size);
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer not supported.")));
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_create_arraybuffer */
|
||||
|
||||
/**
|
||||
@ -3027,7 +3027,7 @@ jerry_create_arraybuffer_external (const jerry_length_t size, /**< size of the b
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
if (size == 0 || buffer_p == NULL)
|
||||
{
|
||||
return jerry_throw (ecma_raise_range_error (ECMA_ERR_MSG ("invalid buffer size or storage reference")));
|
||||
@ -3037,12 +3037,12 @@ jerry_create_arraybuffer_external (const jerry_length_t size, /**< size of the b
|
||||
buffer_p,
|
||||
(ecma_object_native_free_callback_t) free_cb);
|
||||
return jerry_return (ecma_make_object_value (arraybuffer));
|
||||
#else /* CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_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 /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_create_arraybuffer_external */
|
||||
|
||||
/**
|
||||
@ -3061,7 +3061,7 @@ jerry_arraybuffer_write (const jerry_value_t value, /**< target ArrayBuffer */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
if (!ecma_is_arraybuffer (value))
|
||||
{
|
||||
return 0;
|
||||
@ -3085,13 +3085,13 @@ jerry_arraybuffer_write (const jerry_value_t value, /**< target ArrayBuffer */
|
||||
}
|
||||
|
||||
return copy_count;
|
||||
#else /* CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
JERRY_UNUSED (offset);
|
||||
JERRY_UNUSED (buf_p);
|
||||
JERRY_UNUSED (buf_size);
|
||||
return 0;
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_arraybuffer_write */
|
||||
|
||||
/**
|
||||
@ -3110,7 +3110,7 @@ jerry_arraybuffer_read (const jerry_value_t value, /**< ArrayBuffer to read from
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
if (!ecma_is_arraybuffer (value))
|
||||
{
|
||||
return 0;
|
||||
@ -3134,13 +3134,13 @@ jerry_arraybuffer_read (const jerry_value_t value, /**< ArrayBuffer to read from
|
||||
}
|
||||
|
||||
return copy_count;
|
||||
#else /* CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
JERRY_UNUSED (offset);
|
||||
JERRY_UNUSED (buf_p);
|
||||
JERRY_UNUSED (buf_size);
|
||||
return 0;
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_arraybuffer_read */
|
||||
|
||||
/**
|
||||
@ -3156,15 +3156,15 @@ jerry_get_arraybuffer_byte_length (const jerry_value_t value) /**< ArrayBuffer *
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_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 /* CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
return 0;
|
||||
} /* jerry_get_arraybuffer_byte_length */
|
||||
|
||||
@ -3185,7 +3185,7 @@ uint8_t *
|
||||
jerry_get_arraybuffer_pointer (const jerry_value_t value) /**< Array Buffer to use */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
if (!ecma_is_arraybuffer (value))
|
||||
{
|
||||
return NULL;
|
||||
@ -3198,9 +3198,9 @@ jerry_get_arraybuffer_pointer (const jerry_value_t value) /**< Array Buffer to u
|
||||
lit_utf8_byte_t *mem_buffer_p = ecma_arraybuffer_get_buffer (buffer_p);
|
||||
return (uint8_t *const) mem_buffer_p;
|
||||
}
|
||||
#else /* CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
return NULL;
|
||||
} /* jerry_get_arraybuffer_pointer */
|
||||
@ -3221,15 +3221,15 @@ jerry_value_is_typedarray (jerry_value_t value) /**< value to check if it is a T
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
return ecma_is_typedarray (value);
|
||||
#else /* CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
return false;
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_value_is_typedarray */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
/**
|
||||
* TypedArray mapping type
|
||||
*/
|
||||
@ -3258,9 +3258,9 @@ static jerry_typedarray_mapping_t jerry_typedarray_mappings[] =
|
||||
TYPEDARRAY_ENTRY (UINT32, UINT32, 2),
|
||||
TYPEDARRAY_ENTRY (INT32, INT32, 2),
|
||||
TYPEDARRAY_ENTRY (FLOAT32, FLOAT32, 2),
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
|
||||
#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
TYPEDARRAY_ENTRY (FLOAT64, FLOAT64, 3),
|
||||
#endif
|
||||
#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
|
||||
#undef TYPEDARRAY_ENTRY
|
||||
};
|
||||
@ -3296,7 +3296,7 @@ jerry_typedarray_find_by_type (jerry_typedarray_type_t type_name, /**< type of t
|
||||
return false;
|
||||
} /* jerry_typedarray_find_by_type */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
/**
|
||||
* Create a TypedArray object with a given type and length.
|
||||
@ -3314,7 +3314,7 @@ jerry_create_typedarray (jerry_typedarray_type_t type_name, /**< type of TypedAr
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
ecma_builtin_id_t prototype_id = 0;
|
||||
lit_magic_string_id_t lit_id = 0;
|
||||
uint8_t element_size_shift = 0;
|
||||
@ -3334,11 +3334,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 /* CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (type_name);
|
||||
JERRY_UNUSED (length);
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("TypedArray not supported.")));
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_create_typedarray */
|
||||
|
||||
/**
|
||||
@ -3358,7 +3358,7 @@ jerry_create_typedarray_for_arraybuffer_sz (jerry_typedarray_type_t type_name, /
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
ecma_builtin_id_t prototype_id = 0;
|
||||
lit_magic_string_id_t lit_id = 0;
|
||||
uint8_t element_size_shift = 0;
|
||||
@ -3386,13 +3386,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 /* CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_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 /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_create_typedarray_for_arraybuffer_sz */
|
||||
|
||||
/**
|
||||
@ -3424,7 +3424,7 @@ jerry_get_typedarray_type (jerry_value_t value) /**< object to get the TypedArra
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
if (!ecma_is_typedarray (value))
|
||||
{
|
||||
return JERRY_TYPEDARRAY_INVALID;
|
||||
@ -3440,9 +3440,9 @@ jerry_get_typedarray_type (jerry_value_t value) /**< object to get the TypedArra
|
||||
return jerry_typedarray_mappings[i].api_type;
|
||||
}
|
||||
}
|
||||
#else /* CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
return JERRY_TYPEDARRAY_INVALID;
|
||||
} /* jerry_get_typedarray_type */
|
||||
@ -3457,15 +3457,15 @@ jerry_get_typedarray_length (jerry_value_t value) /**< TypedArray to query */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_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 /* CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_UNUSED (value);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
return 0;
|
||||
} /* jerry_get_typedarray_length */
|
||||
@ -3489,7 +3489,7 @@ jerry_get_typedarray_buffer (jerry_value_t value, /**< TypedArray to get the arr
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
if (!ecma_is_typedarray (value))
|
||||
{
|
||||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Object is not a TypedArray.")));
|
||||
@ -3511,12 +3511,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 /* CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_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 /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
} /* jerry_get_typedarray_buffer */
|
||||
|
||||
/**
|
||||
@ -3532,7 +3532,7 @@ jerry_json_parse (const jerry_char_t *string_p, /**< json string */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_JSON_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_JSON)
|
||||
ecma_value_t ret_value = ecma_builtin_json_parse_buffer (string_p, string_size);
|
||||
|
||||
if (ecma_is_value_undefined (ret_value))
|
||||
@ -3541,12 +3541,12 @@ jerry_json_parse (const jerry_char_t *string_p, /**< json string */
|
||||
}
|
||||
|
||||
return ret_value;
|
||||
#else /* CONFIG_DISABLE_JSON_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_JSON) */
|
||||
JERRY_UNUSED (string_p);
|
||||
JERRY_UNUSED (string_size);
|
||||
|
||||
return jerry_throw (ecma_raise_syntax_error (ECMA_ERR_MSG ("The JSON has been disabled.")));
|
||||
#endif /* !CONFIG_DISABLE_JSON_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_JSON) */
|
||||
} /* jerry_json_parse */
|
||||
|
||||
/**
|
||||
@ -3560,7 +3560,7 @@ jerry_value_t
|
||||
jerry_json_stringify (const jerry_value_t object_to_stringify) /**< a jerry_object_t to stringify */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
#ifndef CONFIG_DISABLE_JSON_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_JSON)
|
||||
ecma_value_t ret_value = ecma_builtin_json_string_from_object (object_to_stringify);
|
||||
|
||||
if (ecma_is_value_undefined (ret_value))
|
||||
@ -3569,11 +3569,11 @@ jerry_json_stringify (const jerry_value_t object_to_stringify) /**< a jerry_obje
|
||||
}
|
||||
|
||||
return ret_value;
|
||||
#else /* CONFIG_DISABLE_JSON_BUILTIN */
|
||||
#else /* ENABLED (JERRY_BUILTIN_JSON) */
|
||||
JERRY_UNUSED (object_to_stringify);
|
||||
|
||||
return jerry_throw (ecma_raise_syntax_error (ECMA_ERR_MSG ("The JSON has been disabled.")));
|
||||
#endif /* !CONFIG_DISABLE_JSON_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_JSON) */
|
||||
} /* jerry_json_stringify */
|
||||
|
||||
/**
|
||||
|
||||
@ -16,40 +16,128 @@
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
/**
|
||||
* Group of builtin-related features that can be disabled together.
|
||||
/*
|
||||
* By default all built-ins are enabled if they are not defined.
|
||||
*/
|
||||
#ifdef CONFIG_DISABLE_BUILTINS
|
||||
# define CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
# define CONFIG_DISABLE_ARRAY_BUILTIN
|
||||
# define CONFIG_DISABLE_BOOLEAN_BUILTIN
|
||||
# define CONFIG_DISABLE_DATE_BUILTIN
|
||||
# define CONFIG_DISABLE_ERROR_BUILTINS
|
||||
# define CONFIG_DISABLE_JSON_BUILTIN
|
||||
# define CONFIG_DISABLE_MATH_BUILTIN
|
||||
# define CONFIG_DISABLE_NUMBER_BUILTIN
|
||||
# define CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
# define CONFIG_DISABLE_STRING_BUILTIN
|
||||
#endif /* CONFIG_DISABLE_BUILTINS */
|
||||
#ifndef JERRY_BUILTINS
|
||||
# define JERRY_BUILTINS 1
|
||||
#endif
|
||||
|
||||
#ifndef JERRY_BUILTIN_ANNEXB
|
||||
# define JERRY_BUILTIN_ANNEXB JERRY_BUILTINS
|
||||
#endif /* !defined (JERRY_BUILTIN_ANNEXB) */
|
||||
|
||||
#ifndef JERRY_BUILTIN_ARRAY
|
||||
# define JERRY_BUILTIN_ARRAY JERRY_BUILTINS
|
||||
#endif /* !defined (JERRY_BUILTIN_ARRAY) */
|
||||
|
||||
#ifndef JERRY_BUILTIN_DATE
|
||||
# define JERRY_BUILTIN_DATE JERRY_BUILTINS
|
||||
#endif /* !defined (JERRY_BUILTIN_DATE) */
|
||||
|
||||
#ifndef JERRY_BUILTIN_ERRORS
|
||||
# define JERRY_BUILTIN_ERRORS JERRY_BUILTINS
|
||||
#endif /* !defined (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
#ifndef JERRY_BUILTIN_BOOLEAN
|
||||
# define JERRY_BUILTIN_BOOLEAN JERRY_BUILTINS
|
||||
#endif /* !defined (JERRY_BUILTIN_BOOLEAN) */
|
||||
|
||||
#ifndef JERRY_BUILTIN_JSON
|
||||
# define JERRY_BUILTIN_JSON JERRY_BUILTINS
|
||||
#endif /* !defined (JERRY_BUILTIN_JSON) */
|
||||
|
||||
#ifndef JERRY_BUILTIN_MATH
|
||||
# define JERRY_BUILTIN_MATH JERRY_BUILTINS
|
||||
#endif /* !defined (JERRY_BUILTIN_MATH) */
|
||||
|
||||
#ifndef JERRY_BUILTIN_NUMBER
|
||||
# define JERRY_BUILTIN_NUMBER JERRY_BUILTINS
|
||||
#endif /* !defined (JERRY_BUILTIN_NUMBER) */
|
||||
|
||||
#ifndef JERRY_BUILTIN_REGEXP
|
||||
# define JERRY_BUILTIN_REGEXP JERRY_BUILTINS
|
||||
#endif /* !defined (JERRY_BUILTIN_REGEXP) */
|
||||
|
||||
#ifndef JERRY_BUILTIN_STRING
|
||||
# define JERRY_BUILTIN_STRING JERRY_BUILTINS
|
||||
#endif /* !defined (JERRY_BUILTIN_STRING) */
|
||||
|
||||
/**
|
||||
* Group of ES2015-related features that can be disabled together.
|
||||
* ES2015 related features, by default all of them are enabled.
|
||||
*/
|
||||
#ifdef CONFIG_DISABLE_ES2015
|
||||
# define CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
# define CONFIG_DISABLE_ES2015_BUILTIN
|
||||
# define CONFIG_DISABLE_ES2015_CLASS
|
||||
# define CONFIG_DISABLE_ES2015_FUNCTION_PARAMETER_INITIALIZER
|
||||
# define CONFIG_DISABLE_ES2015_FUNCTION_REST_PARAMETER
|
||||
# define CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN
|
||||
# define CONFIG_DISABLE_ES2015_MAP_BUILTIN
|
||||
# define CONFIG_DISABLE_ES2015_OBJECT_INITIALIZER
|
||||
# define CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
# define CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
# define CONFIG_DISABLE_ES2015_TEMPLATE_STRINGS
|
||||
# define CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
# define CONFIG_DISABLE_ES2015_MODULE_SYSTEM
|
||||
#endif /* CONFIG_DISABLE_ES2015 */
|
||||
#ifndef JERRY_ES2015
|
||||
# define JERRY_ES2015 1
|
||||
#endif
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN
|
||||
# define JERRY_ES2015_BUILTIN JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_ITERATOR
|
||||
# define JERRY_ES2015_BUILTIN_ITERATOR JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_ITERATOR) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_MAP
|
||||
# define JERRY_ES2015_BUILTIN_MAP JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_MAP) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_PROMISE
|
||||
# define JERRY_ES2015_BUILTIN_PROMISE JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_SYMBOL
|
||||
# define JERRY_ES2015_BUILTIN_SYMBOL JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_TYPEDARRAY
|
||||
# define JERRY_ES2015_BUILTIN_TYPEDARRAY JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
#ifndef JERRY_ES2015_ARROW_FUNCTION
|
||||
# define JERRY_ES2015_ARROW_FUNCTION JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
#ifndef JERRY_ES2015_CLASS
|
||||
# define JERRY_ES2015_CLASS JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_CLASS) */
|
||||
|
||||
#ifndef JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER
|
||||
# define JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER) */
|
||||
|
||||
#ifndef JERRY_ES2015_FUNCTION_REST_PARAMETER
|
||||
# define JERRY_ES2015_FUNCTION_REST_PARAMETER JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_FUNCTION_REST_PARAMETER) */
|
||||
|
||||
#ifndef JERRY_ES2015_OBJECT_INITIALIZER
|
||||
# define JERRY_ES2015_OBJECT_INITIALIZER JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_OBJECT_INITIALIZER) */
|
||||
|
||||
#ifndef JERRY_ES2015_MODULE_SYSTEM
|
||||
# define JERRY_ES2015_MODULE_SYSTEM JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_MODULE_SYSTEM) */
|
||||
|
||||
#ifndef JERRY_ES2015_TEMPLATE_STRINGS
|
||||
# define JERRY_ES2015_TEMPLATE_STRINGS JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_TEMPLATE_STRINGS) */
|
||||
|
||||
/**
|
||||
* Enables/disables the RegExp strict mode
|
||||
*
|
||||
* Default value: 0
|
||||
*/
|
||||
#ifndef JERRY_REGEXP_STRICT_MODE
|
||||
# define JERRY_REGEXP_STRICT_MODE 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enables/disables the unicode case conversion in the engine.
|
||||
* By default Unicode case conversion is enabled.
|
||||
*/
|
||||
#ifndef JERRY_UNICODE_CASE_CONVERSION
|
||||
# define JERRY_UNICODE_CASE_CONVERSION 1
|
||||
#endif /* !defined (JERRY_UNICODE_CASE_CONVERSION) */
|
||||
|
||||
/**
|
||||
* Size of heap
|
||||
@ -70,22 +158,16 @@
|
||||
|
||||
/**
|
||||
* Use 32-bit/64-bit float for ecma-numbers
|
||||
* This option is for expert use only!
|
||||
*
|
||||
* Allowed values:
|
||||
* 1: use 64-bit floating point number mode
|
||||
* 0: use 32-bit floating point number mode
|
||||
*
|
||||
* Default value: 1
|
||||
*/
|
||||
#define CONFIG_ECMA_NUMBER_FLOAT32 (1u) /* 32-bit float */
|
||||
#define CONFIG_ECMA_NUMBER_FLOAT64 (2u) /* 64-bit float */
|
||||
|
||||
#ifndef CONFIG_ECMA_NUMBER_TYPE
|
||||
# define CONFIG_ECMA_NUMBER_TYPE CONFIG_ECMA_NUMBER_FLOAT64
|
||||
#else /* CONFIG_ECMA_NUMBER_TYPE */
|
||||
# if (CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32 \
|
||||
&& CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT64)
|
||||
# error "ECMA-number storage is configured incorrectly"
|
||||
# endif /* CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32
|
||||
&& CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT64 */
|
||||
#endif /* !CONFIG_ECMA_NUMBER_TYPE */
|
||||
|
||||
#if (!defined (CONFIG_DISABLE_DATE_BUILTIN) && (CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32))
|
||||
# error "Date does not support float32"
|
||||
#ifndef JERRY_NUMBER_TYPE_FLOAT64
|
||||
# define JERRY_NUMBER_TYPE_FLOAT64 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -107,4 +189,144 @@
|
||||
*/
|
||||
#define CONFIG_ECMA_GC_NEW_OBJECTS_SHARE_TO_START_GC (16)
|
||||
|
||||
|
||||
/**
|
||||
* Sanity check for macros to see if the values are 0 or 1
|
||||
*
|
||||
* If a new feature is added this should be updated.
|
||||
*/
|
||||
/**
|
||||
* Check base builtins.
|
||||
*/
|
||||
#if !defined (JERRY_BUILTIN_ANNEXB) \
|
||||
|| ((JERRY_BUILTIN_ANNEXB != 0) && (JERRY_BUILTIN_ANNEXB != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_ANNEXB macro."
|
||||
#endif
|
||||
#if !defined (JERRY_BUILTIN_ARRAY) \
|
||||
|| ((JERRY_BUILTIN_ARRAY != 0) && (JERRY_BUILTIN_ARRAY != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_ARRAY macro."
|
||||
#endif
|
||||
#if !defined (JERRY_BUILTIN_BOOLEAN) \
|
||||
|| ((JERRY_BUILTIN_BOOLEAN != 0) && (JERRY_BUILTIN_BOOLEAN != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_BOOLEAN macro."
|
||||
#endif
|
||||
#if !defined (JERRY_BUILTIN_DATE) \
|
||||
|| ((JERRY_BUILTIN_DATE != 0) && (JERRY_BUILTIN_DATE != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_DATE macro."
|
||||
#endif
|
||||
#if !defined (JERRY_BUILTIN_ERRORS) \
|
||||
|| ((JERRY_BUILTIN_ERRORS != 0) && (JERRY_BUILTIN_ERRORS != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_ERRORS macro."
|
||||
#endif
|
||||
#if !defined (JERRY_BUILTIN_JSON) \
|
||||
|| ((JERRY_BUILTIN_JSON != 0) && (JERRY_BUILTIN_JSON != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_JSON macro."
|
||||
#endif
|
||||
#if !defined (JERRY_BUILTIN_MATH) \
|
||||
|| ((JERRY_BUILTIN_MATH != 0) && (JERRY_BUILTIN_MATH != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_MATH macro."
|
||||
#endif
|
||||
#if !defined (JERRY_BUILTIN_NUMBER) \
|
||||
|| ((JERRY_BUILTIN_NUMBER != 0) && (JERRY_BUILTIN_NUMBER != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_NUMBER macro."
|
||||
#endif
|
||||
#if !defined (JERRY_BUILTIN_REGEXP) \
|
||||
|| ((JERRY_BUILTIN_REGEXP != 0) && (JERRY_BUILTIN_REGEXP != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_REGEXP macro."
|
||||
#endif
|
||||
#if !defined (JERRY_BUILTIN_STRING) \
|
||||
|| ((JERRY_BUILTIN_STRING != 0) && (JERRY_BUILTIN_STRING != 1))
|
||||
# error "Invalid value for JERRY_BUILTIN_STRING macro."
|
||||
#endif
|
||||
#if !defined (JERRY_BUILTINS) \
|
||||
|| ((JERRY_BUILTINS != 0) && (JERRY_BUILTINS != 1))
|
||||
# error "Invalid value for JERRY_BUILTINS macro."
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Check ES2015 features
|
||||
*/
|
||||
#if !defined (JERRY_ES2015) \
|
||||
|| ((JERRY_ES2015 != 0) && (JERRY_ES2015 != 1))
|
||||
# error "Invalid value for JERRY_ES2015 macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_ARROW_FUNCTION) \
|
||||
|| ((JERRY_ES2015_ARROW_FUNCTION != 0) && (JERRY_ES2015_ARROW_FUNCTION != 1))
|
||||
# error "Invalid value for JERRY_ES2015_ARROW_FUNCTION macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_BUILTIN) \
|
||||
|| ((JERRY_ES2015_BUILTIN != 0) && (JERRY_ES2015_BUILTIN != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_BUILTIN_ITERATOR) \
|
||||
|| ((JERRY_ES2015_BUILTIN_ITERATOR != 0) && (JERRY_ES2015_BUILTIN_ITERATOR != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN_ITERATOR 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."
|
||||
#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."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_BUILTIN_SYMBOL) \
|
||||
|| ((JERRY_ES2015_BUILTIN_SYMBOL != 0) && (JERRY_ES2015_BUILTIN_SYMBOL != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN_SYMBOL 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."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_CLASS) \
|
||||
|| ((JERRY_ES2015_CLASS != 0) && (JERRY_ES2015_CLASS != 1))
|
||||
# error "Invalid value for JERRY_ES2015_CLASS macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER) \
|
||||
|| ((JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER != 0) && (JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER != 1))
|
||||
# error "Invalid value for JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_FUNCTION_REST_PARAMETER) \
|
||||
|| ((JERRY_ES2015_FUNCTION_REST_PARAMETER != 0) && (JERRY_ES2015_FUNCTION_REST_PARAMETER != 1))
|
||||
# error "Invalid value for JERRY_ES2015_FUNCTION_REST_PARAMETER macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_OBJECT_INITIALIZER) \
|
||||
|| ((JERRY_ES2015_OBJECT_INITIALIZER != 0) && (JERRY_ES2015_OBJECT_INITIALIZER != 1))
|
||||
# error "Invalid value for JERRY_ES2015_OBJECT_INITIALIZER 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."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_TEMPLATE_STRINGS) \
|
||||
|| ((JERRY_ES2015_TEMPLATE_STRINGS != 0) && (JERRY_ES2015_TEMPLATE_STRINGS != 1))
|
||||
# error "Invalid value for JERRY_ES2015_TEMPLATE_STRINGS macro."
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Internal options.
|
||||
*/
|
||||
#if !defined (JERRY_UNICODE_CASE_CONVERSION) \
|
||||
|| ((JERRY_UNICODE_CASE_CONVERSION != 0) && (JERRY_UNICODE_CASE_CONVERSION != 1))
|
||||
# error "Invalid value for JERRY_UNICODE_CASE_CONVERSION macro."
|
||||
#endif
|
||||
#if !defined (JERRY_NUMBER_TYPE_FLOAT64) \
|
||||
|| ((JERRY_NUMBER_TYPE_FLOAT64 != 0) && (JERRY_NUMBER_TYPE_FLOAT64 != 1))
|
||||
# error "Invalid value for JERRY_NUMBER_TYPE_FLOAT64 macro."
|
||||
#endif
|
||||
|
||||
#define ENABLED(FEATURE) ((FEATURE) == 1)
|
||||
#define DISABLED(FEATURE) ((FEATURE) != 1)
|
||||
|
||||
/**
|
||||
* Cross component requirements check.
|
||||
*/
|
||||
/**
|
||||
* The date module can only use the float 64 number types.
|
||||
* Do a check for this.
|
||||
*/
|
||||
#if ENABLED (JERRY_BUILTIN_DATE) && !ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
# error "Date does not support float32"
|
||||
#endif
|
||||
|
||||
#endif /* !CONFIG_H */
|
||||
|
||||
@ -1420,7 +1420,7 @@ jerry_debugger_exception_object_to_string (ecma_value_t exception_obj_value) /**
|
||||
|
||||
switch (((ecma_extended_object_t *) prototype_p)->u.built_in.id)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
case ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE:
|
||||
{
|
||||
string_id = LIT_MAGIC_STRING_EVAL_ERROR_UL;
|
||||
@ -1451,7 +1451,7 @@ jerry_debugger_exception_object_to_string (ecma_value_t exception_obj_value) /**
|
||||
string_id = LIT_MAGIC_STRING_URI_ERROR_UL;
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
case ECMA_BUILTIN_ID_ERROR_PROTOTYPE:
|
||||
{
|
||||
string_id = LIT_MAGIC_STRING_ERROR_UL;
|
||||
|
||||
@ -30,15 +30,15 @@
|
||||
#include "vm-defines.h"
|
||||
#include "vm-stack.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#include "ecma-typedarray-object.h"
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#include "ecma-promise-object.h"
|
||||
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_MAP_BUILTIN
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
#include "ecma-map-object.h"
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MAP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
|
||||
/* TODO: Extract GC to a separate component */
|
||||
|
||||
@ -209,7 +209,7 @@ ecma_gc_mark_property (ecma_property_pair_t *property_pair_p, /**< property pair
|
||||
}
|
||||
} /* ecma_gc_mark_property */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
|
||||
/**
|
||||
* Mark objects referenced by Promise built-in.
|
||||
@ -244,9 +244,9 @@ ecma_gc_mark_promise_object (ecma_extended_object_t *ext_object_p) /**< extended
|
||||
}
|
||||
} /* ecma_gc_mark_promise_object */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_MAP_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
|
||||
/**
|
||||
* Mark objects referenced by Map built-in.
|
||||
@ -288,7 +288,7 @@ ecma_gc_mark_map_object (ecma_extended_object_t *ext_object_p) /**< extended obj
|
||||
}
|
||||
} /* ecma_gc_mark_map_object */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MAP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
|
||||
/**
|
||||
* Mark objects as visited starting from specified object as root
|
||||
@ -333,20 +333,20 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
|
||||
switch (ext_object_p->u.class_prop.class_id)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
case LIT_MAGIC_STRING_PROMISE_UL:
|
||||
{
|
||||
ecma_gc_mark_promise_object (ext_object_p);
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_MAP_BUILTIN
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
case LIT_MAGIC_STRING_MAP_UL:
|
||||
{
|
||||
ecma_gc_mark_map_object (ext_object_p);
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MAP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
default:
|
||||
{
|
||||
break;
|
||||
@ -361,15 +361,15 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
|
||||
switch (ext_object_p->u.pseudo_array.type)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_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 /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
|
||||
case ECMA_PSEUDO_ARRAY_ITERATOR:
|
||||
{
|
||||
ecma_object_t *iterated_obj_p = ECMA_GET_POINTER (ecma_object_t,
|
||||
@ -381,7 +381,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS);
|
||||
@ -442,7 +442,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
case ECMA_OBJECT_TYPE_ARROW_FUNCTION:
|
||||
{
|
||||
ecma_arrow_function_t *arrow_func_p = (ecma_arrow_function_t *) object_p;
|
||||
@ -456,7 +456,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
default:
|
||||
{
|
||||
break;
|
||||
@ -605,9 +605,9 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
|
||||
switch (ext_object_p->u.class_prop.class_id)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
case LIT_MAGIC_STRING_SYMBOL_UL:
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
case LIT_MAGIC_STRING_STRING_UL:
|
||||
case LIT_MAGIC_STRING_NUMBER_UL:
|
||||
{
|
||||
@ -635,7 +635,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
case LIT_MAGIC_STRING_ARRAY_BUFFER_UL:
|
||||
{
|
||||
ecma_length_t arraybuffer_length = ext_object_p->u.class_prop.u.length;
|
||||
@ -662,8 +662,8 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
ecma_dealloc_extended_object (object_p, size);
|
||||
return;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
case LIT_MAGIC_STRING_PROMISE_UL:
|
||||
{
|
||||
ecma_free_value_if_not_object (ext_object_p->u.class_prop.u.value);
|
||||
@ -674,15 +674,15 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
ecma_dealloc_extended_object (object_p, sizeof (ecma_promise_object_t));
|
||||
return;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_MAP_BUILTIN
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
case LIT_MAGIC_STRING_MAP_UL:
|
||||
{
|
||||
ecma_op_map_clear_map ((ecma_map_object_t *) object_p);
|
||||
ecma_dealloc_extended_object (object_p, sizeof (ecma_map_object_t));
|
||||
return;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MAP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
default:
|
||||
{
|
||||
/* The undefined id represents an uninitialized class. */
|
||||
@ -730,7 +730,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
if (object_type == ECMA_OBJECT_TYPE_ARROW_FUNCTION)
|
||||
{
|
||||
ecma_arrow_function_t *arrow_func_p = (ecma_arrow_function_t *) object_p;
|
||||
@ -755,7 +755,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
return;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
if (object_type == ECMA_OBJECT_TYPE_PSEUDO_ARRAY)
|
||||
{
|
||||
@ -763,7 +763,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
|
||||
switch (ext_object_p->u.pseudo_array.type)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
case ECMA_PSEUDO_ARRAY_TYPEDARRAY:
|
||||
{
|
||||
ecma_dealloc_extended_object (object_p, sizeof (ecma_extended_object_t));
|
||||
@ -774,14 +774,14 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
ecma_dealloc_extended_object (object_p, sizeof (ecma_extended_typedarray_object_t));
|
||||
return;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
|
||||
case ECMA_PSEUDO_ARRAY_ITERATOR:
|
||||
{
|
||||
ecma_dealloc_extended_object (object_p, sizeof (ecma_extended_object_t));
|
||||
return;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS);
|
||||
@ -983,10 +983,10 @@ ecma_gc_run (jmem_free_unused_memory_severity_t severity) /**< gc severity */
|
||||
|
||||
JERRY_CONTEXT (ecma_gc_objects_p) = black_objects_p;
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
/* Free RegExp bytecodes stored in cache */
|
||||
re_cache_gc_run ();
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
} /* ecma_gc_run */
|
||||
|
||||
/**
|
||||
|
||||
@ -190,7 +190,7 @@ enum
|
||||
ECMA_VALUE_IMPLICIT_CONSTRUCTOR = ECMA_MAKE_VALUE (9), /**< special value for bound class constructors */
|
||||
};
|
||||
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
|
||||
#if !ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
/**
|
||||
* Maximum integer number for an ecma value
|
||||
*/
|
||||
@ -199,7 +199,7 @@ enum
|
||||
* Maximum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT)
|
||||
*/
|
||||
#define ECMA_INTEGER_NUMBER_MAX_SHIFTED 0x7fffff0
|
||||
#else /* CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32 */
|
||||
#else /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
/**
|
||||
* Maximum integer number for an ecma value
|
||||
*/
|
||||
@ -208,9 +208,9 @@ enum
|
||||
* Maximum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT)
|
||||
*/
|
||||
#define ECMA_INTEGER_NUMBER_MAX_SHIFTED 0x7ffffff0
|
||||
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
|
||||
#endif /* !ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
|
||||
#if !ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
/**
|
||||
* Minimum integer number for an ecma value
|
||||
*/
|
||||
@ -219,7 +219,7 @@ enum
|
||||
* Minimum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT)
|
||||
*/
|
||||
#define ECMA_INTEGER_NUMBER_MIN_SHIFTED -0x7fffff0
|
||||
#else /* CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32 */
|
||||
#else /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
/**
|
||||
* Minimum integer number for an ecma value
|
||||
*/
|
||||
@ -228,7 +228,7 @@ enum
|
||||
* Minimum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT)
|
||||
*/
|
||||
#define ECMA_INTEGER_NUMBER_MIN_SHIFTED (-0x7fffffff - 1) /* -0x80000000 */
|
||||
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
|
||||
#endif /* !ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
|
||||
#if ECMA_DIRECT_SHIFT != 4
|
||||
#error "Please update ECMA_INTEGER_NUMBER_MIN/MAX_SHIFTED according to the new value of ECMA_DIRECT_SHIFT."
|
||||
@ -243,11 +243,11 @@ enum
|
||||
/**
|
||||
* Maximum integer number, which if squared, still fits in ecma_integer_value_t
|
||||
*/
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
|
||||
#if !ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
#define ECMA_INTEGER_MULTIPLY_MAX 0xb50
|
||||
#else /* CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32 */
|
||||
#else /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
#define ECMA_INTEGER_MULTIPLY_MAX 0x2d41
|
||||
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
|
||||
#endif /* !ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
|
||||
/**
|
||||
* Checks whether the error flag is set.
|
||||
@ -363,9 +363,9 @@ 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 */
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
ECMA_LIST_SYMBOLS = (1 << 3), /**< list symbol properties only */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
} ecma_list_properties_options_t;
|
||||
|
||||
/**
|
||||
@ -647,9 +647,9 @@ typedef enum
|
||||
ECMA_OBJECT_TYPE_ARRAY = 4, /**< Array object (15.4) */
|
||||
ECMA_OBJECT_TYPE_BOUND_FUNCTION = 5, /**< Function objects (15.3), created through 15.3.4.5 routine */
|
||||
ECMA_OBJECT_TYPE_PSEUDO_ARRAY = 6, /**< Array-like object, such as Arguments object (10.6) */
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
ECMA_OBJECT_TYPE_ARROW_FUNCTION = 7, /**< arrow function objects */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
/* Types between 13-15 cannot have a built-in flag. See ecma_lexical_environment_type_t. */
|
||||
|
||||
@ -687,7 +687,7 @@ typedef enum
|
||||
ECMA_LEXICAL_ENVIRONMENT_TYPE__MAX = ECMA_LEXICAL_ENVIRONMENT_SUPER_OBJECT_BOUND /**< maximum value */
|
||||
} ecma_lexical_environment_type_t;
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
|
||||
/**
|
||||
* Types of array iterators.
|
||||
*/
|
||||
@ -697,7 +697,7 @@ typedef enum
|
||||
ECMA_ARRAY_ITERATOR_VALUES, /**< List only key values */
|
||||
ECMA_ARRAY_ITERATOR_KEYS_VALUES, /**< List key indices and values */
|
||||
} ecma_array_iterator_type_t;
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
|
||||
|
||||
/**
|
||||
* Offset for JERRY_CONTEXT (status_flags) top 8 bits.
|
||||
@ -926,7 +926,7 @@ typedef struct
|
||||
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
|
||||
/**
|
||||
* Description of arrow function objects.
|
||||
@ -952,9 +952,9 @@ typedef struct
|
||||
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_MAP_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
|
||||
/**
|
||||
* Map item count of chunks
|
||||
@ -980,7 +980,7 @@ typedef struct
|
||||
* the rest can be ECMA_VALUE_ARRAY_HOLE or any valid value. */
|
||||
} ecma_map_object_chunk_t;
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MAP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
|
||||
/**
|
||||
* Description of ECMA property descriptor
|
||||
@ -1030,7 +1030,7 @@ typedef struct
|
||||
ecma_object_t *set_p;
|
||||
} ecma_property_descriptor_t;
|
||||
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
|
||||
#if !ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
/**
|
||||
* Description of an ecma-number
|
||||
*/
|
||||
@ -1066,7 +1066,7 @@ typedef float ecma_number_t;
|
||||
* IEEE-754 2008, 3.6, Table 3.5
|
||||
*/
|
||||
#define ECMA_NUMBER_FRACTION_WIDTH (23)
|
||||
#elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
|
||||
#elif ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
/**
|
||||
* Description of an ecma-number
|
||||
*/
|
||||
@ -1102,7 +1102,7 @@ typedef double ecma_number_t;
|
||||
* IEEE-754 2008, 3.6, Table 3.5
|
||||
*/
|
||||
#define ECMA_NUMBER_FRACTION_WIDTH (52)
|
||||
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
|
||||
#endif /* !ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
|
||||
/**
|
||||
* Value '0' of ecma_number_t
|
||||
@ -1129,7 +1129,7 @@ typedef double ecma_number_t;
|
||||
*/
|
||||
#define ECMA_NUMBER_MINUS_ONE ((ecma_number_t) -1)
|
||||
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
|
||||
#if !ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
/**
|
||||
* Number.MIN_VALUE (i.e., the smallest positive value of ecma-number)
|
||||
*
|
||||
@ -1142,7 +1142,7 @@ typedef double ecma_number_t;
|
||||
* See also: ECMA_262 v5, 15.7.3.2
|
||||
*/
|
||||
# define ECMA_NUMBER_MAX_VALUE (FLT_MAX)
|
||||
#elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
|
||||
#elif ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
/**
|
||||
* Number.MAX_VALUE (i.e., the maximum value of ecma-number)
|
||||
*
|
||||
@ -1155,7 +1155,7 @@ typedef double ecma_number_t;
|
||||
* See also: ECMA_262 v5, 15.7.3.3
|
||||
*/
|
||||
# define ECMA_NUMBER_MIN_VALUE ((ecma_number_t) 5e-324)
|
||||
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
|
||||
#endif /* !ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
|
||||
/**
|
||||
* Euler number
|
||||
@ -1521,7 +1521,7 @@ typedef struct
|
||||
|
||||
#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
|
||||
/**
|
||||
* Extra information for ArrayBuffers.
|
||||
@ -1562,7 +1562,7 @@ typedef struct
|
||||
ecma_length_t array_length; /**< the array length */
|
||||
} ecma_extended_typedarray_object_t;
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
/**
|
||||
* Flag for indicating whether the symbol is a well known symbol
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
|
||||
#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
|
||||
/**
|
||||
* \addtogroup ecmahelpersbigintegers Helpers for operations intermediate 128-bit integers
|
||||
@ -249,7 +249,7 @@ static const uint8_t ecma_uint4_clz[] = { 4, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0,
|
||||
*/
|
||||
#define NUMBER_MIN_DECIMAL_EXPONENT -324
|
||||
|
||||
#elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
|
||||
#elif !ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
|
||||
/**
|
||||
* Number.MAX_VALUE exponent part when using 32 bit float representation.
|
||||
@ -260,7 +260,7 @@ static const uint8_t ecma_uint4_clz[] = { 4, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0,
|
||||
*/
|
||||
#define NUMBER_MIN_DECIMAL_EXPONENT -45
|
||||
|
||||
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
|
||||
#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
|
||||
/**
|
||||
* Value of epsilon
|
||||
@ -568,7 +568,7 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */
|
||||
return sign ? -ECMA_NUMBER_ZERO : ECMA_NUMBER_ZERO;
|
||||
}
|
||||
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
|
||||
#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
/*
|
||||
* 128-bit mantissa storage
|
||||
*
|
||||
@ -653,7 +653,7 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */
|
||||
fraction_uint64 = ECMA_UINT128_ROUND_HIGH_TO_UINT64 (fraction_uint128);
|
||||
|
||||
return ecma_number_make_from_sign_mantissa_and_exponent (sign, fraction_uint64, binary_exponent);
|
||||
#elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
|
||||
#elif !ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
/* Less precise conversion */
|
||||
ecma_number_t num = (ecma_number_t) (uint32_t) fraction_uint64;
|
||||
|
||||
@ -671,7 +671,7 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */
|
||||
}
|
||||
|
||||
return num;
|
||||
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
|
||||
#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
} /* ecma_utf8_string_to_number */
|
||||
|
||||
/**
|
||||
|
||||
@ -37,7 +37,7 @@ JERRY_STATIC_ASSERT (((1 << (ECMA_DIRECT_SHIFT - 1)) | ECMA_TYPE_DIRECT) == ECMA
|
||||
#define ECMA_NUMBER_SIGN_POS (ECMA_NUMBER_FRACTION_WIDTH + \
|
||||
ECMA_NUMBER_BIASED_EXP_WIDTH)
|
||||
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
|
||||
#if !ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
JERRY_STATIC_ASSERT (sizeof (ecma_number_t) == sizeof (uint32_t),
|
||||
size_of_ecma_number_t_must_be_equal_to_4_bytes);
|
||||
|
||||
@ -112,7 +112,7 @@ ecma_number_unpack (ecma_number_t num, /**< ecma-number */
|
||||
*/
|
||||
const int32_t ecma_number_exponent_bias = 127;
|
||||
|
||||
#elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
|
||||
#elif ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
JERRY_STATIC_ASSERT (sizeof (ecma_number_t) == sizeof (uint64_t),
|
||||
size_of_ecma_number_t_must_be_equal_to_8_bytes);
|
||||
|
||||
@ -186,7 +186,7 @@ ecma_number_unpack (ecma_number_t num, /**< ecma-number */
|
||||
*/
|
||||
const int32_t ecma_number_exponent_bias = 1023;
|
||||
|
||||
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
|
||||
#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
|
||||
/**
|
||||
* Get fraction of number
|
||||
|
||||
@ -200,7 +200,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 */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/**
|
||||
* Allocate new ecma-string and fill it with reference to the symbol descriptor
|
||||
*
|
||||
@ -234,7 +234,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 /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
/**
|
||||
* Allocate new ecma-string and fill it with characters from the utf8 string
|
||||
@ -977,13 +977,13 @@ ecma_deref_ecma_string (ecma_string_t *string_p) /**< ecma-string */
|
||||
ecma_free_value (string_p->u.lit_number);
|
||||
break;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
case ECMA_STRING_CONTAINER_SYMBOL:
|
||||
{
|
||||
ecma_free_value (string_p->u.symbol_descriptor);
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_UINT32_IN_DESC
|
||||
@ -1819,12 +1819,12 @@ ecma_compare_ecma_strings (const ecma_string_t *string1_p, /**< ecma-string */
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
if (string1_container == ECMA_STRING_CONTAINER_SYMBOL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
if (string1_container >= ECMA_STRING_CONTAINER_UINT32_IN_DESC)
|
||||
{
|
||||
|
||||
@ -311,7 +311,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 */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/**
|
||||
* Check if the value is symbol.
|
||||
*
|
||||
@ -323,7 +323,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 /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
/**
|
||||
* Check if the value can be property name.
|
||||
@ -334,11 +334,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 */
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
return ecma_is_value_string (value) || ecma_is_value_symbol (value);
|
||||
#else /* CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
return ecma_is_value_string (value);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
} /* ecma_is_value_prop_name */
|
||||
|
||||
/**
|
||||
@ -478,7 +478,7 @@ ecma_make_nan_value (void)
|
||||
static inline bool JERRY_ATTR_CONST JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_is_number_equal_to_positive_zero (ecma_number_t ecma_number) /**< number */
|
||||
{
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
|
||||
#if !ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
union
|
||||
{
|
||||
uint32_t u32_value;
|
||||
@ -488,7 +488,7 @@ ecma_is_number_equal_to_positive_zero (ecma_number_t ecma_number) /**< number */
|
||||
u.float_value = ecma_number;
|
||||
|
||||
return u.u32_value == 0;
|
||||
#else /* CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32 */
|
||||
#else /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
union
|
||||
{
|
||||
uint64_t u64_value;
|
||||
@ -498,7 +498,7 @@ ecma_is_number_equal_to_positive_zero (ecma_number_t ecma_number) /**< number */
|
||||
u.float_value = ecma_number;
|
||||
|
||||
return u.u64_value == 0;
|
||||
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
|
||||
#endif /* !ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
} /* ecma_is_number_equal_to_positive_zero */
|
||||
|
||||
/**
|
||||
@ -562,9 +562,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);
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
JERRY_ASSERT (!ecma_prop_name_is_symbol ((ecma_string_t *) ecma_string_p));
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
if ((((uintptr_t) ecma_string_p) & ECMA_VALUE_TYPE_MASK) != 0)
|
||||
{
|
||||
@ -574,7 +574,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 */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/**
|
||||
* Symbol value constructor
|
||||
*
|
||||
@ -588,7 +588,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 /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
/**
|
||||
* Property-name value constructor
|
||||
@ -600,12 +600,12 @@ ecma_make_prop_name_value (const ecma_string_t *ecma_prop_name_p) /**< property
|
||||
{
|
||||
JERRY_ASSERT (ecma_prop_name_p != NULL);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
if (ecma_prop_name_is_symbol ((ecma_string_t *) ecma_prop_name_p))
|
||||
{
|
||||
return ecma_make_symbol_value (ecma_prop_name_p);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
return ecma_make_string_value (ecma_prop_name_p);
|
||||
} /* ecma_make_prop_name_value */
|
||||
@ -730,7 +730,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 */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/**
|
||||
* Get pointer to ecma-string from ecma value
|
||||
*
|
||||
@ -743,7 +743,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 /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
/**
|
||||
* Get pointer to a property name from ecma value
|
||||
@ -840,13 +840,13 @@ ecma_copy_value (ecma_value_t value) /**< value description */
|
||||
ecma_ref_ecma_string (ecma_get_string_from_value (value));
|
||||
return value;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
case ECMA_TYPE_SYMBOL:
|
||||
{
|
||||
ecma_ref_ecma_string (ecma_get_symbol_from_value (value));
|
||||
return value;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
case ECMA_TYPE_OBJECT:
|
||||
{
|
||||
ecma_ref_object (ecma_get_object_from_value (value));
|
||||
@ -1037,13 +1037,13 @@ ecma_free_value (ecma_value_t value) /**< value description */
|
||||
ecma_deref_ecma_string (string_p);
|
||||
break;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
case ECMA_TYPE_SYMBOL:
|
||||
{
|
||||
ecma_deref_ecma_string (ecma_get_symbol_from_value (value));
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
case ECMA_TYPE_OBJECT:
|
||||
{
|
||||
ecma_deref_object (ecma_get_object_from_value (value));
|
||||
@ -1143,12 +1143,12 @@ ecma_get_typeof_lit_id (ecma_value_t value) /**< input ecma value */
|
||||
{
|
||||
ret_value = LIT_MAGIC_STRING_STRING;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
else if (ecma_is_value_symbol (value))
|
||||
{
|
||||
ret_value = LIT_MAGIC_STRING_SYMBOL;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
else
|
||||
{
|
||||
JERRY_ASSERT (ecma_is_value_object (value));
|
||||
|
||||
@ -140,12 +140,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 */
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
JERRY_ASSERT (type == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND
|
||||
|| type == ECMA_LEXICAL_ENVIRONMENT_SUPER_OBJECT_BOUND);
|
||||
#else /* CONFIG_DISABLE_ES2015_CLASS */
|
||||
#else /* !ENABLED (JERRY_ES2015_CLASS) */
|
||||
JERRY_ASSERT (type == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
JERRY_ASSERT (binding_obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (binding_obj_p));
|
||||
@ -361,12 +361,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));
|
||||
#ifndef CONFIG_DISABLE_ES2015
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
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_SUPER_OBJECT_BOUND);
|
||||
#else /* CONFIG_DISABLE_ES2015 */
|
||||
#else /* defined (JERRY_ES2015) || (JERRY_ES2015 == 0) */
|
||||
JERRY_ASSERT (ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
|
||||
#endif /* !CONFIG_DISABLE_ES2015 */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
|
||||
return ECMA_GET_NON_NULL_POINTER (ecma_object_t,
|
||||
object_p->property_list_or_bound_object_cp);
|
||||
@ -1588,11 +1588,11 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
re_compiled_code_t *re_bytecode_p = (re_compiled_code_t *) bytecode_p;
|
||||
|
||||
ecma_deref_ecma_string (ecma_get_string_from_value (re_bytecode_p->pattern));
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
}
|
||||
|
||||
jmem_heap_free_block (bytecode_p,
|
||||
|
||||
@ -137,17 +137,17 @@ typedef enum
|
||||
*/
|
||||
#define ECMA_BOOL_TO_BITFIELD(x) ((x) ? 1 : 0)
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/**
|
||||
* 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 /* CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
/**
|
||||
* JERRY_ASSERT compatible macro for checking whether the given ecma-value is symbol
|
||||
*/
|
||||
#define ECMA_ASSERT_VALUE_IS_SYMBOL(value) (false)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
/* ecma-helpers-value.c */
|
||||
bool JERRY_ATTR_CONST ecma_is_value_direct (ecma_value_t value);
|
||||
@ -166,9 +166,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);
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
bool JERRY_ATTR_CONST ecma_is_value_symbol (ecma_value_t value);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
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);
|
||||
@ -185,9 +185,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);
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
ecma_value_t JERRY_ATTR_PURE ecma_make_symbol_value (const ecma_string_t *ecma_symbol_p);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
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);
|
||||
@ -197,9 +197,9 @@ ecma_integer_value_t JERRY_ATTR_CONST ecma_get_integer_from_value (ecma_value_t
|
||||
ecma_number_t JERRY_ATTR_PURE ecma_get_float_from_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);
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
ecma_string_t JERRY_ATTR_PURE *ecma_get_symbol_from_value (ecma_value_t value);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
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);
|
||||
@ -218,10 +218,10 @@ 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 */
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
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);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
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);
|
||||
|
||||
@ -48,9 +48,9 @@ ecma_init (void)
|
||||
JERRY_CONTEXT (vm_recursion_counter) = VM_RECURSION_LIMIT;
|
||||
#endif /* VM_RECURSION_LIMIT */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
ecma_job_queue_init ();
|
||||
#endif /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
} /* ecma_init */
|
||||
|
||||
/**
|
||||
@ -61,9 +61,9 @@ ecma_finalize (void)
|
||||
{
|
||||
jmem_unregister_free_unused_memory_callback (ecma_free_unused_memory);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_MODULE_SYSTEM
|
||||
#if ENABLED (JERRY_ES2015_MODULE_SYSTEM)
|
||||
ecma_module_finalize_lex_envs ();
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MODULE_SYSTEM */
|
||||
#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */
|
||||
|
||||
ecma_finalize_global_lex_env ();
|
||||
ecma_finalize_builtins ();
|
||||
|
||||
@ -57,9 +57,9 @@ ecma_free_string_list (ecma_lit_storage_item_t *string_list_p) /**< string list
|
||||
void
|
||||
ecma_finalize_lit_storage (void)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
ecma_free_string_list (JERRY_CONTEXT (symbol_list_first_p));
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
ecma_free_string_list (JERRY_CONTEXT (string_list_first_p));
|
||||
ecma_free_string_list (JERRY_CONTEXT (number_list_first_p));
|
||||
} /* ecma_finalize_lit_storage */
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
#include "ecma-module.h"
|
||||
#include "vm.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_MODULE_SYSTEM
|
||||
#if ENABLED (JERRY_ES2015_MODULE_SYSTEM)
|
||||
|
||||
/**
|
||||
* Check if property is exported from the script.
|
||||
@ -255,4 +255,4 @@ ecma_module_load_modules (parser_context_t *context_p) /**< parser context */
|
||||
}
|
||||
} /* ecma_module_load_modules */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MODULE_SYSTEM */
|
||||
#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */
|
||||
|
||||
@ -18,10 +18,10 @@
|
||||
|
||||
#include "js-parser-internal.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_MODULE_SYSTEM
|
||||
#if ENABLED (JERRY_ES2015_MODULE_SYSTEM)
|
||||
|
||||
void ecma_module_load_modules (parser_context_t *context_p);
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MODULE_SYSTEM */
|
||||
#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */
|
||||
|
||||
#endif /* !ECMA_MODULE_H */
|
||||
|
||||
@ -18,11 +18,11 @@
|
||||
#include "ecma-iterator-object.h"
|
||||
#include "ecma-typedarray-object.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
|
||||
|
||||
#ifdef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if !ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
#error "Iterator builtin requires ES2015 symbol builtin"
|
||||
#endif /* CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* !ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -84,14 +84,14 @@ ecma_builtin_array_iterator_prototype_object_next (ecma_value_t this_val) /**< t
|
||||
uint32_t length;
|
||||
|
||||
/* 8 - 9. */
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
if (ecma_is_typedarray (ecma_make_object_value (array_object_p)))
|
||||
{
|
||||
length = ecma_typedarray_get_length (array_object_p);
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
ecma_value_t len_value = ecma_op_object_get (array_object_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_LENGTH));
|
||||
|
||||
@ -112,9 +112,9 @@ ecma_builtin_array_iterator_prototype_object_next (ecma_value_t this_val) /**< t
|
||||
length = ecma_number_to_uint32 (length_number);
|
||||
|
||||
ecma_free_value (len_value);
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
uint32_t index = ext_obj_p->u.pseudo_array.u1.iterator_index;
|
||||
|
||||
@ -205,4 +205,4 @@ ecma_builtin_array_iterator_prototype_object_next (ecma_value_t this_val) /**< t
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
|
||||
|
||||
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 /* !CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ARRAY)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -229,17 +229,17 @@ ecma_builtin_array_prototype_object_concat (const ecma_value_t args[], /**< argu
|
||||
ecma_object_t *obj_p) /**< array object */
|
||||
{
|
||||
/* 2. */
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
ecma_value_t new_array = ecma_op_create_array_object_by_constructor (NULL, 0, false, obj_p);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (new_array))
|
||||
{
|
||||
return new_array;
|
||||
}
|
||||
#else /* CONFIG_DISABLE_ES2015_CLASS */
|
||||
#else /* !ENABLED (JERRY_ES2015_CLASS) */
|
||||
ecma_value_t new_array = ecma_op_create_array_object (NULL, 0, false);
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
|
||||
uint32_t new_length = 0;
|
||||
@ -739,17 +739,17 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */
|
||||
|
||||
JERRY_ASSERT (start <= len && end <= len);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
ecma_value_t new_array = ecma_op_create_array_object_by_constructor (NULL, 0, false, obj_p);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (new_array))
|
||||
{
|
||||
return new_array;
|
||||
}
|
||||
#else /* CONFIG_DISABLE_ES2015_CLASS */
|
||||
#else /* !ENABLED (JERRY_ES2015_CLASS) */
|
||||
ecma_value_t new_array = ecma_op_create_array_object (NULL, 0, false);
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
|
||||
|
||||
@ -1049,17 +1049,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 */
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
ecma_value_t new_array = ecma_op_create_array_object_by_constructor (NULL, 0, false, obj_p);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (new_array))
|
||||
{
|
||||
return new_array;
|
||||
}
|
||||
#else /* CONFIG_DISABLE_ES2015_CLASS */
|
||||
#else /* !ENABLED (JERRY_ES2015_CLASS) */
|
||||
ecma_value_t new_array = ecma_op_create_array_object (NULL, 0, false);
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
|
||||
|
||||
@ -1688,17 +1688,17 @@ ecma_builtin_array_prototype_object_map (ecma_value_t arg1, /**< callbackfn */
|
||||
}
|
||||
|
||||
/* 6. */
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
ecma_value_t new_array = ecma_op_create_array_object_by_constructor (NULL, 0, false, obj_p);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (new_array))
|
||||
{
|
||||
return new_array;
|
||||
}
|
||||
#else /* CONFIG_DISABLE_ES2015_CLASS */
|
||||
#else /* !ENABLED (JERRY_ES2015_CLASS) */
|
||||
ecma_value_t new_array = ecma_op_create_array_object (NULL, 0, false);
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
|
||||
|
||||
@ -1780,17 +1780,17 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t arg1, /**< callbackfn *
|
||||
}
|
||||
|
||||
/* 6. */
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
ecma_value_t new_array = ecma_op_create_array_object_by_constructor (NULL, 0, false, obj_p);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (new_array))
|
||||
{
|
||||
return new_array;
|
||||
}
|
||||
#else /* CONFIG_DISABLE_ES2015_CLASS */
|
||||
#else /* !ENABLED (JERRY_ES2015_CLASS) */
|
||||
ecma_value_t new_array = ecma_op_create_array_object (NULL, 0, false);
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
|
||||
|
||||
@ -1992,7 +1992,7 @@ ecma_builtin_array_reduce_from (ecma_value_t callbackfn, /**< routine's 1st argu
|
||||
return ret_value;
|
||||
} /* ecma_builtin_array_reduce_from */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN)
|
||||
/**
|
||||
* The Array.prototype object's 'find' routine
|
||||
*
|
||||
@ -2061,9 +2061,9 @@ ecma_builtin_array_prototype_object_find (ecma_value_t predicate, /**< callback
|
||||
|
||||
return ret_value;
|
||||
} /* ecma_builtin_array_prototype_object_find */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
|
||||
/**
|
||||
* Helper function for Array.prototype object's {'keys', 'values', 'entries', '@@iterator'}
|
||||
* routines common parts.
|
||||
@ -2092,7 +2092,7 @@ ecma_builtin_array_iterators_helper (ecma_object_t *obj_p, /**< array object */
|
||||
ECMA_PSEUDO_ARRAY_ITERATOR,
|
||||
type);
|
||||
} /* ecma_builtin_array_iterators_helper */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
|
||||
|
||||
/**
|
||||
* Dispatcher of the built-in's routines
|
||||
@ -2137,7 +2137,7 @@ ecma_builtin_array_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
|
||||
if (JERRY_UNLIKELY (builtin_routine_id >= ECMA_ARRAY_PROTOTYPE_ENTRIES
|
||||
&& builtin_routine_id <= ECMA_ARRAY_PROTOTYPE_SYMBOL_ITERATOR))
|
||||
{
|
||||
@ -2162,7 +2162,7 @@ ecma_builtin_array_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
|
||||
ecma_deref_object (obj_p);
|
||||
return ret_value;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
|
||||
|
||||
ecma_value_t len_value = ecma_op_object_get_by_magic_id (obj_p, LIT_MAGIC_STRING_LENGTH);
|
||||
|
||||
@ -2300,7 +2300,7 @@ ecma_builtin_array_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
|
||||
length);
|
||||
break;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN)
|
||||
case ECMA_ARRAY_PROTOTYPE_FIND:
|
||||
{
|
||||
ret_value = ecma_builtin_array_prototype_object_find (routine_arg_1,
|
||||
@ -2309,7 +2309,7 @@ ecma_builtin_array_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
|
||||
length);
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN) */
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (builtin_routine_id == ECMA_ARRAY_PROTOTYPE_FILTER);
|
||||
@ -2334,4 +2334,4 @@ ecma_builtin_array_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ARRAY) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ARRAY)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@ -62,16 +62,16 @@ 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, NON_FIXED, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_REDUCE_RIGHT_UL, ECMA_ARRAY_PROTOTYPE_REDUCE_RIGHT, NON_FIXED, 1)
|
||||
#ifndef CONFIG_DISABLE_ES2015_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN)
|
||||
ROUTINE (LIT_MAGIC_STRING_FIND, ECMA_ARRAY_PROTOTYPE_FIND, 2, 1)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
|
||||
ROUTINE (LIT_MAGIC_STRING_ENTRIES, ECMA_ARRAY_PROTOTYPE_ENTRIES, 0, 0)
|
||||
ROUTINE (LIT_MAGIC_STRING_VALUES, ECMA_ARRAY_PROTOTYPE_VALUES, 0, 0)
|
||||
ROUTINE (LIT_MAGIC_STRING_KEYS, ECMA_ARRAY_PROTOTYPE_KEYS, 0, 0)
|
||||
ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ECMA_ARRAY_PROTOTYPE_SYMBOL_ITERATOR, 0, 0)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ARRAY) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ARRAY)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -107,4 +107,4 @@ ecma_builtin_array_dispatch_construct (const ecma_value_t *arguments_list_p, /**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ARRAY) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ARRAY)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@ -41,6 +41,6 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
|
||||
* (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)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN */
|
||||
#endif /* !(ENABLED (JERRY_BUILTIN_ARRAY)) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
#include "jrt.h"
|
||||
#include "jrt-libc-includes.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -143,4 +143,4 @@ ecma_builtin_arraybuffer_prototype_object_slice (ecma_value_t this_arg, /**< thi
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_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_FIXED)
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/* 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 /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
/* 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 /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -100,4 +100,4 @@ ecma_builtin_arraybuffer_dispatch_construct (const ecma_value_t *arguments_list_
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@ -41,6 +41,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
/* ES2015 24.1.3.1 */
|
||||
ROUTINE (LIT_MAGIC_STRING_IS_VIEW_UL, ecma_builtin_arraybuffer_object_is_view, 1, 1)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_BOOLEAN)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -117,4 +117,4 @@ ecma_builtin_boolean_prototype_object_value_of (ecma_value_t this_arg) /**< this
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_BOOLEAN) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_BOOLEAN)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@ -34,6 +34,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
|
||||
ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_boolean_prototype_object_to_string, 0, 0)
|
||||
ROUTINE (LIT_MAGIC_STRING_VALUE_OF_UL, ecma_builtin_boolean_prototype_object_value_of, 0, 0)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_BOOLEAN) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_BOOLEAN)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -96,4 +96,4 @@ ecma_builtin_boolean_dispatch_construct (const ecma_value_t *arguments_list_p, /
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_BOOLEAN) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_BOOLEAN)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@ -37,6 +37,6 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
|
||||
1,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_BOOLEAN) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
#include "ecma-objects.h"
|
||||
#include "ecma-try-catch-macro.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_DATE_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_DATE)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -49,10 +49,10 @@ enum
|
||||
|
||||
ECMA_DATE_PROTOTYPE_GET_FULL_YEAR, /* ECMA-262 v5 15.9.5.10 */
|
||||
ECMA_DATE_PROTOTYPE_GET_UTC_FULL_YEAR, /* ECMA-262 v5 15.9.5.11 */
|
||||
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
ECMA_DATE_PROTOTYPE_GET_YEAR, /* ECMA-262 v5, AnnexB.B.2.4 */
|
||||
ECMA_DATE_PROTOTYPE_GET_UTC_YEAR, /* has no UTC variant */
|
||||
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
ECMA_DATE_PROTOTYPE_GET_MONTH, /* ECMA-262 v5 15.9.5.12 */
|
||||
ECMA_DATE_PROTOTYPE_GET_UTC_MONTH, /* ECMA-262 v5 15.9.5.13 */
|
||||
ECMA_DATE_PROTOTYPE_GET_DATE, /* ECMA-262 v5 15.9.5.14 */
|
||||
@ -72,10 +72,10 @@ enum
|
||||
|
||||
ECMA_DATE_PROTOTYPE_SET_FULL_YEAR, /* ECMA-262 v5, 15.9.5.40 */
|
||||
ECMA_DATE_PROTOTYPE_SET_UTC_FULL_YEAR, /* ECMA-262 v5, 15.9.5.41 */
|
||||
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
ECMA_DATE_PROTOTYPE_SET_YEAR, /* ECMA-262 v5, ECMA-262 v5, AnnexB.B.2.5 */
|
||||
ECMA_DATE_PROTOTYPE_SET_UTC_YEAR, /* has no UTC variant */
|
||||
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
ECMA_DATE_PROTOTYPE_SET_MONTH, /* ECMA-262 v5, 15.9.5.38 */
|
||||
ECMA_DATE_PROTOTYPE_SET_UTC_MONTH, /* ECMA-262 v5, 15.9.5.39 */
|
||||
ECMA_DATE_PROTOTYPE_SET_DATE, /* ECMA-262 v5, 15.9.5.36 */
|
||||
@ -199,18 +199,18 @@ ecma_builtin_date_prototype_dispatch_get (uint16_t builtin_routine_id, /**< buil
|
||||
{
|
||||
case ECMA_DATE_PROTOTYPE_GET_FULL_YEAR:
|
||||
case ECMA_DATE_PROTOTYPE_GET_UTC_FULL_YEAR:
|
||||
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
case ECMA_DATE_PROTOTYPE_GET_YEAR:
|
||||
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
{
|
||||
date_num = ecma_date_year_from_time (date_num);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
if (builtin_routine_id == ECMA_DATE_PROTOTYPE_GET_YEAR)
|
||||
{
|
||||
date_num -= 1900;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
|
||||
break;
|
||||
}
|
||||
@ -268,7 +268,7 @@ ecma_builtin_date_prototype_dispatch_get (uint16_t builtin_routine_id, /**< buil
|
||||
return ecma_make_number_value (date_num);
|
||||
} /* ecma_builtin_date_prototype_dispatch_get */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
|
||||
/**
|
||||
* Returns true, if the built-in id sets a year.
|
||||
@ -278,7 +278,7 @@ ecma_builtin_date_prototype_dispatch_get (uint16_t builtin_routine_id, /**< buil
|
||||
|| (builtin_routine_id) == ECMA_DATE_PROTOTYPE_SET_UTC_FULL_YEAR \
|
||||
|| (builtin_routine_id) == ECMA_DATE_PROTOTYPE_SET_YEAR)
|
||||
|
||||
#else /* CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
|
||||
/**
|
||||
* Returns true, if the built-in id sets a year.
|
||||
@ -287,7 +287,7 @@ ecma_builtin_date_prototype_dispatch_get (uint16_t builtin_routine_id, /**< buil
|
||||
((builtin_routine_id) == ECMA_DATE_PROTOTYPE_SET_FULL_YEAR \
|
||||
|| (builtin_routine_id) == ECMA_DATE_PROTOTYPE_SET_UTC_FULL_YEAR)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
|
||||
/**
|
||||
* Dispatch set date functions
|
||||
@ -312,9 +312,9 @@ ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< buil
|
||||
|
||||
switch (builtin_routine_id)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
case ECMA_DATE_PROTOTYPE_SET_YEAR:
|
||||
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
case ECMA_DATE_PROTOTYPE_SET_DATE:
|
||||
case ECMA_DATE_PROTOTYPE_SET_UTC_DATE:
|
||||
case ECMA_DATE_PROTOTYPE_SET_UTC_MILLISECONDS:
|
||||
@ -406,7 +406,7 @@ ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< buil
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
case ECMA_DATE_PROTOTYPE_SET_YEAR:
|
||||
{
|
||||
year = converted_number[0];
|
||||
@ -416,7 +416,7 @@ ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< buil
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
case ECMA_DATE_PROTOTYPE_SET_MONTH:
|
||||
case ECMA_DATE_PROTOTYPE_SET_UTC_MONTH:
|
||||
{
|
||||
@ -439,7 +439,7 @@ ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< buil
|
||||
|
||||
day_part = ecma_date_make_day (year, month, day);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
if (builtin_routine_id == ECMA_DATE_PROTOTYPE_SET_YEAR)
|
||||
{
|
||||
builtin_routine_id = ECMA_DATE_PROTOTYPE_SET_UTC_YEAR;
|
||||
@ -450,7 +450,7 @@ ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< buil
|
||||
time_part = converted_number[0];
|
||||
}
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -656,4 +656,4 @@ ecma_builtin_date_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATE) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_DATE_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_DATE)
|
||||
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
|
||||
ECMA_BUILTIN_ID_DATE,
|
||||
@ -69,14 +69,14 @@ ROUTINE (LIT_MAGIC_STRING_TO_UTC_STRING_UL, ECMA_DATE_PROTOTYPE_TO_UTC_STRING, 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)
|
||||
|
||||
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
|
||||
ROUTINE (LIT_MAGIC_STRING_GET_YEAR_UL, ECMA_DATE_PROTOTYPE_GET_YEAR, 0, 0)
|
||||
ROUTINE (LIT_MAGIC_STRING_SET_YEAR_UL, ECMA_DATE_PROTOTYPE_SET_YEAR, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_TO_GMT_STRING_UL, ECMA_DATE_PROTOTYPE_TO_UTC_STRING, 0, 0)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATE) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "lit-char-helpers.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_DATE_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_DATE)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -571,4 +571,4 @@ ecma_builtin_date_dispatch_construct (const ecma_value_t *arguments_list_p, /**<
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATE) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_DATE_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_DATE)
|
||||
|
||||
/* ECMA-262 v5, 15.9.4.1 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
@ -34,6 +34,6 @@ 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)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATE) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -34,4 +34,4 @@
|
||||
#define BUILTIN_UNDERSCORED_ID eval_error_prototype
|
||||
#include "ecma-builtin-internal-routines-template.inc.h"
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@ -39,6 +39,6 @@ STRING_VALUE (LIT_MAGIC_STRING_MESSAGE,
|
||||
LIT_MAGIC_STRING__EMPTY,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -74,4 +74,4 @@ ecma_builtin_eval_error_dispatch_construct (const ecma_value_t *arguments_list_p
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@ -37,6 +37,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -1079,7 +1079,7 @@ ecma_builtin_global_object_encode_uri_component (ecma_value_t this_arg, /**< thi
|
||||
return ecma_builtin_global_object_encode_uri_helper (uri_component, unescaped_uri_component_set);
|
||||
} /* ecma_builtin_global_object_encode_uri_component */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
|
||||
/**
|
||||
* Maximum value of a byte.
|
||||
@ -1327,7 +1327,7 @@ ecma_builtin_global_object_unescape (ecma_value_t this_arg, /**< this argument *
|
||||
return ret_value;
|
||||
} /* ecma_builtin_global_object_unescape */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@ -54,53 +54,53 @@ OBJECT_VALUE (LIT_MAGIC_STRING_FUNCTION_UL,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
/* ECMA-262 v5, 15.1.4.3 */
|
||||
#ifndef CONFIG_DISABLE_ARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ARRAY)
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_ARRAY_UL,
|
||||
ECMA_BUILTIN_ID_ARRAY,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN*/
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ARRAY) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_STRING_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_STRING)
|
||||
/* ECMA-262 v5, 15.1.4.4 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_STRING_UL,
|
||||
ECMA_BUILTIN_ID_STRING,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* !CONFIG_DISABLE_STRING_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_STRING) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_BOOLEAN)
|
||||
/* ECMA-262 v5, 15.1.4.5 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_BOOLEAN_UL,
|
||||
ECMA_BUILTIN_ID_BOOLEAN,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_BOOLEAN) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_NUMBER_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_NUMBER)
|
||||
/* ECMA-262 v5, 15.1.4.6 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_NUMBER_UL,
|
||||
ECMA_BUILTIN_ID_NUMBER,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* !CONFIG_DISABLE_NUMBER_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_NUMBER) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_DATE_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_DATE)
|
||||
/* ECMA-262 v5, 15.1.4.7 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_DATE_UL,
|
||||
ECMA_BUILTIN_ID_DATE,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATE) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
/* ECMA-262 v5, 15.1.4.8 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_REGEXP_UL,
|
||||
ECMA_BUILTIN_ID_REGEXP,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
|
||||
/* ECMA-262 v5, 15.1.4.9 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_ERROR,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
/* ECMA-262 v5, 15.1.4.10 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_EVAL_ERROR_UL,
|
||||
@ -131,23 +131,23 @@ OBJECT_VALUE (LIT_MAGIC_STRING_TYPE_ERROR_UL,
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_URI_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_URI_ERROR,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_MATH_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_MATH)
|
||||
/* ECMA-262 v5, 15.1.5.1 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_MATH_UL,
|
||||
ECMA_BUILTIN_ID_MATH,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* !CONFIG_DISABLE_MATH_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MATH) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_JSON_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_JSON)
|
||||
/* ECMA-262 v5, 15.1.5.2 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_JSON_U,
|
||||
ECMA_BUILTIN_ID_JSON,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* !CONFIG_DISABLE_JSON_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_JSON) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_ARRAY_BUFFER_UL,
|
||||
ECMA_BUILTIN_ID_ARRAYBUFFER,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
@ -180,37 +180,37 @@ OBJECT_VALUE (LIT_MAGIC_STRING_FLOAT32_ARRAY_UL,
|
||||
ECMA_BUILTIN_ID_FLOAT32ARRAY,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
|
||||
#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_FLOAT64_ARRAY_UL,
|
||||
ECMA_BUILTIN_ID_FLOAT64ARRAY,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
|
||||
#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL,
|
||||
ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_PROMISE_UL,
|
||||
ECMA_BUILTIN_ID_PROMISE,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_MAP_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_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 /* !CONFIG_DISABLE_ES2015_MAP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/* ECMA-262 v6, 19.4.1.1 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_SYMBOL_UL,
|
||||
ECMA_BUILTIN_ID_SYMBOL,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
/* Routine properties:
|
||||
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
|
||||
@ -225,9 +225,9 @@ ROUTINE (LIT_MAGIC_STRING_ENCODE_URI, ecma_builtin_global_object_encode_uri, 1,
|
||||
ROUTINE (LIT_MAGIC_STRING_ENCODE_URI_COMPONENT, ecma_builtin_global_object_encode_uri_component, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_PARSE_INT, ecma_builtin_global_object_parse_int, 2, 2)
|
||||
|
||||
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
ROUTINE (LIT_MAGIC_STRING_ESCAPE, ecma_builtin_global_object_escape, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_UNESCAPE, ecma_builtin_global_object_unescape, 1, 1)
|
||||
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "lit-char-helpers.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_DATE_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_DATE)
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
@ -823,4 +823,4 @@ ecma_date_value_to_time_string (ecma_number_t datetime_number) /**<datetime */
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATE) */
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
#include "ecma-builtin-helpers.h"
|
||||
#include "lit-char-helpers.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_JSON_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_JSON)
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
@ -223,7 +223,7 @@ ecma_builtin_helper_json_create_non_formatted_json (lit_utf8_byte_t left_bracket
|
||||
return ecma_make_string_value (result_str_p);
|
||||
} /* ecma_builtin_helper_json_create_non_formatted_json */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_JSON_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_JSON) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@ -25,11 +25,11 @@
|
||||
#define STRING_VALUE(name, magic_string_id, prop_attributes)
|
||||
#endif /* !STRING_VALUE */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
#ifndef SYMBOL_VALUE
|
||||
#define SYMBOL_VALUE(name, desc_string_id)
|
||||
#endif /* !SYMBOL_VALUE */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
#ifndef OBJECT_VALUE
|
||||
#define OBJECT_VALUE(name, obj_builtin_id, prop_attributes)
|
||||
|
||||
@ -16,9 +16,9 @@
|
||||
#undef SIMPLE_VALUE
|
||||
#undef NUMBER_VALUE
|
||||
#undef STRING_VALUE
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
#undef SYMBOL_VALUE
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
#undef OBJECT_VALUE
|
||||
#undef ROUTINE
|
||||
#undef ROUTINE_CONFIGURABLE_ONLY
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/**
|
||||
* Helper function for Object.prototype.toString routine when
|
||||
* the @@toStringTag property is present
|
||||
@ -96,7 +96,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 /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
/**
|
||||
* Common implementation of the Object.prototype.toString routine
|
||||
@ -140,7 +140,7 @@ ecma_builtin_helper_object_to_string (const ecma_value_t this_arg) /**< this arg
|
||||
|
||||
type_string = ecma_object_get_class_name (obj_p);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
ecma_value_t tag_value = ecma_op_object_get_by_symbol_id (obj_p, LIT_MAGIC_STRING_TO_STRING_TAG);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (tag_value))
|
||||
@ -156,7 +156,7 @@ ecma_builtin_helper_object_to_string (const ecma_value_t this_arg) /**< this arg
|
||||
}
|
||||
|
||||
ecma_free_value (tag_value);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
ecma_deref_object (obj_p);
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ ecma_value_t
|
||||
ecma_builtin_helper_def_prop (ecma_object_t *obj_p, ecma_string_t *index_p, ecma_value_t value,
|
||||
uint32_t opts, bool is_throw);
|
||||
|
||||
#ifndef CONFIG_DISABLE_DATE_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_DATE)
|
||||
|
||||
/**
|
||||
* Time range defines for helper functions.
|
||||
@ -118,8 +118,9 @@ ecma_value_t ecma_date_value_to_iso_string (ecma_number_t datetime_number);
|
||||
ecma_value_t ecma_date_value_to_date_string (ecma_number_t datetime_number);
|
||||
ecma_value_t ecma_date_value_to_time_string (ecma_number_t datetime_number);
|
||||
|
||||
#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_DATE) */
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_JSON)
|
||||
/* ecma-builtin-helper-json.c */
|
||||
|
||||
/**
|
||||
@ -165,6 +166,7 @@ ecma_builtin_helper_json_create_formatted_json (lit_utf8_byte_t left_bracket, li
|
||||
ecma_value_t
|
||||
ecma_builtin_helper_json_create_non_formatted_json (lit_utf8_byte_t left_bracket, lit_utf8_byte_t right_bracket,
|
||||
ecma_collection_header_t *partial_p);
|
||||
#endif /* ENABLED (JERRY_BUILTIN_JSON) */
|
||||
|
||||
/* ecma-builtin-helper-error.c */
|
||||
|
||||
|
||||
@ -142,7 +142,7 @@ const ecma_builtin_property_descriptor_t PROPERTY_DESCRIPTOR_LIST_NAME[] =
|
||||
prop_attributes, \
|
||||
magic_string_id \
|
||||
},
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
#define SYMBOL_VALUE(name, desc_string_id) \
|
||||
{ \
|
||||
name, \
|
||||
@ -150,7 +150,7 @@ const ecma_builtin_property_descriptor_t PROPERTY_DESCRIPTOR_LIST_NAME[] =
|
||||
ECMA_PROPERTY_FIXED, \
|
||||
desc_string_id \
|
||||
},
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
#define ACCESSOR_READ_WRITE(name, c_getter_name, c_setter_name, prop_attributes) \
|
||||
{ \
|
||||
name, \
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
#include "ecma-builtins.h"
|
||||
#include "ecma-iterator-object.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
|
||||
|
||||
#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 /* !CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
|
||||
|
||||
@ -19,12 +19,12 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
|
||||
|
||||
/* 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 /* !CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
#include "lit-char-helpers.h"
|
||||
#include "lit-globals.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_JSON_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_JSON)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -1818,4 +1818,4 @@ ecma_builtin_json_array (ecma_object_t *obj_p, /**< the array object*/
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_JSON_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_JSON) */
|
||||
|
||||
@ -19,20 +19,20 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_JSON_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_JSON)
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/* ECMA-262 v6, 24.3.3 */
|
||||
STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
|
||||
LIT_MAGIC_STRING_JSON_U,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
/* Routine properties:
|
||||
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
|
||||
ROUTINE (LIT_MAGIC_STRING_PARSE, ecma_builtin_json_parse, 2, 2)
|
||||
ROUTINE (LIT_MAGIC_STRING_STRINGIFY, ecma_builtin_json_stringify, 3, 3)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_JSON_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_JSON) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
#include "ecma-map-object.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_MAP_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -135,4 +135,4 @@ ecma_builtin_map_prototype_object_size_getter (ecma_value_t this_arg) /**< this
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MAP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_MAP_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_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)
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/* 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 /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
/* Routine properties:
|
||||
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
|
||||
@ -49,6 +49,6 @@ ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_SIZE,
|
||||
ecma_builtin_map_prototype_object_size_getter,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MAP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
#include "ecma-exceptions.h"
|
||||
#include "ecma-map-object.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_MAP_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -68,4 +68,4 @@ ecma_builtin_map_dispatch_construct (const ecma_value_t *arguments_list_p, /**<
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MAP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_MAP_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@ -42,6 +42,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_MAP_PROTOTYPE,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MAP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
#include "jrt.h"
|
||||
#include "jrt-libc-includes.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_MATH_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_MATH)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -371,4 +371,4 @@ ecma_builtin_math_dispatch_routine (uint16_t builtin_routine_id, /**< built-in w
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_MATH_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MATH) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_MATH_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_MATH)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@ -64,12 +64,12 @@ NUMBER_VALUE (LIT_MAGIC_STRING_SQRT2_U,
|
||||
ECMA_BUILTIN_NUMBER_SQRT2,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/* 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 /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
/* Routine properties:
|
||||
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
|
||||
@ -92,6 +92,6 @@ 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)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_MATH_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MATH) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
#include "jrt.h"
|
||||
#include "jrt-libc-includes.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_NUMBER_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_NUMBER)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -997,4 +997,4 @@ ecma_builtin_number_prototype_object_to_precision (ecma_value_t this_arg, /**< t
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_NUMBER_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_NUMBER) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_NUMBER_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_NUMBER)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@ -38,6 +38,6 @@ ROUTINE (LIT_MAGIC_STRING_TO_FIXED_UL, ecma_builtin_number_prototype_object_to_f
|
||||
ROUTINE (LIT_MAGIC_STRING_TO_EXPONENTIAL_UL, ecma_builtin_number_prototype_object_to_exponential, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_TO_PRECISION_UL, ecma_builtin_number_prototype_object_to_precision, 1, 1)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_NUMBER_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_NUMBER) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_NUMBER_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_NUMBER)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -97,4 +97,4 @@ ecma_builtin_number_dispatch_construct (const ecma_value_t *arguments_list_p, /*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_NUMBER_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_NUMBER) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_NUMBER_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_NUMBER)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@ -62,6 +62,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_NUMBER_PROTOTYPE,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_NUMBER_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_NUMBER) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -113,15 +113,15 @@ ecma_builtin_object_object_get_prototype_of (ecma_value_t this_arg, /**< 'this'
|
||||
/* 1. */
|
||||
if (!was_object)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN)
|
||||
arg = ecma_op_to_object (arg);
|
||||
if (ECMA_IS_VALUE_ERROR (arg))
|
||||
{
|
||||
return arg;
|
||||
}
|
||||
#else /* CONFIG_DISABLE_ES2015_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN) */
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
|
||||
#endif /* !CONFIG_DISABLE_ES2015_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN) */
|
||||
}
|
||||
/* 2. */
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (arg);
|
||||
@ -137,17 +137,17 @@ ecma_builtin_object_object_get_prototype_of (ecma_value_t this_arg, /**< 'this'
|
||||
ret_value = ECMA_VALUE_NULL;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN)
|
||||
if (!was_object)
|
||||
{
|
||||
ecma_free_value (arg);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN) */
|
||||
|
||||
return ret_value;
|
||||
} /* ecma_builtin_object_object_get_prototype_of */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN)
|
||||
/**
|
||||
* [[SetPrototypeOf]]
|
||||
*
|
||||
@ -269,7 +269,7 @@ ecma_builtin_object_object_set_prototype_of (ecma_value_t this_arg, /**< 'this'
|
||||
|
||||
return ret_value;
|
||||
} /* ecma_builtin_object_object_set_prototype_of */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN) */
|
||||
|
||||
/**
|
||||
* The Object object's 'getOwnPropertyNames' routine
|
||||
@ -302,7 +302,7 @@ ecma_builtin_object_object_get_own_property_names (ecma_value_t this_arg, /**< '
|
||||
return ret_value;
|
||||
} /* ecma_builtin_object_object_get_own_property_names */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/**
|
||||
* The Object object's 'getOwnPropertySymbols' routine
|
||||
*
|
||||
@ -329,7 +329,7 @@ ecma_builtin_object_object_get_own_property_symbols (ecma_value_t this_arg, /**<
|
||||
|
||||
return ecma_builtin_helper_object_get_properties (obj_p, ECMA_LIST_SYMBOLS);
|
||||
} /* ecma_builtin_object_object_get_own_property_symbols */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
/**
|
||||
* The Object object's 'seal' routine
|
||||
@ -949,7 +949,7 @@ ecma_builtin_object_object_define_property (ecma_value_t this_arg, /**< 'this' a
|
||||
return ret_value;
|
||||
} /* ecma_builtin_object_object_define_property */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN)
|
||||
/**
|
||||
* The Object object's 'assign' routine
|
||||
*
|
||||
@ -1067,7 +1067,7 @@ ecma_builtin_object_object_assign (ecma_value_t this_arg, /**< 'this' argument *
|
||||
ecma_deref_object (to_obj_p);
|
||||
return ret_value;
|
||||
} /* ecma_builtin_object_object_assign */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@ -39,9 +39,9 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
* (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_builtin_object_object_get_prototype_of, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_NAMES_UL, ecma_builtin_object_object_get_own_property_names, 1, 1)
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_SYMBOLS_UL, ecma_builtin_object_object_get_own_property_symbols, 1, 1)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
ROUTINE (LIT_MAGIC_STRING_SEAL, ecma_builtin_object_object_seal, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_FREEZE, ecma_builtin_object_object_freeze, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_PREVENT_EXTENSIONS_UL, ecma_builtin_object_object_prevent_extensions, 1, 1)
|
||||
@ -54,9 +54,9 @@ ROUTINE (LIT_MAGIC_STRING_CREATE, ecma_builtin_object_object_create, 2, 2)
|
||||
ROUTINE (LIT_MAGIC_STRING_DEFINE_PROPERTIES_UL, ecma_builtin_object_object_define_properties, 2, 2)
|
||||
ROUTINE (LIT_MAGIC_STRING_DEFINE_PROPERTY_UL, ecma_builtin_object_object_define_property, 3, 3)
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN)
|
||||
ROUTINE (LIT_MAGIC_STRING_SET_PROTOTYPE_OF_UL, ecma_builtin_object_object_set_prototype_of, 2, 2)
|
||||
ROUTINE (LIT_MAGIC_STRING_ASSIGN, ecma_builtin_object_object_assign, NON_FIXED, 2)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
#include "ecma-globals.h"
|
||||
#include "ecma-promise-object.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_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 /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@ -28,16 +28,16 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
|
||||
1,
|
||||
ECMA_PROPERTY_FLAG_WRITABLE)
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/* 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 /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
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 /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#include "ecma-promise-object.h"
|
||||
#include "jcontext.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -697,4 +697,4 @@ ecma_builtin_promise_dispatch_construct (const ecma_value_t *arguments_list_p, /
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@ -42,6 +42,6 @@ ROUTINE (LIT_MAGIC_STRING_RESOLVE, ecma_builtin_promise_resolve, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_RACE, ecma_builtin_promise_race, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_ALL, ecma_builtin_promise_all, 1, 1)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -34,4 +34,4 @@
|
||||
#define BUILTIN_UNDERSCORED_ID range_error_prototype
|
||||
#include "ecma-builtin-internal-routines-template.inc.h"
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@ -39,6 +39,6 @@ STRING_VALUE (LIT_MAGIC_STRING_MESSAGE,
|
||||
LIT_MAGIC_STRING__EMPTY,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -74,4 +74,4 @@ ecma_builtin_range_error_dispatch_construct (const ecma_value_t *arguments_list_
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@ -37,6 +37,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -34,4 +34,4 @@
|
||||
#define BUILTIN_UNDERSCORED_ID reference_error_prototype
|
||||
#include "ecma-builtin-internal-routines-template.inc.h"
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@ -39,6 +39,6 @@ STRING_VALUE (LIT_MAGIC_STRING_MESSAGE,
|
||||
LIT_MAGIC_STRING__EMPTY,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -74,4 +74,4 @@ ecma_builtin_reference_error_dispatch_construct (const ecma_value_t *arguments_l
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@ -37,6 +37,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "lit-char-helpers.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
#include "ecma-regexp-object.h"
|
||||
#include "re-compiler.h"
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
|
||||
/**
|
||||
* The RegExp.prototype object's 'compile' routine
|
||||
@ -216,7 +216,7 @@ ecma_builtin_regexp_prototype_compile (ecma_value_t this_arg, /**< this argument
|
||||
return ECMA_VALUE_UNDEFINED;
|
||||
} /* ecma_builtin_regexp_prototype_compile */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
|
||||
/**
|
||||
* The RegExp.prototype object's 'exec' routine
|
||||
@ -398,4 +398,4 @@ ecma_builtin_regexp_prototype_to_string (ecma_value_t this_arg) /**< this argume
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
|
||||
/* ECMA-262 v5, 15.10.6.1 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
|
||||
@ -51,13 +51,13 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LASTINDEX_UL,
|
||||
0,
|
||||
ECMA_PROPERTY_FLAG_WRITABLE)
|
||||
|
||||
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
ROUTINE (LIT_MAGIC_STRING_COMPILE, ecma_builtin_regexp_prototype_compile, 2, 1)
|
||||
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
ROUTINE (LIT_MAGIC_STRING_EXEC, ecma_builtin_regexp_prototype_exec, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_TEST, ecma_builtin_regexp_prototype_test, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_regexp_prototype_to_string, 0, 0)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
#include "ecma-regexp-object.h"
|
||||
#include "ecma-try-catch-macro.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -132,4 +132,4 @@ ecma_builtin_regexp_dispatch_construct (const ecma_value_t *arguments_list_p, /*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
|
||||
/* ECMA-262 v5, 15.10.5 */
|
||||
NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
|
||||
@ -31,6 +31,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_REGEXP_PROTOTYPE,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -31,11 +31,11 @@
|
||||
#include "jrt-libc-includes.h"
|
||||
#include "lit-char-helpers.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
#include "ecma-regexp-object.h"
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_STRING_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_STRING)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -360,7 +360,7 @@ ecma_builtin_string_prototype_object_locale_compare (ecma_value_t this_arg, /**<
|
||||
return ret_value;
|
||||
} /* ecma_builtin_string_prototype_object_locale_compare */
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
|
||||
/**
|
||||
* The common preparation code for 'search' and 'match' functions
|
||||
@ -1336,7 +1336,7 @@ ecma_builtin_string_prototype_object_search (ecma_value_t this_arg, /**< this ar
|
||||
return ret_value;
|
||||
} /* ecma_builtin_string_prototype_object_search */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
|
||||
/**
|
||||
* The String.prototype object's 'slice' routine
|
||||
@ -1510,7 +1510,7 @@ ecma_builtin_string_prototype_object_split (ecma_value_t this_arg, /**< this arg
|
||||
|
||||
if (separator_is_regexp)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
ecma_value_t regexp_value = ecma_copy_value_if_not_object (separator);
|
||||
ecma_value_t match_result;
|
||||
match_result = ecma_regexp_exec_helper (regexp_value,
|
||||
@ -1524,9 +1524,9 @@ ecma_builtin_string_prototype_object_split (ecma_value_t this_arg, /**< this arg
|
||||
}
|
||||
|
||||
ecma_free_value (match_result);
|
||||
#else
|
||||
#else /* !ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("REGEXP separator is disabled in split method."));
|
||||
#endif
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1576,14 +1576,14 @@ ecma_builtin_string_prototype_object_split (ecma_value_t this_arg, /**< this arg
|
||||
|
||||
if (separator_is_regexp)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
ecma_value_t regexp_value = ecma_copy_value_if_not_object (separator);
|
||||
ecma_string_t *substr_str_p = ecma_string_substr (this_to_string_p, curr_pos, string_length);
|
||||
match_result = ecma_regexp_exec_helper (regexp_value, ecma_make_string_value (substr_str_p), true);
|
||||
ecma_deref_ecma_string (substr_str_p);
|
||||
#else
|
||||
#else /* !ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("REGEXP separator is disabled in split method."));
|
||||
#endif
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2094,7 +2094,7 @@ ecma_builtin_string_prototype_object_trim (ecma_value_t this_arg) /**< this argu
|
||||
return ret_value;
|
||||
} /* ecma_builtin_string_prototype_object_trim */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
|
||||
/**
|
||||
* The String.prototype object's 'substr' routine
|
||||
@ -2162,7 +2162,7 @@ ecma_builtin_string_prototype_object_substr (ecma_value_t this_arg, /**< this ar
|
||||
return ret_value;
|
||||
} /* ecma_builtin_string_prototype_object_substr */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
@ -2170,4 +2170,4 @@ ecma_builtin_string_prototype_object_substr (ecma_value_t this_arg, /**< this ar
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_STRING_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_STRING) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_STRING_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_STRING)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@ -49,11 +49,11 @@ ROUTINE (LIT_MAGIC_STRING_CHAR_AT_UL, ecma_builtin_string_prototype_object_char_
|
||||
ROUTINE (LIT_MAGIC_STRING_CHAR_CODE_AT_UL, ecma_builtin_string_prototype_object_char_code_at, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_LOCALE_COMPARE_UL, ecma_builtin_string_prototype_object_locale_compare, 1, 1)
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
ROUTINE (LIT_MAGIC_STRING_MATCH, ecma_builtin_string_prototype_object_match, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_REPLACE, ecma_builtin_string_prototype_object_replace, 2, 2)
|
||||
ROUTINE (LIT_MAGIC_STRING_SEARCH, ecma_builtin_string_prototype_object_search, 1, 1)
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
|
||||
ROUTINE (LIT_MAGIC_STRING_SPLIT, ecma_builtin_string_prototype_object_split, 2, 2)
|
||||
ROUTINE (LIT_MAGIC_STRING_SUBSTRING, ecma_builtin_string_prototype_object_substring, 2, 2)
|
||||
@ -63,10 +63,10 @@ ROUTINE (LIT_MAGIC_STRING_TO_UPPER_CASE_UL, ecma_builtin_string_prototype_object
|
||||
ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_UPPER_CASE_UL, ecma_builtin_string_prototype_object_to_locale_upper_case, 0, 0)
|
||||
ROUTINE (LIT_MAGIC_STRING_TRIM, ecma_builtin_string_prototype_object_trim, 0, 0)
|
||||
|
||||
#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ANNEXB)
|
||||
ROUTINE (LIT_MAGIC_STRING_SUBSTR, ecma_builtin_string_prototype_object_substr, 2, 2)
|
||||
#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_STRING_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_STRING) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -22,13 +22,13 @@
|
||||
#include "ecma-helpers.h"
|
||||
#include "ecma-objects.h"
|
||||
#include "ecma-string-object.h"
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
#include "ecma-symbol-object.h"
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_STRING_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_STRING)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -130,13 +130,13 @@ ecma_builtin_string_dispatch_call (const ecma_value_t *arguments_list_p, /**< ar
|
||||
{
|
||||
ret_value = ecma_make_magic_string_value (LIT_MAGIC_STRING__EMPTY);
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/* 2.a */
|
||||
else if (ecma_is_value_symbol (arguments_list_p[0]))
|
||||
{
|
||||
ret_value = ecma_get_symbol_descriptive_string (arguments_list_p[0]);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
/* 2.b */
|
||||
else
|
||||
{
|
||||
@ -166,4 +166,4 @@ ecma_builtin_string_dispatch_construct (const ecma_value_t *arguments_list_p, /*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_STRING_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_STRING) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_STRING_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_STRING)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@ -41,6 +41,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
|
||||
ROUTINE (LIT_MAGIC_STRING_FROM_CHAR_CODE_UL, ecma_builtin_string_object_from_char_code, NON_FIXED, 1)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_STRING_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_STRING) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -95,4 +95,4 @@ ecma_builtin_symbol_prototype_object_to_primitive (ecma_value_t this_arg) /**< t
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@ -44,6 +44,6 @@ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
|
||||
LIT_MAGIC_STRING_SYMBOL_UL,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
#include "jcontext.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -240,4 +240,4 @@ ecma_builtin_symbol_key_for (ecma_value_t this_arg, /**< this argument */
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@ -86,6 +86,6 @@ SYMBOL_VALUE (LIT_MAGIC_STRING_UNSCOPABLES,
|
||||
ROUTINE (LIT_MAGIC_STRING_FOR, ecma_builtin_symbol_for, 1, 1)
|
||||
ROUTINE (LIT_MAGIC_STRING_KEY_FOR, ecma_builtin_symbol_key_for, 1, 1)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -34,4 +34,4 @@
|
||||
#define BUILTIN_UNDERSCORED_ID syntax_error_prototype
|
||||
#include "ecma-builtin-internal-routines-template.inc.h"
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@ -39,6 +39,6 @@ STRING_VALUE (LIT_MAGIC_STRING_MESSAGE,
|
||||
LIT_MAGIC_STRING__EMPTY,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#endif /* CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -74,4 +74,4 @@ ecma_builtin_syntax_error_dispatch_construct (const ecma_value_t *arguments_list
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@ -37,6 +37,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -34,4 +34,4 @@
|
||||
#define BUILTIN_UNDERSCORED_ID type_error_prototype
|
||||
#include "ecma-builtin-internal-routines-template.inc.h"
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@ -39,6 +39,6 @@ STRING_VALUE (LIT_MAGIC_STRING_MESSAGE,
|
||||
LIT_MAGIC_STRING__EMPTY,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -74,4 +74,4 @@ ecma_builtin_type_error_dispatch_construct (const ecma_value_t *arguments_list_p
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
/* Number properties:
|
||||
* (property name, number value, writable, enumerable, configurable) */
|
||||
@ -37,6 +37,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -34,4 +34,4 @@
|
||||
#define BUILTIN_UNDERSCORED_ID uri_error_prototype
|
||||
#include "ecma-builtin-internal-routines-template.inc.h"
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "ecma-builtin-helpers-macro-defines.inc.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
/* Object properties:
|
||||
* (property name, object pointer getter) */
|
||||
@ -39,6 +39,6 @@ STRING_VALUE (LIT_MAGIC_STRING_MESSAGE,
|
||||
LIT_MAGIC_STRING__EMPTY,
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
#include "ecma-builtin-helpers-macro-undefs.inc.h"
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@ -74,4 +74,4 @@ ecma_builtin_uri_error_dispatch_construct (const ecma_value_t *arguments_list_p,
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user