dist/ember-testing.js in ember-source-1.9.1 vs dist/ember-testing.js in ember-source-1.10.0.beta.1

- old
+ new

@@ -3,11 +3,11 @@ * @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.1 + * @version 1.10.0-beta.1 */ (function() { var enifed, requireModule, eriuqer, requirejs, Ember; @@ -30,11 +30,11 @@ if (s === UNDEFINED) { return undefined; } seen[name] = {}; if (!registry[name]) { - throw new Error("Could not find module " + name); + throw new Error('Could not find module ' + name); } var mod = registry[name]; var deps = mod.deps; var callback = mod.callback; @@ -54,28 +54,34 @@ return seen[name] = exports || (value === undefined ? UNDEFINED : value); }; function resolve(child, name) { - if (child.charAt(0) !== '.') { return child; } - var parts = child.split("/"); - var parentBase = name.split("/").slice(0, -1); + if (child.charAt(0) !== '.') { + return child; + } + var parts = child.split('/'); + var parentBase = name.split('/').slice(0, -1); for (var i=0, l=parts.length; i<l; i++) { var part = parts[i]; if (part === '..') { parentBase.pop(); } else if (part === '.') { continue; } else { parentBase.push(part); } } - return parentBase.join("/"); + return parentBase.join('/'); } requirejs._eak_seen = registry; - Ember.__loader = {define: enifed, require: eriuqer, registry: registry}; + Ember.__loader = { + define: enifed, + require: eriuqer, + registry: registry + }; } else { enifed = Ember.__loader.define; requirejs = eriuqer = requireModule = Ember.__loader.require; } })(); @@ -119,11 +125,19 @@ the text of the Error thrown if the assertion fails. @param {Boolean} test Must be truthy for the assertion to pass. If falsy, an exception will be thrown. */ Ember.assert = function(desc, test) { - if (!test) { + var throwAssertion; + + if (Ember.typeOf(test) === 'function') { + throwAssertion = !test(); + } else { + throwAssertion = !test; + } + + if (throwAssertion) { throw new EmberError("Assertion Failed: " + desc); } }; @@ -167,12 +181,20 @@ @param {String} message A description of the deprecation. @param {Boolean} test An optional boolean. If falsy, the deprecation will be displayed. */ Ember.deprecate = function(message, test) { - if (test) { return; } + var noDeprecation; + if (typeof test === 'function') { + noDeprecation = test(); + } else { + noDeprecation = test; + } + + if (noDeprecation) { return; } + if (Ember.ENV.RAISE_ON_DEPRECATION) { throw new EmberError(message); } var error; // When using new Error, we can't do the arguments check for Chrome. Alternatives are welcome @@ -301,10 +323,23 @@ Ember.debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL); } }, false); } } + + /* + We are transitioning away from `ember.js` to `ember.debug.js` to make + it much clearer that it is only for local development purposes. + + This flag value is changed by the tooling (by a simple string replacement) + so that if `ember.js` (which must be output for backwards compat reasons) is + used a nice helpful warning message will be printed out. + */ + var runningNonEmberDebugJS = false; + __exports__.runningNonEmberDebugJS = runningNonEmberDebugJS;if (runningNonEmberDebugJS) { + Ember.warn('Please use `ember.debug.js` instead of `ember.js` for development and debugging.'); + } }); enifed("ember-testing", ["ember-metal/core","ember-testing/initializers","ember-testing/support","ember-testing/setup_for_testing","ember-testing/test","ember-testing/adapters/adapter","ember-testing/adapters/qunit","ember-testing/helpers"], function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__) { "use strict"; @@ -331,17 +366,17 @@ Ember.Test.Adapter = Adapter; Ember.Test.QUnitAdapter = QUnitAdapter; Ember.setupForTesting = setupForTesting; }); enifed("ember-testing/adapters/adapter", - ["ember-metal/core","ember-runtime/system/object","exports"], - function(__dependency1__, __dependency2__, __exports__) { + ["ember-runtime/system/object","exports"], + function(__dependency1__, __exports__) { "use strict"; - var Ember = __dependency1__["default"]; - // Ember.K - var EmberObject = __dependency2__["default"]; + var EmberObject = __dependency1__["default"]; + function K() { return this; } + /** @module ember @submodule ember-testing */ @@ -360,18 +395,18 @@ operations. @public @method asyncStart */ - asyncStart: Ember.K, + asyncStart: K, /** This callback will be called whenever an async operation has completed. @public @method asyncEnd */ - asyncEnd: Ember.K, + asyncEnd: K, /** Override this method with your testing framework's false assertion. This function is called whenever an exception occurs causing the testing promise to fail. \ No newline at end of file