Bug Tracker

Ticket #12519 (closed bug: fixed)

Opened 23 months ago

Last modified 22 months ago

Public API methods should not have private arguments

Reported by: dmethvin Owned by:
Priority: high Milestone: 1.9
Component: core Version: 1.8.0
Keywords: Cc:
Blocking: Blocked by:

Description

Private variables make extending the API calls difficult. They also make duck punching impossible without at least recognizing and propagating the hidden vars, in cases like $.data() you have to actually understand the meaning of the pvt variable or you'll do the wrong thing. These can be replaced with a common private method that the two public methods ($.data() and $._data()) can call. Examples:

  data: function( elem, name, data, pvt /* Internal Use Only */ ) {
  removeData: function( elem, name, pvt /* Internal Use Only */ )
  attr: function( elem, name, value, pass ) {

Change History

comment:1 Changed 23 months ago by dmethvin

  • Priority changed from undecided to high
  • Status changed from new to open
  • Component changed from unfiled to core
  • Milestone changed from None to 1.9

comment:2 Changed 22 months ago by dmethvin

  • Summary changed from Public API methods should not have private variables to Public API methods should not have private arguments

comment:3 Changed 22 months ago by carldanley

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

Create private methods for processing data/removeData requests. Fixes #12519, Closes gh-976

Changeset: 08e134548f70f24cb73f8e1b7a6da39b1995d0ac

Note: See TracTickets for help on using tickets.