Ticket #2531337 (closed defect)

Reporter


Richard Zurad
Opened: 10/26/11
Last modified: 05/10/12
Status: closed
Type: defect
Resolution: fixed

Owner


Allen Rabinovich
Target Release: 3.5.0
Priority: P3 (normal)
Summary: Fix the `for...in` inside Calendar with a `hasOwnProperty` check
Description:

Inside `CalendarBase` in the `_isNumInList` function, there is a for...in loop that does not do a `hasOwnProperty` check for each property on the Array it is iterating through, which will obviously
break with a TypeError if the environment has modified the native Array prototype with a key that has not been set to `enumerable: false`. It should either be changed to a traditional for loop or it
should do a `hasOwnProperty` check.

Regardless of your opinion on the issue of extending host/native prototypes in your runtime, YUI is a framework, and a framework should not assume that the host environment has not been modified.
Especially with something (unfortunately) as common as native prototype modifications.

Type: defect Observed in Version: 3.4.1
Component: Calendar Severity: S3 (normal)
Assigned To: Allen Rabinovich Target Release: 3.5.0
Location: Priority: P3 (normal)
Tags: Relates To:
Browsers: All
URL:
Test Information:

Change History

Arnaud Didry

YUI Contributor

Posted: 12/16/11

Allen Rabinovich

YUI Developer

Posted: 02/1/12
  • milestone changed to 3.5.0
  • priority changed to P3 (normal)
  • status changed from new to accepted
  • summary changed from `for...in` inside Calendar without a `hasOwnProperty` check to Fix the `for...in` inside Calendar with a `hasOwnProperty` check

Allen Rabinovich

YUI Developer

Posted: 02/1/12
  • estimated changed from 0 to 0.25
  • sprint changed to sprint 3

Allen Rabinovich

YUI Developer

Posted: 02/1/12
  • estimated changed from 0.25 to 0.1

Allen Rabinovich

YUI Developer

Posted: 02/15/12
  • completed changed from 0 to 0.1
  • remaining changed from 0.1 to 0

Allen Rabinovich

YUI Developer

Posted: 03/5/12
  • status changed from accepted to checkedin

Jenny Donnelly

YUI Developer

Posted: 05/10/12
  • resolution changed to fixed

checkedin -> closed

Jenny Donnelly

YUI Developer

Posted: 05/10/12
  • status changed from checkedin to closed

checkedin -> closed