dist/ember-runtime.js in ember-source-2.14.0.beta.2 vs dist/ember-runtime.js in ember-source-2.14.0.beta.3

- old
+ new

@@ -4,11 +4,11 @@ * @copyright Copyright 2011-2017 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 2.14.0-beta.2 + * @version 2.14.0-beta.3 */ var enifed, requireModule, Ember; var mainContext = this; // Used in ember-environment/lib/global.js @@ -146,16 +146,16 @@ this.isDestroyed = false; } Container.prototype = { lookup: function (fullName, options) { - (true && (0, _emberDebug.assert)('fullName must be a proper full name', this.registry.validateFullName(fullName))); + (true && !(this.registry.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.registry.validateFullName(fullName))); return lookup(this, this.registry.normalize(fullName), options); }, lookupFactory: function (fullName, options) { - (true && (0, _emberDebug.assert)('fullName must be a proper full name', this.registry.validateFullName(fullName))); + (true && !(this.registry.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.registry.validateFullName(fullName))); (true && !(false) && (0, _emberDebug.deprecate)('Using "_lookupFactory" is deprecated. Please use container.factoryFor instead.', false, { id: 'container-lookupFactory', until: '2.13.0', url: 'http://emberjs.com/deprecations/v2.x/#toc_migrating-from-_lookupfactory-to-factoryfor' })); return deprecatedFactoryFor(this, this.registry.normalize(fullName), options); }, @@ -178,11 +178,11 @@ factoryFor: function (fullName) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var normalizedName = this.registry.normalize(fullName); - (true && (0, _emberDebug.assert)('fullName must be a proper full name', this.registry.validateFullName(normalizedName))); + (true && !(this.registry.validateFullName(normalizedName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.registry.validateFullName(normalizedName))); if (options.source) { normalizedName = this.registry.expandLocalLookup(fullName, options); // if expandLocalLookup returns falsey, we do not support local lookup @@ -746,11 +746,11 @@ container: function (options) { return new Container(this, options); }, register: function (fullName, factory) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - (true && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName))); + (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName))); if (factory === undefined) { throw new TypeError('Attempting to register an unknown factory: \'' + fullName + '\''); } @@ -764,11 +764,11 @@ delete this._failCache[normalizedName]; this.registrations[normalizedName] = factory; this._options[normalizedName] = options; }, unregister: function (fullName) { - (true && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName))); + (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName))); var normalizedName = this.normalize(fullName); this._localLookupCache = Object.create(null); @@ -777,11 +777,11 @@ delete this._resolveCache[normalizedName]; delete this._failCache[normalizedName]; delete this._options[normalizedName]; }, resolve: function (fullName, options) { - (true && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName))); + (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName))); var factory = resolve(this, this.normalize(fullName), options); if (factory === undefined && this.fallback) { var _fallback; @@ -868,11 +868,11 @@ } else if (this.fallback) { return this.fallback.getOption(fullName, optionName); } }, typeInjection: function (type, property, fullName) { - (true && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName))); + (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName))); var fullNameType = fullName.split(':')[0]; if (fullNameType === type) { throw new Error('Cannot inject a \'' + fullName + '\' on other ' + type + '(s).'); @@ -891,11 +891,11 @@ if (fullName.indexOf(':') === -1) { return this.typeInjection(fullName, property, normalizedInjectionName); } - (true && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName))); + (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName))); var normalizedName = this.normalize(fullName); var injections = this._injections[normalizedName] || (this._injections[normalizedName] = []); @@ -972,19 +972,19 @@ var fullName = void 0; for (var i = 0; i < injections.length; i++) { fullName = injections[i].fullName; - (true && (0, _emberDebug.assert)('Attempting to inject an unknown injection: \'' + fullName + '\'', this.has(fullName))); + (true && !(this.has(fullName)) && (0, _emberDebug.assert)('Attempting to inject an unknown injection: \'' + fullName + '\'', this.has(fullName))); } }, normalizeInjectionsHash: function (hash) { var injections = []; for (var key in hash) { if (hash.hasOwnProperty(key)) { - (true && (0, _emberDebug.assert)('Expected a proper full name, given \'' + hash[key] + '\'', this.validateFullName(hash[key]))); + (true && !(this.validateFullName(hash[key])) && (0, _emberDebug.assert)('Expected a proper full name, given \'' + hash[key] + '\'', this.validateFullName(hash[key]))); injections.push({ property: key, fullName: hash[key] @@ -1050,13 +1050,13 @@ @param {String} [options.source] the fullname of the request source (used for local lookups) @return {String} fullName */ Registry.prototype.expandLocalLookup = function Registry_expandLocalLookup(fullName, options) { if (this.resolver && this.resolver.expandLocalLookup) { - (true && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName))); - (true && (0, _emberDebug.assert)('options.source must be provided to expandLocalLookup', options && options.source)); - (true && (0, _emberDebug.assert)('options.source must be a proper full name', this.validateFullName(options.source))); + (true && !(this.validateFullName(fullName)) && (0, _emberDebug.assert)('fullName must be a proper full name', this.validateFullName(fullName))); + (true && !(options && options.source) && (0, _emberDebug.assert)('options.source must be provided to expandLocalLookup', options && options.source)); + (true && !(this.validateFullName(options.source)) && (0, _emberDebug.assert)('options.source must be a proper full name', this.validateFullName(options.source))); var normalizedFullName = this.normalize(fullName); var normalizedSource = this.normalize(options.source); @@ -1478,13 +1478,10 @@ @for EmberENV @public */ ENV.LOG_VERSION = defaultTrue(ENV.LOG_VERSION); - // default false - ENV.MODEL_FACTORY_INJECTIONS = defaultFalse(ENV.MODEL_FACTORY_INJECTIONS); - /** Debug parameter you can turn on. This will log all bindings that fire to the console. This should be disabled in production code. Note that you can also enable this from the console or temporarily. @@ -1807,11 +1804,11 @@ @param {Function|String} method A function or the name of a function to be called on `target` @param {Boolean} once A flag whether a function should only be called once @public */ function addListener(obj, eventName, target, method, once) { - true && emberDebug.assert('You must pass at least an object and event name to Ember.addListener', !!obj && !!eventName); + true && !(!!obj && !!eventName) && emberDebug.assert('You must pass at least an object and event name to Ember.addListener', !!obj && !!eventName); true && !(eventName !== 'didInitAttrs') && emberDebug.deprecate('didInitAttrs called in ' + (obj && obj.toString && obj.toString()) + '.', eventName !== 'didInitAttrs', { id: 'ember-views.did-init-attrs', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_ember-component-didinitattrs' }); @@ -1845,11 +1842,11 @@ @param {Object|Function} target A target object or a function @param {Function|String} method A function or the name of a function to be called on `target` @public */ function removeListener(obj, eventName, target, method) { - true && emberDebug.assert('You must pass at least an object and event name to Ember.removeListener', !!obj && !!eventName); + true && !(!!obj && !!eventName) && emberDebug.assert('You must pass at least an object and event name to Ember.removeListener', !!obj && !!eventName); if (!method && 'function' === typeof target) { method = target; target = null; } @@ -2284,11 +2281,11 @@ var message = 'You modified "' + label + '" twice on ' + object + ' in a single render. It was rendered in ' + lastRenderedIn + ' and modified in ' + currentlyIn + '. This was unreliable and slow in Ember 1.x and'; if (ember_features.EMBER_GLIMMER_ALLOW_BACKTRACKING_RERENDER) { true && !false && emberDebug.deprecate(message + ' will be removed in Ember 3.0.', false, { id: 'ember-views.render-double-modify', until: '3.0.0' }); } else { - true && emberDebug.assert(message + ' is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.', false); + true && !false && emberDebug.assert(message + ' is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.', false); } } shouldReflush = true; } @@ -2620,11 +2617,11 @@ function SETTER_FUNCTION(value) { var m = exports.peekMeta(this); if (!m.isInitialized(this)) { m.writeValues(name, value); } else { - true && emberDebug.assert('You must use Ember.set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false); + true && !false && emberDebug.assert('You must use Ember.set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false); } } SETTER_FUNCTION.isMandatorySetter = true; return SETTER_FUNCTION; @@ -3597,11 +3594,11 @@ // Implements a member that provides a lazily created map of maps, // with inheritance at both levels. Meta.prototype.writeDeps = function writeDeps(subkey, itemkey, value) { - true && emberDebug.assert('Cannot call writeDeps after the object is destroyed.', !this.isMetaDestroyed()); + true && !!this.isMetaDestroyed() && emberDebug.assert('Cannot call writeDeps after the object is destroyed.', !this.isMetaDestroyed()); var outerMap = this._getOrCreateOwnMap('_deps'); var innerMap = outerMap[subkey]; if (innerMap === undefined) { innerMap = outerMap[subkey] = Object.create(null); @@ -3744,11 +3741,11 @@ function inheritedMap(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['write' + capitalized] = function (subkey, value) { - true && emberDebug.assert('Cannot call write' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); + true && !!this.isMetaDestroyed() && emberDebug.assert('Cannot call write' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); var map = this._getOrCreateOwnMap(key); map[subkey] = value; }; @@ -3773,11 +3770,11 @@ pointer = pointer.parent; } }; Meta.prototype['clear' + capitalized] = function () { - true && emberDebug.assert('Cannot call clear' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); + true && !!this.isMetaDestroyed() && emberDebug.assert('Cannot call clear' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); this[key] = undefined; }; Meta.prototype['deleteFrom' + capitalized] = function (subkey) { @@ -3795,11 +3792,11 @@ // object using the method you provide. function ownCustomObject(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['writable' + capitalized] = function (create) { - true && emberDebug.assert('Cannot call writable' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); + true && !!this.isMetaDestroyed() && emberDebug.assert('Cannot call writable' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); var ret = this[key]; if (ret === undefined) { ret = this[key] = create(this.source); } @@ -3815,11 +3812,11 @@ // their parents by calling your object's `copy()` method. function inheritedCustomObject(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['writable' + capitalized] = function (create) { - true && emberDebug.assert('Cannot call writable' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); + true && !!this.isMetaDestroyed() && emberDebug.assert('Cannot call writable' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); var ret = this[key]; if (ret === undefined) { if (this.parent) { ret = this[key] = this.parent['writable' + capitalized](create).copy(this.source); @@ -4183,15 +4180,15 @@ @param {String} keyName The property key to retrieve @return {Object} the property value or `null`. @public */ function get(obj, keyName) { - true && emberDebug.assert('Get must be called with two arguments; an object and a property key', arguments.length === 2); - true && emberDebug.assert('Cannot call get with \'' + keyName + '\' on an undefined object.', obj !== undefined && obj !== null); - true && emberDebug.assert('The key provided to get must be a string, you passed ' + keyName, typeof keyName === 'string'); - true && emberDebug.assert('\'this\' in paths is not supported', !hasThis(keyName)); - true && emberDebug.assert('Cannot call `Ember.get` with an empty string', keyName !== ''); + true && !(arguments.length === 2) && emberDebug.assert('Get must be called with two arguments; an object and a property key', arguments.length === 2); + true && !(obj !== undefined && obj !== null) && emberDebug.assert('Cannot call get with \'' + keyName + '\' on an undefined object.', obj !== undefined && obj !== null); + true && !(typeof keyName === 'string') && emberDebug.assert('The key provided to get must be a string, you passed ' + keyName, typeof keyName === 'string'); + true && !!hasThis(keyName) && emberDebug.assert('\'this\' in paths is not supported', !hasThis(keyName)); + true && !(keyName !== '') && emberDebug.assert('Cannot call `Ember.get` with an empty string', keyName !== ''); var value = obj[keyName]; var desc = value !== null && typeof value === 'object' && value.isDescriptor ? value : undefined; var ret = void 0; @@ -4281,15 +4278,15 @@ @param {Object} value The value to set @return {Object} the passed value. @public */ function set(obj, keyName, value, tolerant) { - true && emberDebug.assert('Set must be called with three or four arguments; an object, a property key, a value and tolerant true/false', arguments.length === 3 || arguments.length === 4); - true && emberDebug.assert('Cannot call set with \'' + keyName + '\' on an undefined object.', obj && typeof obj === 'object' || typeof obj === 'function'); - true && emberDebug.assert('The key provided to set must be a string, you passed ' + keyName, typeof keyName === 'string'); - true && emberDebug.assert('\'this\' in paths is not supported', !hasThis(keyName)); - true && emberDebug.assert('calling set on destroyed object: ' + emberUtils.toString(obj) + '.' + keyName + ' = ' + emberUtils.toString(value), !obj.isDestroyed); + true && !(arguments.length === 3 || arguments.length === 4) && emberDebug.assert('Set must be called with three or four arguments; an object, a property key, a value and tolerant true/false', arguments.length === 3 || arguments.length === 4); + true && !(obj && typeof obj === 'object' || typeof obj === 'function') && emberDebug.assert('Cannot call set with \'' + keyName + '\' on an undefined object.', obj && typeof obj === 'object' || typeof obj === 'function'); + true && !(typeof keyName === 'string') && emberDebug.assert('The key provided to set must be a string, you passed ' + keyName, typeof keyName === 'string'); + true && !!hasThis(keyName) && emberDebug.assert('\'this\' in paths is not supported', !hasThis(keyName)); + true && !!obj.isDestroyed && emberDebug.assert('calling set on destroyed object: ' + emberUtils.toString(obj) + '.' + keyName + ' = ' + emberUtils.toString(value), !obj.isDestroyed); if (isPath(keyName)) { return setPath(obj, keyName, value, tolerant); } @@ -4307,11 +4304,11 @@ if (desc) { /* computed property */ desc.set(obj, keyName, value); } else if (obj.setUnknownProperty && currentValue === undefined && !(keyName in obj)) { /* unknown property */ - true && emberDebug.assert('setUnknownProperty must be a function', typeof obj.setUnknownProperty === 'function'); + true && !(typeof obj.setUnknownProperty === 'function') && emberDebug.assert('setUnknownProperty must be a function', typeof obj.setUnknownProperty === 'function'); obj.setUnknownProperty(keyName, value); } else if (currentValue === value) { /* no change */ return value; @@ -4429,61 +4426,42 @@ @param {String} pattern The property pattern to expand. @param {Function} callback The callback to invoke. It is invoked once per expansion, and is passed the expansion. */ function expandProperties(pattern, callback) { - true && emberDebug.assert('A computed property key must be a string, you passed ' + typeof pattern + ' ' + pattern, typeof pattern === 'string'); - true && emberDebug.assert('Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"', pattern.indexOf(' ') === -1); + true && !(typeof pattern === 'string') && emberDebug.assert('A computed property key must be a string, you passed ' + typeof pattern + ' ' + pattern, typeof pattern === 'string'); + true && !(pattern.indexOf(' ') === -1) && emberDebug.assert('Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"', pattern.indexOf(' ') === -1); + // regex to look for double open, double close, or unclosed braces - var unbalancedNestedError = 'Brace expanded properties have to be balanced and cannot be nested, pattern: ' + pattern; - var properties = [pattern]; + true && !(pattern.match(/\{[^}{]*\{|\}[^}{]*\}|\{[^}]*$/g) === null) && emberDebug.assert('Brace expanded properties have to be balanced and cannot be nested, pattern: ' + pattern, pattern.match(/\{[^}{]*\{|\}[^}{]*\}|\{[^}]*$/g) === null); - // Iterating backward over the pattern makes dealing with indices easier. - var bookmark = void 0; - var inside = false; - for (var i = pattern.length; i > 0; --i) { - var current = pattern[i - 1]; + var start = pattern.indexOf('{'); + if (start < 0) { + callback(pattern.replace(END_WITH_EACH_REGEX, '.[]')); + } else { + dive('', pattern, start, callback); + } + } - switch (current) { - // Closing curly brace will be the first character of the brace expansion we encounter. - // Bookmark its index so long as we're not already inside a brace expansion. - case '}': - if (!inside) { - bookmark = i - 1; - inside = true; - } else { - true && emberDebug.assert(unbalancedNestedError, false); - } - break; - // Opening curly brace will be the last character of the brace expansion we encounter. - // Apply the brace expansion so long as we've already seen a closing curly brace. - case '{': - if (inside) { - var expansion = pattern.slice(i, bookmark).split(','); - // Iterating backward allows us to push new properties w/out affecting our "cursor". - for (var j = properties.length; j > 0; --j) { - // Extract the unexpanded property from the array. - var property = properties.splice(j - 1, 1)[0]; - // Iterate over the expansion, pushing the newly formed properties onto the array. - for (var k = 0; k < expansion.length; ++k) { - properties.push(property.slice(0, i - 1) + expansion[k] + property.slice(bookmark + 1)); - } - } - inside = false; - } else { - true && emberDebug.assert(unbalancedNestedError, false); - } - break; + function dive(prefix, pattern, start, callback) { + var end = pattern.indexOf('}'), + i = 0, + newStart = void 0, + arrayLength = void 0; + var tempArr = pattern.substring(start + 1, end).split(','); + var after = pattern.substring(end + 1); + prefix = prefix + pattern.substring(0, start); + + arrayLength = tempArr.length; + while (i < arrayLength) { + newStart = after.indexOf('{'); + if (newStart < 0) { + callback((prefix + tempArr[i++] + after).replace(END_WITH_EACH_REGEX, '.[]')); + } else { + dive(prefix + tempArr[i++], after, newStart, callback); } } - if (inside) { - true && emberDebug.assert(unbalancedNestedError, false); - } - - for (var _i = 0; _i < properties.length; _i++) { - callback(properties[_i].replace(END_WITH_EACH_REGEX, '.[]')); - } } /** @module ember-metal */ @@ -4703,25 +4681,31 @@ function ComputedProperty(config, opts) { this.isDescriptor = true; if (typeof config === 'function') { this._getter = config; } else { - true && emberDebug.assert('Ember.computed expects a function or an object as last argument.', typeof config === 'object' && !Array.isArray(config)); - true && emberDebug.assert('Config object passed to an Ember.computed can only contain `get` or `set` keys.', function () { + true && !(typeof config === 'object' && !Array.isArray(config)) && emberDebug.assert('Ember.computed expects a function or an object as last argument.', typeof config === 'object' && !Array.isArray(config)); + true && !function () { var keys = Object.keys(config); for (var i = 0; i < keys.length; i++) { if (keys[i] !== 'get' && keys[i] !== 'set') { return false; } } return true; + }() && emberDebug.assert('Config object passed to an Ember.computed can only contain `get` or `set` keys.', function () { + var keys = Object.keys(config);for (var i = 0; i < keys.length; i++) { + if (keys[i] !== 'get' && keys[i] !== 'set') { + return false; + } + }return true; }()); this._getter = config.get; this._setter = config.set; } - true && emberDebug.assert('Computed properties must receive a getter or a setter, you passed none.', !!this._getter || !!this._setter); + true && !(!!this._getter || !!this._setter) && emberDebug.assert('Computed properties must receive a getter or a setter, you passed none.', !!this._getter || !!this._setter); this._dependentKeys = undefined; this._suspended = undefined; this._meta = undefined; this._volatile = false; @@ -4783,11 +4767,11 @@ @chainable @public */ ComputedPropertyPrototype.readOnly = function () { this._readOnly = true; - true && emberDebug.assert('Computed properties that define a setter using the new syntax cannot be read-only', !(this._readOnly && this._setter && this._setter !== this._getter)); + true && !!(this._readOnly && this._setter && this._setter !== this._getter) && emberDebug.assert('Computed properties that define a setter using the new syntax cannot be read-only', !(this._readOnly && this._setter && this._setter !== this._getter)); return this; }; /** @@ -5183,11 +5167,11 @@ _this._dependentKeys = [altKey]; return _this; } AliasedProperty.prototype.setup = function setup(obj, keyName) { - true && emberDebug.assert('Setting alias \'' + keyName + '\' on self', this.altKey !== keyName); + true && !(this.altKey !== keyName) && emberDebug.assert('Setting alias \'' + keyName + '\' on self', this.altKey !== keyName); var meta$$1 = meta(obj); if (meta$$1.peekWatching(keyName)) { addDependentKeys(this, obj, keyName, meta$$1); } @@ -6164,11 +6148,11 @@ @param {Object} [arguments*] Optional arguments to be passed to the queued method. @return {*} Timer information for use in cancelling, see `run.cancel`. @public */ run$1.schedule = function () /* queue, target, method */{ - true && emberDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run$1.currentRunLoop || !emberDebug.isTesting()); + true && !(run$1.currentRunLoop || !emberDebug.isTesting()) && emberDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run$1.currentRunLoop || !emberDebug.isTesting()); return backburner.schedule.apply(backburner, arguments); }; // Used by global test teardown @@ -6246,11 +6230,11 @@ @param {Object} [args*] Optional arguments to pass to the timeout. @return {Object} Timer information for use in cancelling, see `run.cancel`. @public */ run$1.once = function () { - true && emberDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run$1.currentRunLoop || !emberDebug.isTesting()); + true && !(run$1.currentRunLoop || !emberDebug.isTesting()) && emberDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run$1.currentRunLoop || !emberDebug.isTesting()); for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } @@ -6309,11 +6293,11 @@ @param {Object} [args*] Optional arguments to pass to the timeout. @return {Object} Timer information for use in cancelling, see `run.cancel`. @public */ run$1.scheduleOnce = function () /*queue, target, method*/{ - true && emberDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run$1.currentRunLoop || !emberDebug.isTesting()); + true && !(run$1.currentRunLoop || !emberDebug.isTesting()) && emberDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run$1.currentRunLoop || !emberDebug.isTesting()); return backburner.scheduleOnce.apply(backburner, arguments); }; /** @@ -7432,11 +7416,11 @@ @return {Ember.Binding} `this` @public */ Binding.prototype.connect = function connect(obj) { - true && emberDebug.assert('Must pass a valid object to Ember.Binding.connect()', !!obj); + true && !!!obj && emberDebug.assert('Must pass a valid object to Ember.Binding.connect()', !!obj); var fromObj = void 0, fromPath = void 0, possibleGlobal = void 0; @@ -7486,11 +7470,11 @@ @return {Ember.Binding} `this` @public */ Binding.prototype.disconnect = function disconnect() { - true && emberDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!this._toObj); + true && !!!this._toObj && emberDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!this._toObj); // Remove an observer on the object so we're no longer notified of // changes that should update bindings. removeObserver(this._fromObj, this._fromPath, this, 'fromDidChange'); @@ -7917,11 +7901,11 @@ var baseValue = values[key] || obj[key]; { if (isArray(value)) { // use conditional to avoid stringifying every time - true && emberDebug.assert('You passed in `' + JSON.stringify(value) + '` as the value for `' + key + '` but `' + key + '` cannot be an Array', false); + true && !false && emberDebug.assert('You passed in `' + JSON.stringify(value) + '` as the value for `' + key + '` but `' + key + '` cannot be an Array', false); } } if (!baseValue) { return value; @@ -7992,11 +7976,11 @@ delete values[keyName]; } for (var i = 0; i < mixins.length; i++) { currentMixin = mixins[i]; - true && emberDebug.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'); + true && !(typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]') && emberDebug.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'); props = mixinProperties(meta$$1, currentMixin); if (props === CONTINUE) { continue; } @@ -8362,11 +8346,11 @@ var mixins = this.mixins; var idx = void 0; for (idx = 0; idx < arguments.length; idx++) { currentMixin = arguments[idx]; - true && emberDebug.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'); + true && !(typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]') && emberDebug.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'); if (currentMixin instanceof Mixin) { mixins.push(currentMixin); } else { mixins.push(new Mixin(undefined, currentMixin)); @@ -8613,11 +8597,11 @@ function _immediateObserver() { true && !false && emberDebug.deprecate('Usage of `Ember.immediateObserver` is deprecated, use `Ember.observer` instead.', false, { id: 'ember-metal.immediate-observer', until: '3.0.0' }); for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; - true && emberDebug.assert('Immediate observers must observe internal properties only, not properties on other objects.', typeof arg !== 'string' || arg.indexOf('.') === -1); + true && !(typeof arg !== 'string' || arg.indexOf('.') === -1) && emberDebug.assert('Immediate observers must observe internal properties only, not properties on other objects.', typeof arg !== 'string' || arg.indexOf('.') === -1); } return observer.apply(this, arguments); } @@ -8693,11 +8677,11 @@ function injectedPropertyGet(keyName) { var desc = this[keyName]; var owner = emberUtils.getOwner(this) || this.container; // fallback to `container` for backwards compat - true && emberDebug.assert('InjectedProperties should be defined with the Ember.inject computed property macros.', desc && desc.isDescriptor && desc.type); - true && emberDebug.assert('Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.', owner); + true && !(desc && desc.isDescriptor && desc.type) && emberDebug.assert('InjectedProperties should be defined with the Ember.inject computed property macros.', desc && desc.isDescriptor && desc.type); + true && !owner && emberDebug.assert('Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.', owner); return owner.lookup(desc.type + ':' + (desc.name || keyName)); } InjectedProperty.prototype = Object.create(Descriptor.prototype);