Use strict equality in generated JS (#750)
This commit is contained in:
parent
50d480da1f
commit
e811a84ed4
@ -373,7 +373,7 @@ class Var(ABC):
|
|||||||
Returns:
|
Returns:
|
||||||
A var representing the equality comparison.
|
A var representing the equality comparison.
|
||||||
"""
|
"""
|
||||||
return self.compare("==", other)
|
return self.compare("===", other)
|
||||||
|
|
||||||
def __ne__(self, other: Var) -> Var:
|
def __ne__(self, other: Var) -> Var:
|
||||||
"""Perform an inequality comparison.
|
"""Perform an inequality comparison.
|
||||||
@ -384,7 +384,7 @@ class Var(ABC):
|
|||||||
Returns:
|
Returns:
|
||||||
A var representing the inequality comparison.
|
A var representing the inequality comparison.
|
||||||
"""
|
"""
|
||||||
return self.compare("!=", other)
|
return self.compare("!==", other)
|
||||||
|
|
||||||
def __gt__(self, other: Var) -> Var:
|
def __gt__(self, other: Var) -> Var:
|
||||||
"""Perform a greater than comparison.
|
"""Perform a greater than comparison.
|
||||||
|
@ -167,8 +167,8 @@ def test_basic_operations(TestObj):
|
|||||||
Args:
|
Args:
|
||||||
TestObj: The test object.
|
TestObj: The test object.
|
||||||
"""
|
"""
|
||||||
assert str(v(1) == v(2)) == "{(1 == 2)}"
|
assert str(v(1) == v(2)) == "{(1 === 2)}"
|
||||||
assert str(v(1) != v(2)) == "{(1 != 2)}"
|
assert str(v(1) != v(2)) == "{(1 !== 2)}"
|
||||||
assert str(v(1) < v(2)) == "{(1 < 2)}"
|
assert str(v(1) < v(2)) == "{(1 < 2)}"
|
||||||
assert str(v(1) <= v(2)) == "{(1 <= 2)}"
|
assert str(v(1) <= v(2)) == "{(1 <= 2)}"
|
||||||
assert str(v(1) > v(2)) == "{(1 > 2)}"
|
assert str(v(1) > v(2)) == "{(1 > 2)}"
|
||||||
|
Loading…
Reference in New Issue
Block a user