dist/ember-testing.js in ember-source-1.9.0.beta.4 vs dist/ember-testing.js in ember-source-1.9.0

- old
+ new

@@ -3,29 +3,34 @@ * @copyright Copyright 2011-2014 Tilde Inc. and contributors * Portions Copyright 2006-2011 Strobe Inc. * Portions Copyright 2008-2011 Apple Inc. All rights reserved. * @license Licensed under MIT license * See https://raw.github.com/emberjs/ember.js/master/LICENSE - * @version 1.9.0-beta.4 + * @version 1.9.0 */ (function() { var enifed, requireModule, eriuqer, requirejs, Ember; (function() { Ember = this.Ember = this.Ember || {}; if (typeof Ember === 'undefined') { Ember = {}; }; + function UNDEFINED() { } if (typeof Ember.__loader === 'undefined') { var registry = {}, seen = {}; enifed = function(name, deps, callback) { registry[name] = { deps: deps, callback: callback }; }; requirejs = eriuqer = requireModule = function(name) { - if (seen.hasOwnProperty(name)) { return seen[name]; } + var s = seen[name]; + + if (s !== undefined) { return seen[name]; } + if (s === UNDEFINED) { return undefined; } + seen[name] = {}; if (!registry[name]) { throw new Error("Could not find module " + name); } @@ -33,37 +38,40 @@ var mod = registry[name]; var deps = mod.deps; var callback = mod.callback; var reified = []; var exports; + var length = deps.length; - for (var i=0, l=deps.length; i<l; i++) { + for (var i=0; i<length; i++) { if (deps[i] === 'exports') { reified.push(exports = {}); } else { - reified.push(requireModule(resolve(deps[i]))); + reified.push(requireModule(resolve(deps[i], name))); } } - var value = callback.apply(this, reified); - return seen[name] = exports || value; + var value = length === 0 ? callback.call(this) : callback.apply(this, reified); - function resolve(child) { - if (child.charAt(0) !== '.') { return child; } - var parts = child.split("/"); - var parentBase = name.split("/").slice(0, -1); + return seen[name] = exports || (value === undefined ? UNDEFINED : value); + }; - for (var i=0, l=parts.length; i<l; i++) { - var part = parts[i]; + function resolve(child, name) { + if (child.charAt(0) !== '.') { return child; } + var parts = child.split("/"); + var parentBase = name.split("/").slice(0, -1); - if (part === '..') { parentBase.pop(); } - else if (part === '.') { continue; } - else { parentBase.push(part); } - } + for (var i=0, l=parts.length; i<l; i++) { + var part = parts[i]; - return parentBase.join("/"); + if (part === '..') { parentBase.pop(); } + else if (part === '.') { continue; } + else { parentBase.push(part); } } - }; + + return parentBase.join("/"); + } + requirejs._eak_seen = registry; Ember.__loader = {define: enifed, require: eriuqer, registry: registry}; } else { enifed = Ember.__loader.define; \ No newline at end of file