Skip to main content

Bug Tracker

Side navigation

#10750 closed bug (fixed)

Opened November 10, 2011 03:31PM UTC

Closed November 14, 2011 04:40PM UTC

Last modified March 08, 2012 06:33PM UTC

A "null" in the data object can cause an error in stop

Reported by: lazahu@gmail.com Owned by: gnarf
Priority: low Milestone: 1.7.1
Component: effects Version: 1.7
Keywords: Cc:
Blocked by: Blocking:
Description

IE8 drops a JS error - "Object required" - on line 8555 ($.stop()) when jQuery tries to access data[ i ].stop. A temporary workaround using data[ i ][ "stop" ] helped. However the behavior is not consistent, and I can't tell when this error is actually triggered. This is why I didn't make a jsFiddle example.

Attachments (0)
Change History (10)

Changed November 10, 2011 04:04PM UTC by timmywil comment:1

component: unfiledeffects
priority: undecidedlow
resolution: → invalid
status: newclosed

Thanks for taking the time to contribute to the jQuery project! Please ask for support on the forums or on the #jquery irc channel until the issue has been narrowed down to an issue with jQuery core.

Changed November 11, 2011 10:22AM UTC by lazahu@gmail.com comment:2

Ok, let me fight to make your product bugfree.

I have tested it more, and turned out that the problem is not the reserved word (if "stop" is reserved at all), but not checking the data[i] existence before referencing its ".stop" value, and IE8 will drop an error if you try to access undefined.stop.

The situation is the following on IE8:

// line 8555 : jQuery.js
// inside the for ( i in data ) loop
data["olddisplay"] = null
data["olddisplay"].stop = // "Object required" error in IE8
data["events"] = [object Object] // ... more elements of the data array
data["events"].stop = undefined
data["handle"] = function( e ) {}
data["handle"].stop = undefined

The solution in IE8 could be either checking data[i] before referencing data[i].stop or providing " " as default value for "olddisplay".

In "normal" browsers it looks the following:

data["olddisplay"] = ''
data["olddisplay"].stop = undefined // No error

I hope now you understand why is not an "invalid" request.

Thanks,

Laza

Changed November 11, 2011 05:16PM UTC by ajpiano comment:3

_comment0: 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. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.1321031838564529
resolution: invalid
status: closedreopened

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. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

Changed November 11, 2011 05:16PM UTC by ajpiano comment:4

owner: → lazahu@gmail.com
status: reopenedpending

Changed November 11, 2011 06:33PM UTC by gnarf comment:5

owner: lazahu@gmail.comgnarf
status: pendingassigned

I'm going to look into this one, but a "null" in the data could definitely cause a bug there.

Changed November 11, 2011 06:34PM UTC by gnarf comment:6

summary: IE8 (-?) stops working on using reserved word "stop" as key in $.stop()A "null" in the data object can cause an error in stop

Changed November 11, 2011 08:31PM UTC by gnarf comment:7

milestone: None1.7.1

Changed November 14, 2011 09:26AM UTC by anonymous comment:8

Here's a demonstration of the bug:

http://jsfiddle.net/h6ANN/5/

Changed November 14, 2011 09:31AM UTC by lazahu@gmail.com comment:9

Sorry it was me, lazahu@gmail.com.

The opacity bug can be observed too on this example:

http://jsfiddle.net/h6ANN/6/

Changed November 14, 2011 04:40PM UTC by Corey Frang comment:10

resolution: → fixed
status: assignedclosed

Ensuring that nulls in private data object won't cause errors on stop() - Fixes #10750

Changeset: 499d7e409c4f4d4ed255148e59552763cccf4260