0

I noticed a strange problem when enabling the "break on exception" feature, in Firefox or Chrome/Chromium. It stops on

push.apply( results,
    newContext.querySelectorAll( newSelector )
);

even though apparently there is no error on this line. Is this an issue with jQuery, or Firefox?

When I turn off the pause-on-exception, it doesn't show exceptions in console.

The top caller on the stack was jQuery.fx.tick at the time of exception.

NoBugs
  • 9,310
  • 13
  • 80
  • 146
  • what version of Firefox are you using? – nicosantangelo Jun 24 '13 at 02:01
  • Firefox 22, but Chromium does exactly the same. – NoBugs Jun 24 '13 at 04:44
  • If you look at the source surrounding that fragment, it's wrapped in a try/catch with an empty catch clause meant to swallow any errors silently. That is why you don't get any errors in the console. Why querySelectorAll fails, I can't say, but you can edit the source to add some logging and see what error is thrown. – DCoder Jun 24 '13 at 04:56
  • Possible duplicate of http://stackoverflow.com/questions/5174968/why-is-chrome-pausing-on-some-line-inside-jquery – GlenPeterson Dec 23 '13 at 16:54

1 Answers1

0

I think what you are looking for is

Array.prototype.push.apply( results,
    newContext.querySelectorAll( 'div')
);

The push method you are looking for is a prototype method of Array type.

or as a short hand

[].push.apply( results,
    newContext.querySelectorAll( 'div')
);
Arun P Johny
  • 384,651
  • 66
  • 527
  • 531