build-your-own-angularjs
build-your-own-angularjs copied to clipboard
$parse method not throws an exception for invalid exponent value
it('will not parse invalid scientific notation', function () {
expect(function () {
parse('42e');
}).toThrow();
});
The test above fails wherares the angular $parser works properly with this and throws an exception. The сulprit is Lexer.prototype.isNumber method which returns true for booleans passed as an argument (in this case 'false').