Skip to content

Commit 2f4a6f8

Browse files
committed
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.
1 parent 875cd75 commit 2f4a6f8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/ng/compileSpec.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,14 @@ describe('$compile', function() {
187187
if (msie < 9) return;
188188

189189
element = jqLite('<div>{{1+2}}</div>');
190-
element[0].childNodes[1] = {nodeType: 3, nodeName: 'OBJECT', textContent: 'fake node'};
191190

192-
if (!element[0].childNodes[1]) return; //browser doesn't support this kind of mocking
191+
try {
192+
element[0].childNodes[1] = {nodeType: 3, nodeName: 'OBJECT', textContent: 'fake node'};
193+
} catch(e) {
194+
} finally {
195+
if (!element[0].childNodes[1]) return; //browser doesn't support this kind of mocking
196+
}
197+
193198
expect(element[0].childNodes[1].textContent).toBe('fake node');
194199

195200
$compile(element)($rootScope);

0 commit comments

Comments
 (0)