mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 974368 - Fix ! operator precedence in manifestparser's expression parser. r=jmaher
This commit is contained in:
parent
c825576979
commit
be7cc08ee9
@ -8,7 +8,7 @@ support-files =
|
||||
[browser_bug731866.js]
|
||||
[browser_connection.js]
|
||||
[browser_healthreport.js]
|
||||
skip-if = (!healthreport) || (os == 'linux' && debug)
|
||||
skip-if = !healthreport || (os == 'linux' && debug)
|
||||
[browser_privacypane_1.js]
|
||||
[browser_privacypane_3.js]
|
||||
[browser_privacypane_5.js]
|
||||
|
@ -8,7 +8,7 @@ support-files =
|
||||
[browser_bug705422.js]
|
||||
[browser_chunk_permissions.js]
|
||||
[browser_healthreport.js]
|
||||
skip-if = (!healthreport) || (os == 'linux' && debug)
|
||||
skip-if = !healthreport || (os == 'linux' && debug)
|
||||
[browser_permissions.js]
|
||||
[browser_privacypane_1.js]
|
||||
[browser_privacypane_3.js]
|
||||
|
@ -85,7 +85,7 @@ class neq_op_token(object):
|
||||
class not_op_token(object):
|
||||
"!"
|
||||
def nud(self, parser):
|
||||
return not parser.expression()
|
||||
return not parser.expression(100)
|
||||
|
||||
class and_op_token(object):
|
||||
"&&"
|
||||
|
@ -78,5 +78,18 @@ class ExpressionParserTest(unittest.TestCase):
|
||||
self.assertTrue(parse('"string with #" == "string with #" # really, it does'))
|
||||
self.assertTrue(parse('"string with #" != "string with # but not the same" # no match!'))
|
||||
|
||||
def test_not(self):
|
||||
"""
|
||||
Test the ! operator.
|
||||
"""
|
||||
self.assertTrue(parse("!false"))
|
||||
self.assertTrue(parse("!(false)"))
|
||||
self.assertFalse(parse("!true"))
|
||||
self.assertFalse(parse("!(true)"))
|
||||
self.assertTrue(parse("!true || true)"))
|
||||
self.assertTrue(parse("true || !true)"))
|
||||
self.assertFalse(parse("!true && true"))
|
||||
self.assertFalse(parse("true && !true"))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Loading…
Reference in New Issue
Block a user