Bug Tracker

Ticket #10750 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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

comment:1 Changed 3 years ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to effects

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

  • Status changed from closed to reopened
  • Resolution invalid deleted

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.

Version 0, edited 3 years ago by ajpiano (next)

comment:4 Changed 3 years ago by ajpiano

  • Owner set to lazahu@…
  • Status changed from reopened to pending

comment:5 Changed 3 years ago by gnarf

  • Owner changed from lazahu@… to gnarf
  • Status changed from pending to assigned

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

comment:6 Changed 3 years ago by gnarf

  • Summary changed from IE8 (-?) stops working on using reserved word "stop" as key in $.stop() to A "null" in the data object can cause an error in stop

comment:7 Changed 3 years ago by gnarf

  • Milestone changed from None to 1.7.1

comment:8 Changed 3 years ago by anonymous

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

comment:9 Changed 3 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 3 years ago by Corey Frang

  • Status changed from assigned to closed
  • Resolution set to fixed

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.