mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Do not mutate if let
This commit is contained in:
parent
691f3be24a
commit
1fedba81f7
1 changed files with 2 additions and 2 deletions
|
@ -65,7 +65,7 @@ class AndOr(Strategy):
|
||||||
class IfTrue(Strategy):
|
class IfTrue(Strategy):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
Strategy.__init__(self)
|
Strategy.__init__(self)
|
||||||
if_condition = r"(?<=if\s)(.*)(?=\s\{)"
|
if_condition = r"(?<=if\s)\s*(?!let\s)(.*)(?=\s\{)"
|
||||||
self._replace_strategy = {
|
self._replace_strategy = {
|
||||||
'regex': if_condition,
|
'regex': if_condition,
|
||||||
'replaceString': 'true'
|
'replaceString': 'true'
|
||||||
|
@ -75,7 +75,7 @@ class IfTrue(Strategy):
|
||||||
class IfFalse(Strategy):
|
class IfFalse(Strategy):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
Strategy.__init__(self)
|
Strategy.__init__(self)
|
||||||
if_condition = r"(?<=if\s)(.*)(?=\s\{)"
|
if_condition = r"(?<=if\s)\s*(?!let\s)(.*)(?=\s\{)"
|
||||||
self._replace_strategy = {
|
self._replace_strategy = {
|
||||||
'regex': if_condition,
|
'regex': if_condition,
|
||||||
'replaceString': 'false'
|
'replaceString': 'false'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue