Added RegExp dotAll flag (#4000)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
This commit is contained in:
@@ -2816,6 +2816,12 @@ lexer_construct_regexp_object (parser_context_t *context_p, /**< context */
|
||||
{
|
||||
flag = RE_FLAG_STICKY;
|
||||
}
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
else if (source_p[0] == LIT_CHAR_LOWERCASE_S)
|
||||
{
|
||||
flag = RE_FLAG_DOTALL;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
if (flag == 0)
|
||||
{
|
||||
|
||||
@@ -36,11 +36,6 @@
|
||||
*/
|
||||
#define RE_CACHE_SIZE 8u
|
||||
|
||||
/**
|
||||
* RegExp flags mask (first 10 bits are for reference count and the rest for the actual RegExp flags)
|
||||
*/
|
||||
#define RE_FLAGS_MASK 0x3F
|
||||
|
||||
/**
|
||||
* Maximum value that can be encoded in the RegExp bytecode as a single byte.
|
||||
*/
|
||||
|
||||
@@ -61,7 +61,7 @@ re_cache_lookup (ecma_string_t *pattern_str_p, /**< pattern string */
|
||||
|
||||
ecma_string_t *cached_pattern_str_p = ecma_get_string_from_value (cached_bytecode_p->source);
|
||||
|
||||
if ((cached_bytecode_p->header.status_flags & RE_FLAGS_MASK) == flags
|
||||
if (cached_bytecode_p->header.status_flags == flags
|
||||
&& ecma_compare_ecma_strings (cached_pattern_str_p, pattern_str_p))
|
||||
{
|
||||
return cached_bytecode_p;
|
||||
|
||||
Reference in New Issue
Block a user