ember-runtime.js
function normalizeTuple(target, path) {
  var hasThis  = HAS_THIS.test(path),
      isGlobal = !hasThis && IS_GLOBAL_PATH.test(path),
      key;

  if (!target || isGlobal) target = Ember.lookup;
  if (hasThis) path = path.slice(5);

  if (target === Ember.lookup) {
    key = firstKey(path);
    target = get(target, key);
    path   = path.slice(key.length+1);
  }

  // must return some kind of path to be valid else other things will break.
  if (!path || path.length===0) throw new Error('Invalid Path');

  return [ target, path ];
}
function normalizeTuple(target, path) {
  var hasThis  = HAS_THIS.test(path),
      isGlobal = !hasThis && IS_GLOBAL_PATH.test(path),
      key;

  if (!target || isGlobal) target = Ember.lookup;
  if (hasThis) path = path.slice(5);

  if (target === Ember.lookup) {
    key = firstKey(path);
    target = get(target, key);
    path   = path.slice(key.length+1);
  }

  // must return some kind of path to be valid else other things will break.
  if (!path || path.length===0) throw new Error('Invalid Path');

  return [ target, path ];
}
function normalizeTuple ( target , path ) { var hasThis = HAS_THIS . test ( path ) , isGlobal = ! hasThis && IS_GLOBAL_PATH . test ( path ) , key ; if ( ! target || isGlobal ) target = Ember . lookup ; if ( hasThis ) path = path . slice ( 5 ) ; if ( target === Ember . lookup ) { key = firstKey ( path ) ; target = get ( target , key ) ; path = path . slice ( key . length + 1 ) ; } // must return some kind of path to be valid else other things will break. if ( ! path || path . length === 0 ) throw new Error ( 'Invalid Path' ) ; return [ target , path ] ; }
assumes path is already normalized
assumes path is already normalized