Ticket #2791 (closed task: fixed)

Opened 3 years ago

Last modified 3 years ago

Class.js tweak

Reported by: tschaub Owned by: tschaub
Priority: minor Milestone: 2.10 Release
Component: BaseTypes.Class Version: 2.9
Keywords: Cc:
State: Complete

Description

The OpenLayers.Class function refers to arguments[i] a number of times. We can create a variable referring to this argument for clarity. As a bonus, we may also treat an obscure and very incompletely described issue using the OpenLayers.Class function in IE8 (we know this works in general, but an IRC report from dheinbach says that to support his use, he had to explicitly add parenthesis when constructing an instance of the parent).

I'm not in favor of voodoo coding in general. But I think this change adds clarity anyway.

Attachments

2791.patch Download (1.9 KB) - added by tschaub 3 years ago.
fewer references to arguments[i]

Change History

Changed 3 years ago by tschaub

fewer references to arguments[i]

Changed 3 years ago by tschaub

  • state set to Review

Tests pass. I think this nearly qualifies for our "trivial change" exception, but I'll await a review.

Changed 3 years ago by elemoine

  • state changed from Review to Commit

It looks good. Please commit.

I'd also love to have tests showing in what cases the problem triggers.

Changed 3 years ago by tschaub

  • status changed from new to assigned

Changed 3 years ago by tschaub

  • status changed from assigned to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [10642]) Creating a Type variable that refers to arguments[i]. Including parentheses when calling the constructor. r=elemoine (closes #2791)

Note: See TracTickets for help on using tickets.