Re-target for ES.Next (#3901)

A list of changes:
- 'es2015-subset' profile is deprecated, and an 'es.next' profile is added.
- The default profile is changed to 'es.next'
- Renamed the JERRY_ES2015 guard to JERRY_ESNEXT
- Renamed JERRY_ES2015_BUILTIN_* guards to JERRY_BUILTIN_*
- Moved es2015 specific tests to a new 'es.next' subdirectory
- Updated docs, targets, and test runners to reflect these changes

Resolves #3737.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
Dániel Bátyai
2020-06-12 17:55:00 +02:00
committed by GitHub
parent c0270c4887
commit fde0d556ac
832 changed files with 3053 additions and 3046 deletions
@@ -37,7 +37,7 @@
* @{
*/
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* Helper function for Object.prototype.toString routine when
* the @@toStringTag property is present
@@ -98,7 +98,7 @@ ecma_builtin_helper_object_to_string_tag_helper (ecma_value_t tag_value) /**< st
return ecma_make_string_value (ret_string_p);
} /* ecma_builtin_helper_object_to_string_tag_helper */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* Common implementation of the Object.prototype.toString routine
@@ -142,7 +142,7 @@ ecma_builtin_helper_object_to_string (const ecma_value_t this_arg) /**< this arg
type_string = ecma_object_get_class_name (obj_p);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_value_t tag_value = ecma_op_object_get_by_symbol_id (obj_p, LIT_GLOBAL_SYMBOL_TO_STRING_TAG);
if (ECMA_IS_VALUE_ERROR (tag_value))
@@ -158,7 +158,7 @@ ecma_builtin_helper_object_to_string (const ecma_value_t this_arg) /**< this arg
}
ecma_free_value (tag_value);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_deref_object (obj_p);
}
@@ -283,12 +283,12 @@ ecma_builtin_helper_object_get_properties (ecma_object_t *obj_p, /**< object */
ecma_collection_t *props_p = ecma_op_object_get_property_names (obj_p, opts);
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (props_p == NULL)
{
return ECMA_VALUE_ERROR;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
if (props_p->item_count == 0)
{
@@ -368,7 +368,7 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array *
ecma_value_t value) /**< value to concat */
{
/* 5.b */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_value_t is_spreadable = ecma_op_is_concat_spreadable (value);
if (ECMA_IS_VALUE_ERROR (is_spreadable))
@@ -377,15 +377,15 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array *
}
bool spread_object = is_spreadable == ECMA_VALUE_TRUE;
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
bool spread_object = ecma_is_value_true (ecma_is_value_array (value));
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
if (spread_object)
{
ecma_object_t *obj_p = ecma_get_object_from_value (value);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
uint32_t arg_len;
ecma_value_t error = ecma_op_object_get_length (obj_p, &arg_len);
@@ -393,10 +393,10 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array *
{
return error;
}
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
/* 5.b.ii */
uint32_t arg_len = ecma_array_get_length (obj_p);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/* 5.b.iii */
for (uint32_t array_index = 0; array_index < arg_len; array_index++)
{
@@ -519,7 +519,7 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
/* 5 (indexOf) -- 6 (lastIndexOf) */
const ecma_length_t original_len = ecma_string_get_length (original_str_p);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/* 4, 6 (startsWith, includes, endsWith) */
if (mode >= ECMA_STRING_STARTS_WITH)
{
@@ -536,7 +536,7 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
return ecma_raise_type_error (ECMA_ERR_MSG ("Search string can't be of type: RegExp"));
}
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/* 7, 8 */
ecma_string_t *search_str_p = ecma_op_to_string (arg1);
@@ -549,18 +549,18 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
/* 4 (indexOf, lastIndexOf), 9 (startsWith, includes), 10 (endsWith) */
ecma_number_t pos_num;
ecma_value_t ret_value;
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (mode > ECMA_STRING_LAST_INDEX_OF)
{
ret_value = ecma_op_to_integer (arg2, &pos_num);
}
else
{
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ret_value = ecma_get_number (arg2, &pos_num);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/* 10 (startsWith, includes), 11 (endsWith) */
if (ECMA_IS_VALUE_ERROR (ret_value))
@@ -582,7 +582,7 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
switch (mode)
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
case ECMA_STRING_STARTS_WITH:
{
const ecma_length_t search_len = ecma_string_get_length (search_str_p);
@@ -635,7 +635,7 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
}
break;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
case ECMA_STRING_INDEX_OF:
case ECMA_STRING_LAST_INDEX_OF:
@@ -883,7 +883,7 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
}
case LIT_CHAR_AMPERSAND:
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (JERRY_UNLIKELY (ctx_p->matched_p == NULL))
{
JERRY_ASSERT (ctx_p->capture_count == 0);
@@ -895,7 +895,7 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
ecma_stringbuilder_append (&(ctx_p->builder), ecma_get_string_from_value (match_value));
break;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
JERRY_ASSERT (ctx_p->matched_p != NULL);
ecma_stringbuilder_append_raw (&(ctx_p->builder), ctx_p->matched_p, ctx_p->matched_size);
@@ -908,7 +908,7 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
}
case LIT_CHAR_SINGLE_QUOTE:
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (JERRY_UNLIKELY (ctx_p->matched_p == NULL))
{
JERRY_ASSERT (ctx_p->capture_count == 0);
@@ -926,7 +926,7 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
(lit_utf8_size_t) (ctx_p->string_p + ctx_p->string_size - begin_p));
break;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
JERRY_ASSERT (ctx_p->matched_p != NULL);
ecma_stringbuilder_append_raw (&(ctx_p->builder),
@@ -941,12 +941,12 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
if (lit_char_is_decimal_digit (c))
{
uint32_t capture_count = ctx_p->capture_count;
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (capture_count == 0 && ctx_p->u.collection_p != NULL)
{
capture_count = ctx_p->u.collection_p->item_count;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
uint8_t idx = (uint8_t) (c - LIT_CHAR_0);
if (curr_p < replace_end_p && lit_char_is_decimal_digit (*(curr_p)))
@@ -977,7 +977,7 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
break;
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
else if (ctx_p->u.collection_p != NULL)
{
const ecma_value_t capture_value = ctx_p->u.collection_p->buffer_p[idx];
@@ -988,7 +988,7 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
break;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
}
}