Bug Tracker

Opened 7 years ago

Closed 7 years ago

#13547 closed bug (invalid)

propHooks failing in IE9 under non-minified 1.9.1

Reported by: scottm@… Owned by: scottm@…
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:

Description

Line 2631 of the non-minified 1.9.1 fails with an exception under IE9 when it attempts to perform a getAttribute on an object that does not have a getAttribute method:

jQuery.each([ "href", "src" ], function( i, name ) {

jQuery.propHooks[ name ] = {

get: function( elem ) { return elem.getAttribute( name, 4 );

However, the minified version of 1.9.1 does NOT fail this way. Looking at the minified code, it appears that it has a try/catch wrapped around the code, which catches the error:

i.propHooks[t]={get:function(n){var i=null;try{i=n.getAttribute(t,2)}catch(r){}return i}}

It appears that the minified code is still using the "4" flag instead of the "2" flag as specified in jQuery bug 10299.

Aren't the minified and the non-minified versions supposed to be identical?

The non-minified version of the code should be corrected like the minified version in order to fix this bug.

Change History (4)

comment:1 Changed 7 years ago by Rick Waldron

Owner: set to scottm@…
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!

Additionally, be sure to test against the "jQuery (edge)" version to ensure the issue still exists—you may need to change this to a specific version depending on the test case.

To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to begin.

Also, please read: http://blog.jquery.com/2013/01/15/jquery-1-9-final-jquery-2-0-beta-migrate-final-released/

comment:2 Changed 7 years ago by scottm@…

Status: pendingnew

I have absolutely no idea how to recreate this problem outside of the large application use case in which I originally encountered it.

What I do know is that as I mentioned, the error occurs only in the non-minified code, and that upon examination, the minified code is functionally different than the non-minified code. The minified version of the code has error handling in the routine in question, while the non-minified version does not. I'm pretty sure this isn't the way it's supposed to be.

comment:3 Changed 7 years ago by dmethvin

Status: newpending

Can you confirm that your files are exact copies of the ones on code.jquery.com? Doesn't seem so from your description.

comment:4 Changed 7 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.