Ticket #5434 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

IE 8 function undefined() - Out of Stack Space

Reported by: swago Owned by:
Priority: major Milestone: 1.8.3
Component: ui.accordion Version: 1.8
Keywords: Cc:
Blocking: Blocked by:

Description

I believe this is an bug with IE8 but it does block the accordion from working. It only happens with IE8 and because of the JQuery name spacing it should not be happening.

Defining a function named 'undefined' after the jquery library has loaded will cause an 'Out of stack space' error in IE8.

To replicate download the UI development package from jquery version 1.8 and add the following function to the end of the script block inside of the index.html file:

function undefined(){
   var undefined;
   return undefined;
}

This will not break it in any other browser(except earlier versions of IE). To solve this we removed our function definition and replaced our checks for undefined with so we don't interfere with jquery:

(typeof(variable)=='undefined')

Attachments

index.html Download (30.9 KB) - added by swago 4 years ago.

Change History

Changed 4 years ago by swago

comment:1 follow-up: ↓ 4 Changed 4 years ago by bamccaig

I just did a little bit more checking on this and see that while jQuery seems to use a closure for undefined:

(function(window, undefined) {
    /* Define library codez here. */
}(window);

It seems jQuery UI does not do this. As a result, our undefined function may be causing simple comparisons to undefined to always fail within jQuery UI.

if(x == undefined) {
    ; // Never happens.
}

A possible solution would of course be to use an internal reference to undefined, whether returned by a function or through a closure.

comment:2 Changed 4 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from TBD to 1.9

Fixed in  21aad10.

comment:3 Changed 4 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.3

comment:4 in reply to: ↑ 1 Changed 4 years ago by bamccaig

Replying to bamccaig:

I just did a little bit more checking on this and see that while jQuery seems to use a closure for undefined:

*snip*

A possible solution would of course be to use an internal reference to undefined, whether returned by a function or through a closure.

That's not a closure at all... I blame lack of sleep.

Note: See TracTickets for help on using tickets.