Subversion Repositories JSX

Compare Revisions

Last modification

Ignore whitespace Rev 550 → Rev 551

/trunk/object.js
384,8 → 384,9
* <p>Returns <code>true</code> if the value is a reference
* to an object; <code>false</code> otherwise.</p>
*
* <p>A value "is an object" if it is a function or
* <code>typeof "object"</code> but not <code>null</code>.
* <p>A value "is an object" if it is a function,
* <code>typeof "object"</code> or a host object
* (not a primitive value), but not <code>null</code>.
*
* @return {boolean}
*/
392,7 → 393,12
function _isObject (a)
{
var t = typeof a;
return t == "function" || (t == "object" && a !== null);
 
return t == "function"
|| (t == "object"
|| (t != "undefined" && t != "boolean"
&& t != "number" && t != "string")
&& a !== null);
}
 
/**
934,6 → 940,34
return oTarget;
}
 
function _getFeature (obj, path)
{
var realPath = path;
var start = 0;
 
if (!_isArray(realPath))
{
realPath = arguments;
start = 1;
}
 
for (var i = start, len = realPath.length; i < len; i++)
{
var component = realPath[i];
if (_isObject(obj)
&& typeof obj[component] != "undefined" && obj[component])
{
obj = obj[component];
}
else
{
return void 0;
}
}
 
return obj;
}
var jsx_object = {
/**
* @memberOf jsx.object
984,10 → 1018,10
fTester = _isMethod;
}
 
if (fMethod.apply(aPath))
if (fTester.apply(this, aPath))
{
var method = _getFeature.apply(aPath);
var returnValue = method.apply(method, aArguments);
var method = _getFeature.apply(this, aPath);
var returnValue = method.apply(aPath[0], aArguments);
return {returnValue: returnValue};
}
 
1296,33 → 1330,8
* a feature. Note that features whose value can be
* <code>undefined</code> cannot be detected with this method.
*/
getFeature: function (obj, path) {
var realPath = path;
var start = 0;
getFeature: _getFeature,
 
if (!_isArray(realPath))
{
realPath = arguments;
start = 1;
}
 
for (var i = start, len = realPath.length; i < len; i++)
{
var component = realPath[i];
if (_isObject(obj)
&& typeof obj[component] != "undefined" && obj[component])
{
obj = obj[component];
}
else
{
return void 0;
}
}
 
return obj;
},
 
/**
* Emulates the <code>instanceof</code> operator
* of ECMAScript Edition 3 and later.
1781,16 → 1790,16
* of the fact. Allowing for a maximum of flexibility, JSX
* uses options that govern to which degree JSX components may
* modify built-in objects. Options include, with increasing
* degree of flexibility and side-effects by nesting level:
* degree of flexibility and side-effects:
*
* <table>
* <thead>
* <tr>
* <td></td>
* <th>mod. builtins</th>
* <th>augment</th>
* <th>augmentproto</th>
* <th>augmentobjectproto</th>
* <th>Modify built-ins</th>
* <th>Augment built-ins</th>
* <th>Augment built-in prototypes</th>
* <th>Augment <code>Object</code> prototype</th>
* </tr>
* </thead>
* <tbody>
1831,12 → 1840,13
* properties. This allows new properties on
* the built-in constructors, but not on
* prototype objects of built-in objects.
* See <code>augmentPrototypes</code>.
* (See <code>augmentPrototypes</code>.)
* Since there usually is no harm in that,
* the default is <code>true</code>.
* Set to <code>false</code> if you are testing features
* of ECMAScript implementations with JSX,
* like with the ECMAScript Support Matrix.
* like with the
* {@link http://PointedEars.de/es-matrix ECMAScript Support Matrix}.
* <dl>
* <dt><code>augmentPrototypes</code></dt>
* <dd>Allow prototype objects to be augmented,
2940,6 → 2950,9
};
}());
 
/**
* @namespace
*/
jsx.array = {
version: jsx.object.version,