diff options
| author | Igor Minar | 2013-12-31 01:36:01 -0800 | 
|---|---|---|
| committer | Igor Minar | 2014-01-22 11:19:31 -0800 | 
| commit | ca865d29a3d4f21601222e43ee49abad5d38ce93 (patch) | |
| tree | e421e9efd98db06b4c62a9e0e787ceacf1887d25 | |
| parent | 3ccec13aa702d9a7f75316df0c70873d72148b24 (diff) | |
| download | angular.js-ca865d29a3d4f21601222e43ee49abad5d38ce93.tar.bz2 | |
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.
| -rwxr-xr-x | test/ng/compileSpec.js | 9 | 
1 files changed, 7 insertions, 2 deletions
| diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index 50aa30ef..2e28f9de 100755 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -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); | 
