summaryrefslogtreecommitdiff
path: root/js/src/vm/RegExpObject.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-11-18 12:20:44 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-11-18 12:20:44 +0100
commitf31b04a303607cd82757e7c4f60bb536658c8a30 (patch)
tree98b720782be5bc8bd77202bb4c1dc69e4927c03e /js/src/vm/RegExpObject.h
parent36c81a978695ec3ba68af8475422bcab49ef470d (diff)
downloaduxp-f31b04a303607cd82757e7c4f60bb536658c8a30.tar.gz
Issue #1284 - Implement /s (dotAll) for regular expressions.
Resolves #1284.
Diffstat (limited to 'js/src/vm/RegExpObject.h')
-rw-r--r--js/src/vm/RegExpObject.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/js/src/vm/RegExpObject.h b/js/src/vm/RegExpObject.h
index f1ea101ed5..4548521dfc 100644
--- a/js/src/vm/RegExpObject.h
+++ b/js/src/vm/RegExpObject.h
@@ -53,16 +53,18 @@ enum RegExpFlag
MultilineFlag = 0x04,
StickyFlag = 0x08,
UnicodeFlag = 0x10,
+ DotAllFlag = 0x20,
NoFlags = 0x00,
- AllFlags = 0x1f
+ AllFlags = 0x3f
};
static_assert(IgnoreCaseFlag == REGEXP_IGNORECASE_FLAG &&
GlobalFlag == REGEXP_GLOBAL_FLAG &&
MultilineFlag == REGEXP_MULTILINE_FLAG &&
StickyFlag == REGEXP_STICKY_FLAG &&
- UnicodeFlag == REGEXP_UNICODE_FLAG,
+ UnicodeFlag == REGEXP_UNICODE_FLAG &&
+ DotAllFlag == REGEXP_DOTALL_FLAG,
"Flag values should be in sync with self-hosted JS");
enum RegExpRunStatus
@@ -480,6 +482,7 @@ class RegExpObject : public NativeObject
bool multiline() const { return getFlags() & MultilineFlag; }
bool sticky() const { return getFlags() & StickyFlag; }
bool unicode() const { return getFlags() & UnicodeFlag; }
+ bool dotall() const { return getFlags() & DotAllFlag; }
static bool isOriginalFlagGetter(JSNative native, RegExpFlag* mask);