#124 ✓resolved
nickg

Make sure 'print' is not used directly in envjs

Reported by nickg | March 21st, 2010 @ 12:36 PM

A webpage from a Large Site had this tidbit.

function print(pageName) {
    window.open(pageName, "Print", "scrollbars=yes,menubar=yes,resizable=yes,width=680,height=430,top=125,left=325");
}

print('foo');

If you run this, envjs exhausts all memory and explodes depending how you have it configured since it can go into an infinite loop. This was not fun tracing or debugging. Boo.

Redefining print aka window.print is legit, so one could do this type of switcheroo:


Envjs.print = print

Then make sure anyone who uses print calls Envjs.print instead. OR use console.log and make sure does the equiv (i.e. Console.print = print).

Really this might be more a documentation issue than a code issue, since print should be used in very few places, but the API/callbacks might use it, causing my infinite loop.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

a javascript browser environment

People watching this ticket

Tags

Pages