#10750 closed bug (fixed)
A "null" in the data object can cause an error in stop
Reported by: | 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.
Change History (10)
comment:1 Changed 12 years ago by
Component: | unfiled → effects |
---|---|
Priority: | undecided → low |
Resolution: | → invalid |
Status: | new → closed |
comment:2 Changed 12 years ago by
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
comment:3 Changed 12 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
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.
comment:4 Changed 12 years ago by
Owner: | set to lazahu@… |
---|---|
Status: | reopened → pending |
comment:5 Changed 12 years ago by
Owner: | changed from lazahu@… to gnarf |
---|---|
Status: | pending → assigned |
I'm going to look into this one, but a "null" in the data could definitely cause a bug there.
comment:6 Changed 12 years ago by
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 |
---|
comment:7 Changed 12 years ago by
Milestone: | None → 1.7.1 |
---|
comment:9 Changed 12 years ago by
Sorry it was me, lazahu@….
The opacity bug can be observed too on this example: http://jsfiddle.net/h6ANN/6/
comment:10 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Ensuring that nulls in private data object won't cause errors on stop() - Fixes #10750
Changeset: 499d7e409c4f4d4ed255148e59552763cccf4260
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.