mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
test(compileSpec): fix broken build on FF
FF 26.0 now throws: "TypeError: NodeList doesn't have an indexed property setter." when we try to assign to `childNodes[1]`, since this test still works properly on Chrome and the issue being tested is not a cross-browser issues, I'm just making the patchability check more robust instead of trying to figure out how to make this test fully pass on FF.
This commit is contained in:
parent
3ccec13aa7
commit
ca865d29a3
1 changed files with 7 additions and 2 deletions
|
|
@ -187,9 +187,14 @@ describe('$compile', function() {
|
|||
if (msie < 9) return;
|
||||
|
||||
element = jqLite('<div>{{1+2}}</div>');
|
||||
element[0].childNodes[1] = {nodeType: 3, nodeName: 'OBJECT', textContent: 'fake node'};
|
||||
|
||||
if (!element[0].childNodes[1]) return; //browser doesn't support this kind of mocking
|
||||
try {
|
||||
element[0].childNodes[1] = {nodeType: 3, nodeName: 'OBJECT', textContent: 'fake node'};
|
||||
} catch(e) {
|
||||
} finally {
|
||||
if (!element[0].childNodes[1]) return; //browser doesn't support this kind of mocking
|
||||
}
|
||||
|
||||
expect(element[0].childNodes[1].textContent).toBe('fake node');
|
||||
|
||||
$compile(element)($rootScope);
|
||||
|
|
|
|||
Loading…
Reference in a new issue