The following code in a GM script in FF 68.0.1:
let input = $( 'input#id' );
input.each( function(){console.debug(this)} );
input.each( debugn(this) );
function debugn( message ) {
console.debug(message)
}
prints first:
<input id="id" ...>
as expected but then:
Sandbox { browser: {...
Even if the internal iterator is consumed at the first call and not initialised at the second (though .each() doesn't mention such a behaviour) it shouldn't print the Sandbox
object but simply not call debugn(...)
, shouldn't it?