Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#10750 closed bug (fixed)

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

Reported by: lazahu@… 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 10 years ago by timmywil

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.

comment:2 Changed 10 years ago by lazahu@…

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 10 years ago by ajpiano

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.

Last edited 10 years ago by ajpiano (previous) (diff)

comment:4 Changed 10 years ago by ajpiano

Owner: set to lazahu@…
Status: reopenedpending

comment:5 Changed 10 years ago by gnarf

Owner: changed from lazahu@… to gnarf
Status: pendingassigned

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

comment:6 Changed 10 years ago by gnarf

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 10 years ago by gnarf

Milestone: None1.7.1

comment:8 Changed 10 years ago by anonymous

Here's a demonstration of the bug: http://jsfiddle.net/h6ANN/5/

comment:9 Changed 10 years ago by lazahu@…

Sorry it was me, lazahu@….

The opacity bug can be observed too on this example: http://jsfiddle.net/h6ANN/6/

comment:10 Changed 10 years ago by Corey Frang

Resolution: fixed
Status: assignedclosed

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

Changeset: 499d7e409c4f4d4ed255148e59552763cccf4260

Note: See TracTickets for help on using tickets.