dist/ember.debug.js in ember-source-2.6.0.beta.4 vs dist/ember.debug.js in ember-source-2.6.0

- old
+ new

@@ -4,11 +4,11 @@ * @copyright Copyright 2011-2016 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.6.0-beta.4 + * @version 2.6.0 */ var enifed, requireModule, require, Ember; var mainContext = this; @@ -1478,17 +1478,19 @@ throw new Error('Failed to create an instance of \'' + fullName + '\'. ' + 'Most likely an improperly defined class or an invalid module export.'); } validationCache = container.validationCache; - // Ensure that all lazy injections are valid at instantiation time - if (!validationCache[fullName] && typeof factory._lazyInjections === 'function') { - lazyInjections = factory._lazyInjections(); - lazyInjections = container.registry.normalizeInjectionsHash(lazyInjections); + _emberMetalDebug.runInDebug(function () { + // Ensure that all lazy injections are valid at instantiation time + if (!validationCache[fullName] && typeof factory._lazyInjections === 'function') { + lazyInjections = factory._lazyInjections(); + lazyInjections = container.registry.normalizeInjectionsHash(lazyInjections); - container.registry.validateInjections(lazyInjections); - } + container.registry.validateInjections(lazyInjections); + } + }); validationCache[fullName] = true; var obj = undefined; @@ -4053,14 +4055,17 @@ } else { throw error; } }; + var location = _emberMetalProperty_get.get(router, 'location'); + // Keeps the location adapter's internal URL in-sync - _emberMetalProperty_get.get(router, 'location').setURL(url); + location.setURL(url); - return router.handleURL(url).then(handleResolve, handleReject); + // getURL returns the set url with the rootURL stripped off + return router.handleURL(location.getURL()).then(handleResolve, handleReject); } }); /** A list of boot-time configuration options for customizing the behavior of @@ -10221,11 +10226,11 @@ Additionally, the `mut` helper can be combined with the `action` helper to mutate a value. For example: ```handlebars - {{my-child childClickCount=totalClicks click-count-change=(action (mut "totalClicks"))}} + {{my-child childClickCount=totalClicks click-count-change=(action (mut totalClicks))}} ``` The child `Component` would invoke the action with the new click value: ```javascript @@ -10308,11 +10313,11 @@ @submodule ember-templates */ 'use strict'; - _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.6.0-beta.4'; + _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.6.0'; /** The `{{outlet}}` helper lets you specify where a child route will render in your template. An important use of the `{{outlet}}` helper is in your application's `application.hbs` file: @@ -15235,11 +15240,11 @@ cross-platform libraries such as jQuery. For more details, see [Ember-Runtime](http://emberjs.com/api/modules/ember-runtime.html). @class Ember @static - @version 2.6.0-beta.4 + @version 2.6.0 @public */ if ('undefined' === typeof Ember) { // Create core object. Make it act like an instance of Ember.Namespace so that @@ -15277,15 +15282,15 @@ /** The semantic version. @property VERSION @type String - @default '2.6.0-beta.4' + @default '2.6.0' @static @public */ - Ember.VERSION = '2.6.0-beta.4'; + Ember.VERSION = '2.6.0'; /** The hash of environment variables used to control various configuration settings. To specify your own or override default settings, add the desired properties to a global hash named `EmberENV` (or `ENV` for @@ -24104,12 +24109,12 @@ // remove trailing slashes if they exists rootURL = rootURL.replace(/\/$/, ''); baseURL = baseURL.replace(/\/$/, ''); - // remove baseURL and rootURL from path - var url = path.replace(baseURL, '').replace(rootURL, ''); + // remove baseURL and rootURL from start of path + var url = path.replace(new RegExp('^' + baseURL), '').replace(new RegExp('^' + rootURL), ''); var search = location.search || ''; url += search; url += this.getHash(); @@ -24262,11 +24267,11 @@ @method getHash */ getHash: _emberRoutingLocationApi.default._getHash }); }); -enifed('ember-routing/location/none_location', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-runtime/system/object'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemObject) { +enifed('ember-routing/location/none_location', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-runtime/system/object'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemObject) { 'use strict'; /** @module ember @submodule ember-routing @@ -24285,18 +24290,39 @@ */ exports.default = _emberRuntimeSystemObject.default.extend({ implementation: 'none', path: '', + detect: function () { + var rootURL = this.rootURL; + + _emberMetalDebug.assert('rootURL must end with a trailing forward slash e.g. "/app/"', rootURL.charAt(rootURL.length - 1) === '/'); + }, + /** - Returns the current path. + Will be pre-pended to path. @private + @property rootURL + @default '/' + */ + rootURL: '/', + + /** + Returns the current path without `rootURL`. + @private @method getURL @return {String} path */ getURL: function () { - return _emberMetalProperty_get.get(this, 'path'); + var path = _emberMetalProperty_get.get(this, 'path'); + var rootURL = _emberMetalProperty_get.get(this, 'rootURL'); + + // remove trailing slashes if they exists + rootURL = rootURL.replace(/\/$/, ''); + + // remove rootURL from url + return path.replace(new RegExp('^' + rootURL), ''); }, /** Set the path and remembers what was set. Using this method to change the path will not invoke the `updateURL` callback. @@ -24340,14 +24366,18 @@ @method formatURL @param url {String} @return {String} url */ formatURL: function (url) { - // The return value is not overly meaningful, but we do not want to throw - // errors when test code renders templates containing {{action href=true}} - // helpers. - return url; + var rootURL = _emberMetalProperty_get.get(this, 'rootURL'); + + if (url !== '') { + // remove trailing slashes if they exists + rootURL = rootURL.replace(/\/$/, ''); + } + + return rootURL + url; } }); }); enifed('ember-routing/location/util', ['exports'], function (exports) { /** @@ -36029,11 +36059,11 @@ var mergedProperties = this.mergedProperties; for (var i = 0, l = props.length; i < l; i++) { var properties = props[i]; - _emberMetalDebug.assert('Ember.Object.create no longer supports mixing in other ' + 'definitions, use .extend & .create seperately instead.', !(properties instanceof _emberMetalMixin.Mixin)); + _emberMetalDebug.assert('Ember.Object.create no longer supports mixing in other ' + 'definitions, use .extend & .create separately instead.', !(properties instanceof _emberMetalMixin.Mixin)); if (typeof properties !== 'object' && properties !== undefined) { throw new _emberMetalError.default('Ember.Object.create only accepts objects.'); } @@ -39142,11 +39172,11 @@ options.plugins = plugins; options.buildMeta = function buildMeta(program) { return { fragmentReason: fragmentReason(program), - revision: 'Ember@2.6.0-beta.4', + revision: 'Ember@2.6.0', loc: program.loc, moduleName: options.moduleName }; }; @@ -40716,11 +40746,11 @@ ``` ```handlebars <!-- app-profile template --> <h1>{{person.title}}</h1> - {{! Executed in the components context. }} + {{! Executed in the component's context. }} {{yield}} {{! block contents }} ``` If you want to customize the component, in order to handle events or actions, you implement a subclass @@ -40767,10 +40797,10 @@ */ var Component = _emberViewsViewsView.default.extend(_emberRuntimeMixinsTarget_action_support.default, { isComponent: true, /* This is set so that the proto inspection in appendTemplatedView does not - think that it should set the components `context` to that of the parent view. + think that it should set the component's `context` to that of the parent view. */ controller: null, context: null, instrumentName: 'component',