Class YAHOO.lang
YAHOO.lang
Defined in: yahoo.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Provides the language utilites and extensions used by the library
|
Method Attributes | Method Name and Description |
---|---|
<static> |
YAHOO.lang.augment(r, s, arguments)
Applies all prototype properties in the supplier to the receiver if the
receiver does not have these properties yet.
|
<static> |
YAHOO.lang.extend(subc, superc, overrides)
Utility to set up the prototype, constructor and superclass properties to
support an inheritance strategy that can chain constructors and methods.
|
<static> |
YAHOO.lang.hasOwnProperty(obj, prop)
Determines whether or not the property was added
to the object instance.
|
<static> |
YAHOO.lang.isArray(obj)
Determines whether or not the provided object is an array
|
<static> |
YAHOO.lang.isBoolean(obj)
Determines whether or not the provided object is a boolean
|
<static> |
YAHOO.lang.isFunction(obj)
Determines whether or not the provided object is a function
|
<static> |
YAHOO.lang.isNull(obj)
Determines whether or not the provided object is null
|
<static> |
YAHOO.lang.isNumber(obj)
Determines whether or not the provided object is a legal number
|
<static> |
YAHOO.lang.isObject(obj)
Determines whether or not the provided object is of type object
or function
|
<static> |
YAHOO.lang.isString(obj)
Determines whether or not the provided object is a string
|
<static> |
YAHOO.lang.isUndefined(obj)
Determines whether or not the provided object is undefined
|
Method Detail
<static>
YAHOO.lang.augment(r, s, arguments)
Applies all prototype properties in the supplier to the receiver if the
receiver does not have these properties yet. Optionally, one or more
methods/properties can be specified (as additional parameters). This
option will overwrite the property if receiver has it already.
- Parameters:
- {Function} r
- the object to receive the augmentation
- {Function} s
- the object that supplies the properties to augment
- {String*} arguments
- zero or more properties methods to augment the receiver with. If none specified, everything in the supplier will be used unless it would overwrite an existing property in the receiver
<static>
YAHOO.lang.extend(subc, superc, overrides)
Utility to set up the prototype, constructor and superclass properties to
support an inheritance strategy that can chain constructors and methods.
- Parameters:
- {Function} subc
- the object to modify
- {Function} superc
- the object to inherit
- {Object} overrides
- additional properties/methods to add to the subclass prototype. These will override the matching items obtained from the superclass if present.
<static>
YAHOO.lang.hasOwnProperty(obj, prop)
Determines whether or not the property was added
to the object instance. Returns false if the property is not present
in the object, or was inherited from the prototype.
This abstraction is provided to enable hasOwnProperty for Safari 1.3.x.
There is a discrepancy between YAHOO.lang.hasOwnProperty and
Object.prototype.hasOwnProperty when the property is a primitive added to
both the instance AND prototype with the same value:
var A = function() {}; A.prototype.foo = 'foo'; var a = new A(); a.foo = 'foo'; alert(a.hasOwnProperty('foo')); // true alert(YAHOO.lang.hasOwnProperty(a, 'foo')); // false when using fallback
- Parameters:
- {any} obj
- The object being testing
- prop
- Returns:
- Boolean
<static>
YAHOO.lang.isArray(obj)
Determines whether or not the provided object is an array
- Parameters:
- {any} obj
- The object being testing
- Returns:
- Boolean
<static>
YAHOO.lang.isBoolean(obj)
Determines whether or not the provided object is a boolean
- Parameters:
- {any} obj
- The object being testing
- Returns:
- Boolean
<static>
YAHOO.lang.isFunction(obj)
Determines whether or not the provided object is a function
- Parameters:
- {any} obj
- The object being testing
- Returns:
- Boolean
<static>
YAHOO.lang.isNull(obj)
Determines whether or not the provided object is null
- Parameters:
- {any} obj
- The object being testing
- Returns:
- Boolean
<static>
YAHOO.lang.isNumber(obj)
Determines whether or not the provided object is a legal number
- Parameters:
- {any} obj
- The object being testing
- Returns:
- Boolean
<static>
YAHOO.lang.isObject(obj)
Determines whether or not the provided object is of type object
or function
- Parameters:
- {any} obj
- The object being testing
- Returns:
- Boolean
<static>
YAHOO.lang.isString(obj)
Determines whether or not the provided object is a string
- Parameters:
- {any} obj
- The object being testing
- Returns:
- Boolean
<static>
YAHOO.lang.isUndefined(obj)
Determines whether or not the provided object is undefined
- Parameters:
- {any} obj
- The object being testing
- Returns:
- Boolean