mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
No issue - Flag to parse 'v' flag as 'u' for automated tests, disabled by default
This commit is contained in:
parent
85cb46096a
commit
199ff12ba8
3 changed files with 31 additions and 0 deletions
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include "frontend/BytecodeCompiler.h"
|
||||
#include "frontend/ReservedWords.h"
|
||||
#include "irregexp/FeatureFlags.h"
|
||||
#include "js/CharacterEncoding.h"
|
||||
#include "js/UniquePtr.h"
|
||||
#include "vm/HelperThreads.h"
|
||||
|
|
@ -1942,6 +1943,8 @@ TokenStream::getTokenInternal(TokenKind* ttp, Modifier modifier)
|
|||
reflags = RegExpFlag(reflags | UnicodeFlag);
|
||||
else if (c == 's' && !(reflags & DotAllFlag))
|
||||
reflags = RegExpFlag(reflags | DotAllFlag);
|
||||
else if (c == 'v' && irregexp::kParseFlagUnicodeSetsAsUnicode && !(reflags & UnicodeFlag))
|
||||
reflags = RegExpFlag(reflags | UnicodeFlag);
|
||||
else
|
||||
break;
|
||||
getChar();
|
||||
|
|
|
|||
20
js/src/irregexp/FeatureFlags.h
Normal file
20
js/src/irregexp/FeatureFlags.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef irregexp_FeatureFlags_h
|
||||
#define irregexp_FeatureFlags_h
|
||||
|
||||
namespace js {
|
||||
|
||||
namespace irregexp {
|
||||
|
||||
// Feature flag to treat /../v as /../u (https://v8.dev/features/regexp-v-flag)
|
||||
// We don't support Set Notation or the changed Case Insenstive handling
|
||||
// but we have Property Sequences and want them in unit test runs.
|
||||
static const bool kParseFlagUnicodeSetsAsUnicode = false;
|
||||
|
||||
} } // namespace js::irregexp
|
||||
|
||||
#endif // irregexp_FeatureFlags_h
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "builtin/RegExp.h"
|
||||
#include "frontend/TokenStream.h"
|
||||
#include "irregexp/FeatureFlags.h"
|
||||
#ifdef DEBUG
|
||||
#include "irregexp/RegExpBytecode.h"
|
||||
#endif
|
||||
|
|
@ -1484,6 +1485,13 @@ ParseRegExpFlags(const CharT* chars, size_t length, RegExpFlag* flagsOut, char16
|
|||
if (!HandleRegExpFlag(UnicodeFlag, flagsOut))
|
||||
return false;
|
||||
break;
|
||||
case 'v':
|
||||
if (irregexp::kParseFlagUnicodeSetsAsUnicode) {
|
||||
if (!HandleRegExpFlag(UnicodeFlag, flagsOut))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
MOZ_FALLTHROUGH
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue