dist/ember-template-compiler.js in ember-source-2.13.0.beta.1 vs dist/ember-template-compiler.js in ember-source-2.13.0.beta.2

- 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.13.0-beta.1 + * @version 2.13.0-beta.2 */ var enifed, requireModule, Ember; var mainContext = this; // Used in ember-environment/lib/global.js @@ -6018,10 +6018,14 @@ @public @since 1.0.0 */ function warn(message, test, options) { + if (arguments.length === 2 && typeof test === 'object') { + options = test; + test = false; + } if (!options) { _emberDebugDeprecate.default(missingOptionsDeprecation, false, { id: 'ember-debug.warn-options-missing', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' @@ -6034,11 +6038,11 @@ until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' }); } - _emberDebugHandlers.invoke.apply(undefined, ['warn'].concat(babelHelpers.slice.call(arguments))); + _emberDebugHandlers.invoke('warn', message, test, options); } }); enifed('ember-environment/global', ['exports'], function (exports) { /* globals global, window, self, mainContext */ @@ -7033,41 +7037,41 @@ // return the value of this node. // // It is false for the root of a chain (because we have no parent) // and for global paths (because the parent node is the object with // the observer on it) - this._watching = value === undefined; + var isWatching = this._watching = value === undefined; this._chains = undefined; this._object = undefined; this.count = 0; this._value = value; - this._paths = {}; - if (this._watching) { + this._paths = undefined; + if (isWatching === true) { var obj = parent.value(); - if (!isObject(obj)) { + if (!isObject(obj) === true) { return; } this._object = obj; addChainWatcher(this._object, this._key, this); } } ChainNode.prototype.value = function value() { - if (this._value === undefined && this._watching) { + if (this._value === undefined && this._watching === true) { var obj = this._parent.value(); this._value = lazyGet(obj, this._key); } return this._value; }; ChainNode.prototype.destroy = function destroy() { - if (this._watching) { + if (this._watching === true) { var obj = this._object; if (obj) { removeChainWatcher(obj, this._key, this); } this._watching = false; // so future calls do nothing @@ -7078,26 +7082,27 @@ ChainNode.prototype.copy = function copy(obj) { var ret = new ChainNode(null, null, obj); var paths = this._paths; var path = undefined; - - for (path in paths) { - // this check will also catch non-number vals. - if (paths[path] <= 0) { - continue; + if (paths !== undefined) { + for (path in paths) { + // this check will also catch non-number vals. + if (paths[path] <= 0) { + continue; + } + ret.add(path); } - ret.add(path); } return ret; }; // called on the root node of a chain to setup watchers on the specified // path. ChainNode.prototype.add = function add(path) { - var paths = this._paths; + var paths = this._paths || (this._paths = {}); paths[path] = (paths[path] || 0) + 1; var key = firstKey(path); var tail = path.slice(key.length + 1); @@ -7107,10 +7112,13 @@ // called on the root node of a chain to teardown watcher on the specified // path ChainNode.prototype.remove = function remove(path) { var paths = this._paths; + if (paths === undefined) { + return; + } if (paths[path] > 0) { paths[path]--; } var key = firstKey(path); @@ -7160,15 +7168,15 @@ node.destroy(); } }; ChainNode.prototype.notify = function notify(revalidate, affected) { - if (revalidate && this._watching) { + if (revalidate && this._watching === true) { var parentValue = this._parent.value(); if (parentValue !== this._object) { - if (this._object) { + if (this._object !== undefined) { removeChainWatcher(this._object, this._key, this); } if (isObject(parentValue)) { this._object = parentValue; @@ -7181,11 +7189,11 @@ } // then notify chains... var chains = this._chains; var node = undefined; - if (chains) { + if (chains !== undefined) { for (var key in chains) { node = chains[key]; if (node !== undefined) { node.notify(revalidate, affected); } @@ -7220,16 +7228,16 @@ } var meta = _emberMetalMeta.peekMeta(obj); // check if object meant only to be a prototype - if (meta && meta.proto === obj) { + if (meta !== undefined && meta.proto === obj) { return; } // Use `get` if the return value is an EachProxy or an uncacheable value. - if (isVolatile(obj[key])) { + if (isVolatile(obj[key]) === true) { return _emberMetalProperty_get.get(obj, key); // Otherwise attempt to get the cached value of the computed property } else { var cache = meta.readableCache(); if (cache) { @@ -7239,21 +7247,21 @@ } function finishChains(obj) { // We only create meta if we really have to var m = _emberMetalMeta.peekMeta(obj); - if (m) { + if (m !== undefined) { m = _emberMetalMeta.meta(obj); // finish any current chains node watchers that reference obj var chainWatchers = m.readableChainWatchers(); - if (chainWatchers) { + if (chainWatchers !== undefined) { chainWatchers.revalidateAll(); } // ensure that if we have inherited any chains they have been // copied onto our own meta. - if (m.readableChains()) { + if (m.readableChains() !== undefined) { m.writableChains(_emberMetalWatch_path.makeChainNode); } } } @@ -8127,10 +8135,13 @@ var meta = _emberMetalMeta.peekMeta(obj); if (!meta) { return; } var actions = meta.matchingListeners(eventName); + if (actions === undefined) { + return; + } var newActions = []; for (var i = actions.length - 3; i >= 0; i -= 3) { var target = actions[i]; var method = actions[i + 1]; @@ -8344,11 +8355,12 @@ function hasListeners(obj, eventName) { var meta = _emberMetalMeta.peekMeta(obj); if (!meta) { return false; } - return meta.matchingListeners(eventName).length > 0; + var matched = meta.matchingListeners(eventName); + return matched !== undefined && matched.length > 0; } /** @private @method listenersFor @@ -8450,11 +8462,11 @@ @param {Function} callback The callback to invoke. It is invoked once per expansion, and is passed the expansion. */ function expandProperties(pattern, callback) { - _emberDebug.assert('A computed property key must be a string', typeof pattern === 'string'); + _emberDebug.assert('A computed property key must be a string, you passed ' + typeof pattern + ' ' + pattern, typeof pattern === 'string'); _emberDebug.assert('Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"', pattern.indexOf(' ') === -1); var unbalancedNestedError = 'Brace expanded properties have to be balanced and cannot be nested, pattern: ' + pattern; var properties = [pattern]; @@ -10501,27 +10513,28 @@ } }, matchingListeners: function (eventName) { var pointer = this; - var result = []; - while (pointer) { + var result = undefined; + while (pointer !== undefined) { var listeners = pointer._listeners; - if (listeners) { + if (listeners !== undefined) { for (var index = 0; index < listeners.length - 3; index += 4) { if (listeners[index] === eventName) { + result = result || []; pushUniqueListener(result, listeners, index); } } } - if (pointer._listenersFinalized) { + if (pointer._listenersFinalized === true) { break; } pointer = pointer.parent; } var sus = this._suspendedListeners; - if (sus) { + if (sus !== undefined && result !== undefined) { for (var susIndex = 0; susIndex < sus.length - 2; susIndex += 3) { if (eventName === sus[susIndex]) { for (var resultIndex = 0; resultIndex < result.length - 2; resultIndex += 3) { if (result[resultIndex] === sus[susIndex + 1] && result[resultIndex + 1] === sus[susIndex + 2]) { result[resultIndex + 2] |= SUSPENDED; @@ -16136,10 +16149,10 @@ exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-improved-instrumentation": false, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": false, "ember-testing-resume-test": true, "ember-factory-for": true, "ember-no-double-extend": true, "ember-routing-router-service": false, "ember-unique-location-history-state": true, "mandatory-setter": true, "ember-glimmer-detect-backtracking-rerender": true }; }); enifed("ember/version", ["exports"], function (exports) { "use strict"; - exports.default = "2.13.0-beta.1"; + exports.default = "2.13.0-beta.2"; }); enifed("handlebars", ["exports"], function (exports) { /* istanbul ignore next */ /* Jison generated parser */ "use strict";