Skip to main content

Bug Tracker

Side navigation

#12519 closed bug (fixed)

Opened September 12, 2012 02:22AM UTC

Closed October 16, 2012 03:15PM UTC

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:
Blocked by: Blocking:
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 ) {
Attachments (0)
Change History (3)

Changed September 12, 2012 02:23AM UTC by dmethvin comment:1

component: unfiledcore
milestone: None1.9
priority: undecidedhigh
status: newopen

Changed October 03, 2012 10:33PM UTC by dmethvin comment:2

summary: Public API methods should not have private variablesPublic API methods should not have private arguments

Changed October 16, 2012 03:15PM UTC by carldanley comment:3

resolution: → fixed
status: openclosed

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

Changeset: 08e134548f70f24cb73f8e1b7a6da39b1995d0ac