-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Conversation
it('should evaluate Infinity', function() { | ||
expect(scope.$eval("Infinity")).toBe(Infinity); | ||
expect(scope.$eval("a=Infinity")).toBe(Infinity); | ||
expect(scope.a).toBe(Infinity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add test for -Infinity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
It's weird to add this but not NaN--- but it should be a good way to do it. Make sure |
71b6cb0
to
90e588a
Compare
I dunno. Either add NaN or don't do this at all. What happens when you override Infinity via Infinity=42? |
shouldn't be able to afaik
Same in spidermonkey and JSC, basically you just can't modify In the parser's case, that should result in writing to the Infinity property in scope though.. |
90e588a
to
61289a5
Compare
e8dc429
to
e83fab9
Compare
61289a5
to
3afe421
Compare
3afe421
to
595cc2e
Compare
updated |
expect(scope.$eval("obj.NaN = 43")).toBe(43); | ||
expect(scope.obj.NaN).toBe(43); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last thing, can we add a test that
$eval('Infinity = x');
will actually assign $scope.Infinity rather than global Infinity? (and maybe, if $scope.Infinity is defined, it should shadow window.Infinity? --- maybe that's more complicated than people want)
4dd5a20
to
998c61c
Compare
Allow user-defined literals. Close: angular#9504 Close: angular#9492
Allow user-defined literals. Close: angular#9504 Close: angular#9492
Allow user-defined literals. Close: angular#9504 Close: angular#9492
Allow user-defined literals. Close: angular#9504 Close: angular#9492
Closes #9492