diff --git a/jerry-core/lit/lit-char-helpers.c b/jerry-core/lit/lit-char-helpers.c index 85bb2a323..0c0a0995d 100644 --- a/jerry-core/lit/lit-char-helpers.c +++ b/jerry-core/lit/lit-char-helpers.c @@ -137,14 +137,20 @@ lit_char_is_white_space (lit_code_point_t c) /**< code point */ return (c == LIT_CHAR_SP || (c >= LIT_CHAR_TAB && c <= LIT_CHAR_CR)); } - if (c == LIT_CHAR_NBSP || c == LIT_CHAR_BOM || c == LIT_CHAR_LS || c == LIT_CHAR_PS) + if (c == LIT_CHAR_BOM +#if !ENABLED (JERRY_ESNEXT) + /* Mongolian Vowel Separator (u180e) used to be a whitespace character. */ + || c == LIT_CHAR_MVS +#endif /* !ENABLED (JERRY_ESNEXT) */ + || c == LIT_CHAR_LS + || c == LIT_CHAR_PS) { return true; } return (c <= LIT_UTF16_CODE_UNIT_MAX && ((c >= lit_unicode_white_space_interval_starts[0] - && c < lit_unicode_white_space_interval_starts[0] + lit_unicode_white_space_interval_lengths[0]) + && c <= lit_unicode_white_space_interval_starts[0] + lit_unicode_white_space_interval_lengths[0]) || lit_search_char_in_array ((ecma_char_t) c, lit_unicode_white_space_chars, NUM_OF_ELEMENTS (lit_unicode_white_space_chars)))); diff --git a/jerry-core/lit/lit-char-helpers.h b/jerry-core/lit/lit-char-helpers.h index 2a39f22de..e4e0c7ee7 100644 --- a/jerry-core/lit/lit-char-helpers.h +++ b/jerry-core/lit/lit-char-helpers.h @@ -43,6 +43,7 @@ #define LIT_CHAR_FF ((ecma_char_t) 0x000C) /* form feed */ #define LIT_CHAR_SP ((ecma_char_t) 0x0020) /* space */ #define LIT_CHAR_NBSP ((ecma_char_t) 0x00A0) /* no-break space */ +#define LIT_CHAR_MVS ((ecma_char_t) 0x180E) /* mongolian vowel separator */ /* LIT_CHAR_BOM is defined above */ bool lit_char_is_white_space (lit_code_point_t c); diff --git a/jerry-core/lit/lit-unicode-ranges.inc.h b/jerry-core/lit/lit-unicode-ranges.inc.h index de34c3d5e..24526c4d1 100644 --- a/jerry-core/lit/lit-unicode-ranges.inc.h +++ b/jerry-core/lit/lit-unicode-ranges.inc.h @@ -201,7 +201,6 @@ static const uint16_t lit_unicode_id_continue_chars[] JERRY_ATTR_CONST_DATA = 0xaa43, 0xaab0, 0xaac1, 0xfb1e, 0xff3f }; -#if ENABLED (JERRY_ESNEXT) /** * Character interval starting points for White_Space. */ @@ -225,30 +224,3 @@ static const uint16_t lit_unicode_white_space_chars[] JERRY_ATTR_CONST_DATA = { 0x00a0, 0x1680, 0x202f, 0x205f, 0x3000 }; - -#else /* !ENABLED (JERRY_ESNEXT) */ -/** - * Character interval starting points for White_Space. - */ -static const uint16_t lit_unicode_white_space_interval_starts[] JERRY_ATTR_CONST_DATA = -{ - 0x2000 -}; - -/** - * Character interval lengths for White_Space. - */ -static const uint8_t lit_unicode_white_space_interval_lengths[] JERRY_ATTR_CONST_DATA = -{ - 0x000b -}; - -/** - * Non-interval characters for White_Space. - */ -static const uint16_t lit_unicode_white_space_chars[] JERRY_ATTR_CONST_DATA = -{ - 0x1680, 0x180e, 0x202f, 0x205f, 0x3000 -}; - -#endif /* ENABLED (JERRY_ESNEXT) */ diff --git a/tests/jerry/string-prototype-trim.js b/tests/jerry/string-prototype-trim.js index 689d9d33e..640207e4e 100644 --- a/tests/jerry/string-prototype-trim.js +++ b/tests/jerry/string-prototype-trim.js @@ -87,3 +87,5 @@ assert("\u0009\u000B\u000C\u0020\u00A01\u0009\u000B\u000C\u0020\u00A0".trim() == assert("\u000A\u000D\u2028\u202911\u000A\u000D\u2028\u2029".trim() === "11"); assert ("\u200B".trim() === '\u200B') +assert ("\u200A".trim() === '') +assert ("\u00A0".trim() === '') diff --git a/tests/test262-esnext-excludelist.xml b/tests/test262-esnext-excludelist.xml index ae665cb12..234a6a712 100644 --- a/tests/test262-esnext-excludelist.xml +++ b/tests/test262-esnext-excludelist.xml @@ -1065,9 +1065,6 @@ - - - @@ -1384,7 +1381,6 @@ - @@ -2029,11 +2025,6 @@ - - - - - @@ -3091,8 +3082,6 @@ - - diff --git a/tools/gen-unicode.py b/tools/gen-unicode.py index 884830642..773cd61ab 100755 --- a/tools/gen-unicode.py +++ b/tools/gen-unicode.py @@ -43,11 +43,6 @@ FOLDING_SUP_C_SOURCE = os.path.join(PROJECT_DIR, 'jerry-core/lit/lit-unicode-fol UNICODE_PLANE_TYPE_BASIC = 0 UNICODE_PLANE_TYPE_SUPPLEMENTARY = 1 -# For ES5.1 profile we use a predefined subset of whitespace characters -ES5_1_WHITE_SPACE_UNITS = [0x1680, 0x180e] -ES5_1_WHITE_SPACE_UNITS.extend(range(0x2000, 0x200c)) -ES5_1_WHITE_SPACE_UNITS.extend([0x202f, 0x205f, 0x3000]) - # common code generation class UnicodeBasicSource(object): @@ -80,11 +75,7 @@ class UnicodeBasicSource(object): self._header.append("") # for an extra empty line def add_whitepace_range(self, category, categorizer, units): - self._data.append("#if ENABLED (JERRY_ESNEXT)") self.add_range(category, categorizer.create_tables(units)) - self._data.append("#else /* !ENABLED (JERRY_ESNEXT) */") - self.add_range(category, categorizer.create_tables(ES5_1_WHITE_SPACE_UNITS)) - self._data.append("#endif /* ENABLED (JERRY_ESNEXT) */\n") def add_range(self, category, tables): idx = 0