From 99b061ad10ce607250fa4c302332bf3959e07647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20G=C3=A1l?= Date: Mon, 29 Jul 2019 14:29:21 +0200 Subject: [PATCH] Fix incorrect feature guard for class support (#2992) In `ecma-helpers.c` there was an incorrect macro guard which tested the `JERRY_ES2015` feature but the `JERRY_ES2015_CLASS` feature should be tested instead. Profile options for testing: * JERRY_ES2015=0 * JERRY_ES2015_CLASS=1 * JERRY_ES2015_OBJECT_INITIALIZER=1 JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com --- jerry-core/ecma/base/ecma-helpers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jerry-core/ecma/base/ecma-helpers.c b/jerry-core/ecma/base/ecma-helpers.c index 7c6d2689b..662a18e81 100644 --- a/jerry-core/ecma/base/ecma-helpers.c +++ b/jerry-core/ecma/base/ecma-helpers.c @@ -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)); -#if ENABLED (JERRY_ES2015) +#if ENABLED (JERRY_ES2015_CLASS) 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 /* defined (JERRY_ES2015) || (JERRY_ES2015 == 0) */ +#else /* !ENABLED (JERRY_ES2015_CLASS) */ JERRY_ASSERT (ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND); -#endif /* ENABLED (JERRY_ES2015) */ +#endif /* ENABLED (JERRY_ES2015_CLASS) */ return ECMA_GET_NON_NULL_POINTER (ecma_object_t, object_p->property_list_or_bound_object_cp);