build-your-own-angularjs icon indicating copy to clipboard operation
build-your-own-angularjs copied to clipboard

$parse method not throws an exception for invalid exponent value

Open ghost opened this issue 8 years ago • 0 comments

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').

ghost avatar Aug 20 '16 19:08 ghost