dist/ember.js in ember-source-2.12.0 vs dist/ember.js in ember-source-2.12.1

- 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.12.0 + * @version 2.12.1 */ var enifed, requireModule, Ember; var mainContext = this; // Used in ember-environment/lib/global.js @@ -1849,18 +1849,25 @@ this.container = container; this.class = factory; this.fullName = fullName; this.normalizedName = normalizedName; this.madeToString = undefined; + this.injections = undefined; } FactoryManager.prototype.create = function create() { var _this = this; var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - var injections = injectionsFor(this.container, this.normalizedName); + var injections = this.injections; + if (injections === undefined) { + injections = injectionsFor(this.container, this.normalizedName); + if (areInjectionsDynamic(injections) === false) { + this.injections = injections; + } + } var props = _emberUtils.assign({}, injections, options); props[_emberUtils.NAME_KEY] = this.madeToString || (this.madeToString = this.container.registry.makeToString(this.class, this.fullName)); _emberMetal.runInDebug(function () { @@ -18389,11 +18396,11 @@ @param {Function} callback The callback to invoke. It is invoked once per expansion, and is passed the expansion. */ function expandProperties(pattern, callback) { - _emberMetalDebug.assert('A computed property key must be a string', typeof pattern === 'string'); + _emberMetalDebug.assert('A computed property key must be a string, you passed ' + typeof pattern + ' ' + pattern, typeof pattern === 'string'); _emberMetalDebug.assert('Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"', pattern.indexOf(' ') === -1); _emberMetalDebug.assert('Brace expanded properties have to be balanced and cannot be nested, pattern: ' + pattern, (function (str) { var inBrace = 0; var char = undefined; for (var i = 0; i < str.length; i++) { @@ -24866,11 +24873,11 @@ // remove trailing slashes if they exists rootURL = rootURL.replace(/\/$/, ''); baseURL = baseURL.replace(/\/$/, ''); // remove baseURL and rootURL from start of path - var url = path.replace(new RegExp('^' + baseURL + '(?=/|$)'), '').replace(new RegExp('^' + rootURL + '(?=/|$)'), ''); + var url = path.replace(new RegExp('^' + baseURL + '(?=/|$)'), '').replace(new RegExp('^' + rootURL + '(?=/|$)'), '').replace(/\/\/$/g, '/'); // remove extra slashes var search = location.search || ''; url += search + this.getHash(); return url; @@ -42345,10 +42352,11 @@ return result; }); rootElement.on(event + '.ember', '[data-ember-action]', function (evt) { var attributes = evt.currentTarget.attributes; + var handledActions = []; for (var i = 0; i < attributes.length; i++) { var attr = attributes.item(i); var attrName = attr.name; @@ -42356,12 +42364,16 @@ var action = _emberViewsSystemAction_manager.default.registeredActions[attr.value]; // We have to check for action here since in some cases, jQuery will trigger // an event on `removeChild` (i.e. focusout) after we've already torn down the // action handlers for the view. - if (action && action.eventName === eventName) { + if (action && action.eventName === eventName && handledActions.indexOf(action) === -1) { action.handler(evt); + // Action handlers can mutate state which in turn creates new attributes on the element. + // This effect could cause the `data-ember-action` attribute to shift down and be invoked twice. + // To avoid this, we keep track of which actions have been handled. + handledActions.push(action); } } } }); }, @@ -43558,10 +43570,10 @@ // reduced computed macros enifed("ember/version", ["exports"], function (exports) { "use strict"; - exports.default = "2.12.0"; + exports.default = "2.12.1"; }); enifed('internal-test-helpers/apply-mixins', ['exports', 'ember-utils'], function (exports, _emberUtils) { 'use strict'; exports.default = applyMixins;