Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 1d69015

Browse files
committed
test($parse): skip Function.prototype.bind test on IE8
1 parent f13c33b commit 1d69015

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

test/ng/parseSpec.js

+18-14
Original file line numberDiff line numberDiff line change
@@ -731,21 +731,25 @@ describe('parser', function() {
731731
'Expression: apply()');
732732
});
733733

734-
it('should NOT allow invocation to Function.bind', function() {
735-
scope.bind = Function.prototype.bind;
736734

737-
expect(function() {
738-
scope.$eval('$eval.bind()');
739-
}).toThrowMinErr(
740-
'$parse', 'isecff', 'Referencing call, apply or bind in Angular expressions is disallowed! ' +
741-
'Expression: $eval.bind()');
742-
743-
expect(function() {
744-
scope.$eval('bind()');
745-
}).toThrowMinErr(
746-
'$parse', 'isecff', 'Referencing call, apply or bind in Angular expressions is disallowed! ' +
747-
'Expression: bind()');
748-
});
735+
// IE8 doesn't have Function.prototype.bind
736+
if (!msie || msie > 8) {
737+
it('should NOT allow invocation to Function.bind', function () {
738+
scope.bind = Function.prototype.bind;
739+
740+
expect(function () {
741+
scope.$eval('$eval.bind()');
742+
}).toThrowMinErr(
743+
'$parse', 'isecff', 'Referencing call, apply or bind in Angular expressions is disallowed! ' +
744+
'Expression: $eval.bind()');
745+
746+
expect(function () {
747+
scope.$eval('bind()');
748+
}).toThrowMinErr(
749+
'$parse', 'isecff', 'Referencing call, apply or bind in Angular expressions is disallowed! ' +
750+
'Expression: bind()');
751+
});
752+
}
749753
});
750754

751755
describe('Object constructor', function() {

0 commit comments

Comments
 (0)