dist/scalejs.base.object.js
function has(object) {
    // The intent of this method is to replace unsafe tests relying on type
    // coercion for optional arguments or obj properties:
    // | function on(event,options){
    // |   options = options || {}; // type coercion
    // |   if (!event || !event.data || !event.data.value){
    // |     // unsafe due to type coercion: all falsy values '', false, 0
    // |     // are discarded, not just null and undefined
    // |     return;
    // |   }
    // |   // ...
    // | }
    // with a safer test without type coercion:
    // | function on(event,options){
    // |   options = has(options)? options : {}; // no type coercion
    // |   if (!has(event,'data','value'){
    // |     // safe check: only null/undefined values are rejected;
    // |     return;
    // |   }
    // |   // ...
    // | }
    //
    // Returns:
    //   * false if no argument is provided or if the obj is null or
    //     undefined, whatever the number of arguments
    //   * true if the full chain of nested properties is found in the obj
    //     and the corresponding value is neither null nor undefined
    //   * false otherwise

    var i,
        // iterative variable
    length,
        o = object,
        property;

    if (!is(o)) {
        return false;
    }

    for (i = 1, length = arguments.length; i < length; i += 1) {
        property = arguments[i];
        o = o[property];
        if (!is(o)) {
            return false;
        }
    }

    return true;
}
function has(object) {
    // The intent of this method is to replace unsafe tests relying on type
    // coercion for optional arguments or obj properties:
    // | function on(event,options){
    // |   options = options || {}; // type coercion
    // |   if (!event || !event.data || !event.data.value){
    // |     // unsafe due to type coercion: all falsy values '', false, 0
    // |     // are discarded, not just null and undefined
    // |     return;
    // |   }
    // |   // ...
    // | }
    // with a safer test without type coercion:
    // | function on(event,options){
    // |   options = has(options)? options : {}; // no type coercion
    // |   if (!has(event,'data','value'){
    // |     // safe check: only null/undefined values are rejected;
    // |     return;
    // |   }
    // |   // ...
    // | }
    //
    // Returns:
    //   * false if no argument is provided or if the obj is null or
    //     undefined, whatever the number of arguments
    //   * true if the full chain of nested properties is found in the obj
    //     and the corresponding value is neither null nor undefined
    //   * false otherwise

    var i,
        // iterative variable
    length,
        o = object,
        property;

    if (!is(o)) {
        return false;
    }

    for (i = 1, length = arguments.length; i < length; i += 1) {
        property = arguments[i];
        o = o[property];
        if (!is(o)) {
            return false;
        }
    }

    return true;
}
function has ( object ) { // The intent of this method is to replace unsafe tests relying on type // coercion for optional arguments or obj properties: // | function on(event,options){ // |   options = options || {}; // type coercion // |   if (!event || !event.data || !event.data.value){ // |     // unsafe due to type coercion: all falsy values '', false, 0 // |     // are discarded, not just null and undefined // |     return; // |   } // |   // ... // | } // with a safer test without type coercion: // | function on(event,options){ // |   options = has(options)? options : {}; // no type coercion // |   if (!has(event,'data','value'){ // |     // safe check: only null/undefined values are rejected; // |     return; // |   } // |   // ... // | } // // Returns: //   * false if no argument is provided or if the obj is null or //     undefined, whatever the number of arguments //   * true if the full chain of nested properties is found in the obj //     and the corresponding value is neither null nor undefined //   * false otherwise var i , // iterative variable length , o = object , property ; if ( ! is ( o ) ) { return false ; } for ( i = 1 , length = arguments . length ; i < length ; i += 1 ) { property = arguments [ i ] ; o = o [ property ] ; if ( ! is ( o ) ) { return false ; } } return true ; }
Determines if an object exists and if it does checks that each in
the chain of properties also exist

@param {Object|Any} obj       object to test
@param {String}     [prop...] property chain of the object to test
@memberOf object
@return {Boolean} if the object 'has' (see inline documentation)
Determines if an object exists and if it does checks that each in the chain of properties also exist