dist/ember-runtime.js in ember-source-1.5.0.beta.3 vs dist/ember-runtime.js in ember-source-1.5.0.beta.4

- 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.5.0-beta.3+pre.f95d2018 + * @version 1.5.0-beta.4 */ (function() { /*global __fail__*/ @@ -186,11 +186,11 @@ var downloadURL; if(isChrome) { downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi'; } else if(isFirefox) { - downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/' + downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/'; } Ember.debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL); } }, false); @@ -204,11 +204,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.5.0-beta.3 + * @version 1.5.0-beta.4 */ (function() { var define, requireModule, require, requirejs; @@ -287,11 +287,11 @@ The core Runtime framework is based on the jQuery API with a number of performance optimizations. @class Ember @static - @version 1.5.0-beta.3+pre.f95d2018 + @version 1.5.0-beta.4 */ if ('undefined' === typeof Ember) { // Create core object. Make it act like an instance of Ember.Namespace so that // objects assigned to it are given a sane string representation. @@ -314,14 +314,14 @@ /** @property VERSION @type String - @default '1.5.0-beta.3+pre.f95d2018' + @default '1.5.0-beta.4' @static */ -Ember.VERSION = '1.5.0-beta.3+pre.f95d2018'; +Ember.VERSION = '1.5.0-beta.4'; /** Standard environmental variables. You can define these in a global `EmberENV` variable before loading Ember to control various configuration settings. @@ -5824,10 +5824,11 @@ return keyName+BEFORE_OBSERVERS; } /** @method addObserver + @for Ember @param obj @param {String} path @param {Object|Function} targetOrMethod @param {Function|String} [method] */ @@ -5842,10 +5843,11 @@ return Ember.listenersFor(obj, changeEvent(path)); }; /** @method removeObserver + @for Ember @param obj @param {String} path @param {Object|Function} targetOrMethod @param {Function|String} [method] */ @@ -5856,10 +5858,11 @@ return this; }; /** @method addBeforeObserver + @for Ember @param obj @param {String} path @param {Object|Function} targetOrMethod @param {Function|String} [method] */ @@ -5898,10 +5901,11 @@ return Ember.listenersFor(obj, beforeEvent(path)); }; /** @method removeBeforeObserver + @for Ember @param obj @param {String} path @param {Object|Function} targetOrMethod @param {Function|String} [method] */ @@ -12873,11 +12877,11 @@ bindings[keyName] = value; } var desc = m.descs[keyName]; - Ember.assert("Ember.Object.create no longer supports defining computed properties.", !(value instanceof Ember.ComputedProperty)); + Ember.assert("Ember.Object.create no longer supports defining computed properties. Define computed properties using extend() or reopen() before calling create().", !(value instanceof Ember.ComputedProperty)); Ember.assert("Ember.Object.create no longer supports defining methods that call _super.", !(typeof value === 'function' && value.toString().indexOf('._super') !== -1)); Ember.assert("`actions` must be provided at extend time, not at create " + "time, when Ember.ActionHandler is used (i.e. views, " + "controllers & routes).", !((keyName === 'actions') && Ember.ActionHandler.detect(this))); @@ -16994,13 +16998,16 @@ ``` - `itemA` the first item to compare. - `itemB` the second item to compare. - This function should return `-1` when `itemA` should come before - `itemB`. It should return `1` when `itemA` should come after + This function should return negative number (e.g. `-1`) when `itemA` should come before + `itemB`. It should return positive number (e.g. `1`) when `itemA` should come after `itemB`. If the `itemA` and `itemB` are equal this function should return `0`. + + Therefore, if this function is comparing some numeric values, simple `itemA - itemB` or + `itemA.get( 'foo' ) - itemB.get( 'foo' )` can be used instead of series of `if`. Example ```javascript var ToDoList = Ember.Object.extend({ @@ -19547,10 +19554,14 @@ _setupContent: function() { var content = get(this, 'content'); if (content) { + Ember.assert(Ember.String.fmt('ArrayProxy expects an Array or ' + + 'Ember.ArrayProxy, but you passed %@', [typeof content]), + Ember.isArray(content) || content.isDestroyed); + content.addArrayObserver(this, { willChange: 'contentArrayWillChange', didChange: 'contentArrayDidChange' }); } @@ -19580,10 +19591,14 @@ _setupArrangedContent: function() { var arrangedContent = get(this, 'arrangedContent'); if (arrangedContent) { + Ember.assert(Ember.String.fmt('ArrayProxy expects an Array or ' + + 'Ember.ArrayProxy, but you passed %@', [typeof arrangedContent]), + Ember.isArray(arrangedContent) || arrangedContent.isDestroyed); + arrangedContent.addArrayObserver(this, { willChange: 'arrangedContentArrayWillChange', didChange: 'arrangedContentArrayDidChange' }); } @@ -20603,10 +20618,12 @@ })(); (function() { +/*globals CustomEvent */ + var forEach = Ember.ArrayPolyfills.forEach; /** @module ember @submodule ember-runtime @@ -20653,9 +20670,14 @@ @param name {String} name of hook @param object {Object} object to pass to callbacks */ Ember.runLoadHooks = function(name, object) { loaded[name] = object; + + if (typeof window === 'object' && typeof window.dispatchEvent === 'function' && typeof CustomEvent === "function") { + var event = new CustomEvent(name, {detail: object, name: name}); + window.dispatchEvent(event); + } if (loadHooks[name]) { forEach.call(loadHooks[name], function(callback) { callback(object); });