dist/ember.js in ember-source-2.4.6 vs dist/ember.js in ember-source-2.5.0.beta.1
- 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.4.6
+ * @version 2.5.0-beta.1
*/
var enifed, requireModule, require, requirejs, Ember;
var mainContext = this;
@@ -1234,11 +1234,11 @@
// by default the container will return singletons
var twitter2 = container.lookup('api:twitter');
twitter2 instanceof Twitter; // => true
twitter === twitter2; //=> true
```
- If singletons are not wanted an optional flag can be provided at lookup.
+ If singletons are not wanted, an optional flag can be provided at lookup.
```javascript
var registry = new Registry();
var container = registry.container();
registry.register('api:twitter', Twitter);
var twitter = container.lookup('api:twitter', { singleton: false });
@@ -1256,11 +1256,11 @@
_emberMetalDebug.assert('fullName must be a proper full name', this.registry.validateFullName(fullName));
return lookup(this, this.registry.normalize(fullName), options);
},
/**
- Given a fullName return the corresponding factory.
+ Given a fullName, return the corresponding factory.
@private
@method lookupFactory
@param {String} fullName
@param {Object} [options]
@param {String} [options.source] The fullname of the request source (used for local lookup)
@@ -1317,14 +1317,24 @@
function isSingleton(container, fullName) {
return container.registry.getOption(fullName, 'singleton') !== false;
}
- function lookup(container, _fullName, _options) {
- var options = _options || {};
- var fullName = _fullName;
+ function lookup(container, fullName) {
+ var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
+ if (_emberMetalFeatures.default('ember-htmlbars-local-lookup')) {
+ if (options.source) {
+ fullName = container.registry.expandLocalLookup(fullName, options);
+
+ // if expandLocalLookup returns falsey, we do not support local lookup
+ if (!fullName) {
+ return;
+ }
+ }
+ }
+
if (container.cache[fullName] !== undefined && options.singleton !== false) {
return container.cache[fullName];
}
var value = instantiate(container, fullName);
@@ -1374,15 +1384,26 @@
}
return hash;
}
- function factoryFor(container, _fullName, _options) {
- var options = _options || {};
+ function factoryFor(container, fullName) {
+ var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
+
var registry = container.registry;
- var fullName = _fullName;
+ if (_emberMetalFeatures.default('ember-htmlbars-local-lookup')) {
+ if (options.source) {
+ fullName = registry.expandLocalLookup(fullName, options);
+
+ // if expandLocalLookup returns falsey, we do not support local lookup
+ if (!fullName) {
+ return;
+ }
+ }
+ }
+
var cache = container.factoryCache;
if (cache[fullName]) {
return cache[fullName];
}
var factory = registry.resolve(fullName);
@@ -1566,26 +1587,22 @@
}
}
exports.default = Container;
});
-
-// if expandLocalLookup returns falsey, we do not support local lookup
-
-// if expandLocalLookup returns falsey, we do not support local lookup
enifed('container/index', ['exports', 'ember-metal/core', 'container/registry', 'container/container', 'container/owner'], function (exports, _emberMetalCore, _containerRegistry, _containerContainer, _containerOwner) {
'use strict';
/*
- Public api for the container is still in flux.
- The public api, specified on the application namespace should be considered the stable api.
+ Public API for the container is still in flux.
+ The public API, specified on the application namespace should be considered the stable API.
// @module container
@private
*/
/*
- Flag to enable/disable model factory injections (disabled by default)
+ Flag to enable/disable model factory injections (disabled by default).
If model factory injections are enabled, models should not be
accessed globally (only through `container.lookupFactory('model:modelName'))`);
*/
_emberMetalCore.default.MODEL_FACTORY_INJECTIONS = false;
@@ -1643,12 +1660,12 @@
}
});
```
@method getOwner
- @param {Object} object A object with an owner.
- @return {Object} an owner object.
+ @param {Object} object An object with an owner.
+ @return {Object} An owner object.
@for Ember
@public
*/
function getOwner(object) {
@@ -1658,12 +1675,12 @@
/**
`setOwner` forces a new owner on a given object instance. This is primarily
useful in some testing cases.
@method setOwner
- @param {Object} object A object with an owner.
- @return {Object} an owner object.
+ @param {Object} object An object with an owner.
+ @return {Object} An owner object.
@for Ember
@public
*/
function setOwner(object, owner) {
@@ -1819,11 +1836,13 @@
@method register
@param {String} fullName
@param {Function} factory
@param {Object} options
*/
- register: function (fullName, factory, options) {
+ register: function (fullName, factory) {
+ var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
+
_emberMetalDebug.assert('fullName must be a proper full name', this.validateFullName(fullName));
if (factory === undefined) {
throw new TypeError('Attempting to register an unknown factory: `' + fullName + '`');
}
@@ -1834,11 +1853,11 @@
throw new Error('Cannot re-register: `' + fullName + '`, as it has already been resolved.');
}
delete this._failCache[normalizedName];
this.registrations[normalizedName] = factory;
- this._options[normalizedName] = options || {};
+ this._options[normalizedName] = options;
},
/**
Unregister a fullName
```javascript
@@ -1982,10 +2001,13 @@
*/
has: function (fullName, options) {
_emberMetalDebug.assert('fullName must be a proper full name', this.validateFullName(fullName));
var source = undefined;
+ if (_emberMetalFeatures.default('ember-htmlbars-local-lookup')) {
+ source = options && options.source && this.normalize(options.source);
+ }
return has(this, this.normalize(fullName), source);
},
/**
@@ -2025,12 +2047,13 @@
@private
@method options
@param {String} fullName
@param {Object} options
*/
- options: function (fullName, _options) {
- var options = _options || {};
+ options: function (fullName) {
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+
var normalizedName = this.normalize(fullName);
this._options[normalizedName] = options;
},
getOptions: function (fullName) {
@@ -2348,10 +2371,44 @@
registry.resolver = {
resolve: registry.resolver
};
}
+ if (_emberMetalFeatures.default('ember-htmlbars-local-lookup')) {
+ /**
+ Given a fullName and a source fullName returns the fully resolved
+ fullName. Used to allow for local lookup.
+ ```javascript
+ var registry = new Registry();
+ // the twitter factory is added to the module system
+ registry.expandLocalLookup('component:post-title', { source: 'template:post' }) // => component:post/post-title
+ ```
+ @private
+ @method expandLocalLookup
+ @param {String} fullName
+ @param {Object} [options]
+ @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) {
+ _emberMetalDebug.assert('fullName must be a proper full name', this.validateFullName(fullName));
+ _emberMetalDebug.assert('options.source must be provided to expandLocalLookup', options && options.source);
+ _emberMetalDebug.assert('options.source must be a proper full name', this.validateFullName(options.source));
+
+ var normalizedFullName = this.normalize(fullName);
+ var normalizedSource = this.normalize(options.source);
+
+ return expandLocalLookup(this, normalizedFullName, normalizedSource);
+ } else if (this.fallback) {
+ return this.fallback.expandLocalLookup(fullName, options);
+ } else {
+ return null;
+ }
+ };
+ }
+
function expandLocalLookup(registry, normalizedName, normalizedSource) {
var cache = registry._localLookupCache;
var normalizedNameCache = cache[normalizedName];
if (!normalizedNameCache) {
@@ -2368,11 +2425,23 @@
return normalizedNameCache[normalizedSource] = expanded;
}
function resolve(registry, normalizedName, options) {
+ if (_emberMetalFeatures.default('ember-htmlbars-local-lookup')) {
+ if (options && options.source) {
+ // when `source` is provided expand normalizedName
+ // and source into the full normalizedName
+ normalizedName = registry.expandLocalLookup(normalizedName, options);
+ // if expandLocalLookup returns falsey, we do not support local lookup
+ if (!normalizedName) {
+ return;
+ }
+ }
+ }
+
var cached = registry._resolveCache[normalizedName];
if (cached !== undefined) {
return cached;
}
if (registry._failCache[normalizedName]) {
@@ -2402,31 +2471,10 @@
return registry.resolve(fullName, { source: source }) !== undefined;
}
exports.default = Registry;
});
-
-/**
- Given a fullName and a source fullName returns the fully resolved
- fullName. Used to allow for local lookup.
- ```javascript
- var registry = new Registry();
- // the twitter factory is added to the module system
- registry.expandLocalLookup('component:post-title', { source: 'template:post' }) // => component:post/post-title
- ```
- @private
- @method expandLocalLookup
- @param {String} fullName
- @param {Object} [options]
- @param {String} [options.source] the fullname of the request source (used for local lookups)
- @return {String} fullName
-*/
-
-// when `source` is provided expand normalizedName
-// and source into the full normalizedName
-
-// if expandLocalLookup returns falsey, we do not support local lookup
enifed('dag-map/platform', ['exports'], function (exports) {
'use strict';
var platform;
@@ -3693,21 +3741,27 @@
_emberMetalCore.default.Application = _emberApplicationSystemApplication.default;
_emberMetalCore.default.Resolver = _emberApplicationSystemResolver.Resolver;
_emberMetalCore.default.DefaultResolver = _emberApplicationSystemResolver.default;
+ if (_emberMetalFeatures.default('ember-application-engines')) {
+ _emberMetalCore.default.Engine = _emberApplicationSystemEngine.default;
+
+ // Expose `EngineInstance` and `ApplicationInstance` for easy overriding.
+ // Reanalyze whether to continue exposing these after feature flag is removed.
+ _emberMetalCore.default.EngineInstance = _emberApplicationSystemEngineInstance.default;
+ _emberMetalCore.default.ApplicationInstance = _emberApplicationSystemApplicationInstance.default;
+ }
+
_emberRuntimeSystemLazy_load.runLoadHooks('Ember.Application', _emberApplicationSystemApplication.default);
});
/**
@module ember
@submodule ember-application
*/
-
-// Expose `EngineInstance` and `ApplicationInstance` for easy overriding.
-// Reanalyze whether to continue exposing these after feature flag is removed.
-enifed('ember-application/system/application-instance', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/run_loop', 'ember-metal/computed', 'ember-htmlbars/system/dom-helper', 'ember-runtime/mixins/registry_proxy', 'ember-metal-views/renderer', 'ember-metal/assign', 'ember-metal/environment', 'ember-runtime/ext/rsvp', 'ember-views/system/jquery', 'ember-application/system/engine-instance'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalRun_loop, _emberMetalComputed, _emberHtmlbarsSystemDomHelper, _emberRuntimeMixinsRegistry_proxy, _emberMetalViewsRenderer, _emberMetalAssign, _emberMetalEnvironment, _emberRuntimeExtRsvp, _emberViewsSystemJquery, _emberApplicationSystemEngineInstance) {
+enifed('ember-application/system/application-instance', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/run_loop', 'ember-metal/computed', 'ember-htmlbars/system/dom-helper', 'ember-runtime/mixins/registry_proxy', 'ember-metal-views', 'ember-metal/assign', 'ember-metal/environment', 'ember-runtime/ext/rsvp', 'ember-views/system/jquery', 'ember-application/system/engine-instance'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalRun_loop, _emberMetalComputed, _emberHtmlbarsSystemDomHelper, _emberRuntimeMixinsRegistry_proxy, _emberMetalViews, _emberMetalAssign, _emberMetalEnvironment, _emberRuntimeExtRsvp, _emberViewsSystemJquery, _emberApplicationSystemEngineInstance) {
/**
@module ember
@submodule ember-application
*/
@@ -3835,11 +3889,11 @@
registry.injection('view', '_environment', '-environment:main');
registry.injection('route', '_environment', '-environment:main');
registry.register('renderer:-dom', {
create: function () {
- return new _emberMetalViewsRenderer.default(new _emberHtmlbarsSystemDomHelper.default(options.document), options.isInteractive);
+ return new _emberMetalViews.Renderer(new _emberHtmlbarsSystemDomHelper.default(options.document), { destinedForDOM: options.isInteractive });
}
});
if (options.rootElement) {
this.rootElement = options.rootElement;
@@ -4193,31 +4247,19 @@
}
});
exports.default = ApplicationInstance;
});
-enifed('ember-application/system/application', ['exports', 'ember-metal', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-runtime/system/lazy_load', 'ember-metal/run_loop', 'ember-runtime/controllers/controller', 'ember-metal-views/renderer', 'ember-htmlbars/system/dom-helper', 'ember-views/views/select', 'ember-routing-views/views/outlet', 'ember-views/views/view', 'ember-views/system/event_dispatcher', 'ember-views/system/jquery', 'ember-routing/system/route', 'ember-routing/system/router', 'ember-routing/location/hash_location', 'ember-routing/location/history_location', 'ember-routing/location/auto_location', 'ember-routing/location/none_location', 'ember-routing/system/cache', 'ember-application/system/application-instance', 'ember-views/views/text_field', 'ember-views/views/text_area', 'ember-views/views/checkbox', 'ember-views/views/legacy_each_view', 'ember-routing-views/components/link-to', 'ember-routing/services/routing', 'ember-extension-support/container_debug_adapter', 'ember-runtime/mixins/registry_proxy', 'ember-metal/environment', 'ember-runtime/ext/rsvp', 'ember-application/system/engine'], function (exports, _emberMetal, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberRuntimeSystemLazy_load, _emberMetalRun_loop, _emberRuntimeControllersController, _emberMetalViewsRenderer, _emberHtmlbarsSystemDomHelper, _emberViewsViewsSelect, _emberRoutingViewsViewsOutlet, _emberViewsViewsView, _emberViewsSystemEvent_dispatcher, _emberViewsSystemJquery, _emberRoutingSystemRoute, _emberRoutingSystemRouter, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingLocationNone_location, _emberRoutingSystemCache, _emberApplicationSystemApplicationInstance, _emberViewsViewsText_field, _emberViewsViewsText_area, _emberViewsViewsCheckbox, _emberViewsViewsLegacy_each_view, _emberRoutingViewsComponentsLinkTo, _emberRoutingServicesRouting, _emberExtensionSupportContainer_debug_adapter, _emberRuntimeMixinsRegistry_proxy, _emberMetalEnvironment, _emberRuntimeExtRsvp, _emberApplicationSystemEngine) {
+enifed('ember-application/system/application', ['exports', 'ember-metal', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-runtime/system/lazy_load', 'ember-metal/run_loop', 'ember-runtime/controllers/controller', 'ember-metal-views', 'ember-htmlbars/system/dom-helper', 'ember-views/views/select', 'ember-routing-views/views/outlet', 'ember-views/views/view', 'ember-views/system/event_dispatcher', 'ember-views/system/jquery', 'ember-routing/system/route', 'ember-routing/system/router', 'ember-routing/location/hash_location', 'ember-routing/location/history_location', 'ember-routing/location/auto_location', 'ember-routing/location/none_location', 'ember-routing/system/cache', 'ember-application/system/application-instance', 'ember-views/views/text_field', 'ember-views/views/text_area', 'ember-views/views/checkbox', 'ember-views/views/legacy_each_view', 'ember-routing-views/components/link-to', 'ember-routing/services/routing', 'ember-extension-support/container_debug_adapter', 'ember-runtime/mixins/registry_proxy', 'ember-metal/environment', 'ember-runtime/ext/rsvp', 'ember-application/system/engine'], function (exports, _emberMetal, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberRuntimeSystemLazy_load, _emberMetalRun_loop, _emberRuntimeControllersController, _emberMetalViews, _emberHtmlbarsSystemDomHelper, _emberViewsViewsSelect, _emberRoutingViewsViewsOutlet, _emberViewsViewsView, _emberViewsSystemEvent_dispatcher, _emberViewsSystemJquery, _emberRoutingSystemRoute, _emberRoutingSystemRouter, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingLocationNone_location, _emberRoutingSystemCache, _emberApplicationSystemApplicationInstance, _emberViewsViewsText_field, _emberViewsViewsText_area, _emberViewsViewsCheckbox, _emberViewsViewsLegacy_each_view, _emberRoutingViewsComponentsLinkTo, _emberRoutingServicesRouting, _emberExtensionSupportContainer_debug_adapter, _emberRuntimeMixinsRegistry_proxy, _emberMetalEnvironment, _emberRuntimeExtRsvp, _emberApplicationSystemEngine) {
/**
@module ember
@submodule ember-application
*/
'use strict';
- exports._resetLegacyAddonWarnings = _resetLegacyAddonWarnings;
-
var librariesRegistered = false;
- var warnedAboutLegacyViewAddon = false;
- var warnedAboutLegacyControllerAddon = false;
-
- // For testing
-
- function _resetLegacyAddonWarnings() {
- warnedAboutLegacyViewAddon = false;
- warnedAboutLegacyControllerAddon = false;
- }
-
/**
An instance of `Ember.Application` is the starting point for every Ember
application. It helps to instantiate, initialize and coordinate the many
objects that make up your app.
@@ -4718,22 +4760,10 @@
_bootSync: function () {
if (this._booted) {
return;
}
- if (_emberMetal.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT && !warnedAboutLegacyViewAddon) {
- _emberMetalDebug.deprecate('Support for the `ember-legacy-views` addon will end soon, please remove it from your application.', false, { id: 'ember-legacy-views', until: '2.6.0', url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-view' });
-
- warnedAboutLegacyViewAddon = true;
- }
-
- if (_emberMetal.default.ENV._ENABLE_LEGACY_CONTROLLER_SUPPORT && !warnedAboutLegacyControllerAddon) {
- _emberMetalDebug.deprecate('Support for the `ember-legacy-controllers` addon will end soon, please remove it from your application.', false, { id: 'ember-legacy-controllers', until: '2.6.0', url: 'http://emberjs.com/deprecations/v1.x/#toc_objectcontroller' });
-
- warnedAboutLegacyControllerAddon = true;
- }
-
// Even though this returns synchronously, we still need to make sure the
// boot promise exists for book-keeping purposes: if anything went wrong in
// the boot process, we need to store the error as a rejection on the boot
// promise so that a future caller of `boot()` can tell what failed.
var defer = this._bootResolver = new _emberRuntimeExtRsvp.default.defer();
@@ -5110,11 +5140,11 @@
registry.register('application:main', namespace, { instantiate: false });
registry.register('controller:basic', _emberRuntimeControllersController.default, { instantiate: false });
registry.register('renderer:-dom', { create: function () {
- return new _emberMetalViewsRenderer.default(new _emberHtmlbarsSystemDomHelper.default());
+ return new _emberMetalViews.Renderer(new _emberHtmlbarsSystemDomHelper.default());
} });
registry.injection('view', 'renderer', 'renderer:-dom');
if (_emberMetal.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT) {
registry.register('view:select', _emberViewsViewsSelect.default);
@@ -5226,11 +5256,10 @@
@public
@class Ember.EngineInstance
@extends Ember.Object
@uses RegistryProxyMixin
@uses ContainerProxyMixin
- @category ember-application-engines
*/
var EngineInstance = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsRegistry_proxy.default, _emberRuntimeMixinsContainer_proxy.default, {
/**
The base `Engine` for which this is an instance.
@@ -5313,11 +5342,10 @@
@class Engine
@namespace Ember
@extends Ember.Namespace
@uses RegistryProxy
- @category ember-application-engines
@public
*/
var Engine = _emberRuntimeSystemNamespace.default.extend(_emberRuntimeMixinsRegistry_proxy.default, {
init: function () {
this._super.apply(this, arguments);
@@ -6235,15 +6263,13 @@
@submodule ember-debug
*/
/**
Display a deprecation warning with the provided message and a stack trace
- (Chrome and Firefox only).
+ (Chrome and Firefox only). Ember build tools will remove any calls to
+ `Ember.deprecate()` when doing a production build.
- * In a production build, this method is defined as an empty function (NOP).
- Uses of this method in Ember itself are stripped from the ember.prod.js build.
-
@method deprecate
@param {String} message A description of the deprecation.
@param {Boolean} test A boolean. If falsy, the deprecation
will be displayed.
@param {Object} options An object that can be used to pass
@@ -6292,11 +6318,11 @@
var HANDLERS = {};
exports.HANDLERS = HANDLERS;
function generateTestAsFunctionDeprecation(source) {
- return 'Calling `' + source + '` with a function argument is deprecated. Please ' + 'use `!!Constructor` for constructors, or an `IIFE` to compute the test for deprecation. ' + 'In a future version functions will be treated as truthy values instead of being executed.';
+ return 'Calling `' + source + '` with a function argument is deprecated. Please ' + 'use `!!Constructor` for constructors, or an `IIFE` to compute the test for deprecation. ' + 'In a future version, functions will be treated as truthy values instead of being executed.';
}
function normalizeTest(test, source) {
if (_emberDebugIsPlainFunction.default(test)) {
_emberDebugDeprecate.default(generateTestAsFunctionDeprecation(source), false, { id: 'ember-debug.deprecate-test-as-function', until: '2.5.0' });
@@ -6345,15 +6371,14 @@
@class Ember
@public
*/
/**
- Define an assertion that will throw an exception if the condition is not met.
+ Define an assertion that will throw an exception if the condition is not
+ met. Ember build tools will remove any calls to `Ember.assert()` when
+ doing a production build. Example:
- * In a production build, this method is defined as an empty function (NOP).
- Uses of this method in Ember itself are stripped from the ember.prod.js build.
-
```javascript
// Test for truthiness
Ember.assert('Must pass a valid object', obj);
// Fail unconditionally
@@ -6382,15 +6407,13 @@
throw new _emberMetalError.default('Assertion Failed: ' + desc);
}
});
/**
- Display a debug notice.
+ Display a debug notice. Ember build tools will remove any calls to
+ `Ember.debug()` when doing a production build.
- * In a production build, this method is defined as an empty function (NOP).
- Uses of this method in Ember itself are stripped from the ember.prod.js build.
-
```javascript
Ember.debug('I\'m a debug notice!');
```
@method debug
@@ -6402,13 +6425,10 @@
});
/**
Display an info notice.
- * In a production build, this method is defined as an empty function (NOP).
- Uses of this method in Ember itself are stripped from the ember.prod.js build.
-
@method info
@private
*/
_emberMetalDebug.setDebugFunction('info', function info() {
_emberMetalLogger.default.info.apply(undefined, arguments);
@@ -6418,21 +6438,22 @@
Alias an old, deprecated method with its new counterpart.
Display a deprecation warning with the provided message and a stack trace
(Chrome and Firefox only) when the assigned method is called.
- * In a production build, this method is defined as an empty function (NOP).
+ Ember build tools will not remove calls to `Ember.deprecateFunc()`, though
+ no warnings will be shown in production.
```javascript
Ember.oldMethod = Ember.deprecateFunc('Please use the new, updated method', Ember.newMethod);
```
@method deprecateFunc
@param {String} message A description of the deprecation.
@param {Object} [options] The options object for Ember.deprecate.
@param {Function} func The new function called to replace its deprecated counterpart.
- @return {Function} a new function that wrapped the original function with a deprecation warning
+ @return {Function} A new function that wraps the original function with a deprecation warning
@private
*/
_emberMetalDebug.setDebugFunction('deprecateFunc', function deprecateFunc() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
@@ -6469,15 +6490,13 @@
if (typeof _ret2 === 'object') return _ret2.v;
}
});
/**
- Run a function meant for debugging.
+ Run a function meant for debugging. Ember build tools will remove any calls to
+ `Ember.runInDebug()` when doing a production build.
- * In a production build, this method is defined as an empty function (NOP).
- Uses of this method in Ember itself are stripped from the ember.prod.js build.
-
```javascript
Ember.runInDebug(() => {
Ember.Component.reopen({
didInsertElement() {
console.log("I'm happy");
@@ -6512,33 +6531,33 @@
@private
@method _warnIfUsingStrippedFeatureFlags
@return {void}
*/
- function _warnIfUsingStrippedFeatureFlags(FEATURES, knownFeatures, featuresWereStripped) {
+ function _warnIfUsingStrippedFeatureFlags(FEATURES, featuresWereStripped) {
if (featuresWereStripped) {
_emberMetalDebug.warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !_emberMetalCore.default.ENV.ENABLE_OPTIONAL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' });
- var keys = Object.keys(FEATURES || {});
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- if (key === 'isEnabled' || !(key in knownFeatures)) {
- continue;
+ for (var key in FEATURES) {
+ if (FEATURES.hasOwnProperty(key) && key !== 'isEnabled') {
+ _emberMetalDebug.warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' });
}
-
- _emberMetalDebug.warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' });
}
}
}
if (!_emberMetalCore.default.testing) {
// Complain if they're using FEATURE flags in builds other than canary
_emberMetalFeatures.FEATURES['features-stripped-test'] = true;
var featuresWereStripped = true;
+ if (_emberMetalFeatures.default('features-stripped-test')) {
+ exports.featuresWereStripped = featuresWereStripped = false;
+ }
+
delete _emberMetalFeatures.FEATURES['features-stripped-test'];
- _warnIfUsingStrippedFeatureFlags(_emberMetalCore.default.ENV.FEATURES, _emberMetalFeatures.KNOWN_FEATURES, featuresWereStripped);
+ _warnIfUsingStrippedFeatureFlags(_emberMetalCore.default.ENV.FEATURES, featuresWereStripped);
// Inform the developer about the Ember Inspector if not installed.
var isFirefox = _emberMetalEnvironment.default.isFirefox;
var isChrome = _emberMetalEnvironment.default.isChrome;
@@ -6579,22 +6598,22 @@
}
}
```
The handler function takes the following arguments:
<ul>
- <li> <code>message</code> - The message received from the deprecation call. </li>
+ <li> <code>message</code> - The message received from the deprecation call.</li>
<li> <code>options</code> - An object passed in with the deprecation call containing additional information including:</li>
<ul>
- <li> <code>id</code> - an id of the deprecation in the form of <code>package-name.specific-deprecation</code>.</li>
- <li> <code>until</code> - is the version number Ember the feature and deprecation will be removed in.</li>
+ <li> <code>id</code> - An id of the deprecation in the form of <code>package-name.specific-deprecation</code>.</li>
+ <li> <code>until</code> - The Ember version number the feature and deprecation will be removed in.</li>
</ul>
- <li> <code>next</code> - a function that calls into the previously registered handler.</li>
+ <li> <code>next</code> - A function that calls into the previously registered handler.</li>
</ul>
@public
@static
@method registerDeprecationHandler
- @param handler {Function} a function to handle deprecation calls
+ @param handler {Function} A function to handle deprecation calls.
@since 2.1.0
*/
_emberMetalCore.default.Debug.registerDeprecationHandler = _emberDebugDeprecate.registerHandler;
/**
Allows for runtime registration of handler functions that override the default warning behavior.
@@ -6608,18 +6627,18 @@
The handler function takes the following arguments:
<ul>
<li> <code>message</code> - The message received from the warn call. </li>
<li> <code>options</code> - An object passed in with the warn call containing additional information including:</li>
<ul>
- <li> <code>id</code> - an id of the warning in the form of <code>package-name.specific-warning</code>.</li>
+ <li> <code>id</code> - An id of the warning in the form of <code>package-name.specific-warning</code>.</li>
</ul>
- <li> <code>next</code> - a function that calls into the previously registered handler.</li>
+ <li> <code>next</code> - A function that calls into the previously registered handler.</li>
</ul>
@public
@static
@method registerWarnHandler
- @param handler {Function} a function to handle warnings
+ @param handler {Function} A function to handle warnings.
@since 2.1.0
*/
_emberMetalCore.default.Debug.registerWarnHandler = _emberDebugWarn.registerHandler;
/*
@@ -6672,20 +6691,18 @@
@module ember
@submodule ember-debug
*/
/**
- Display a warning with the provided message.
+ Display a warning with the provided message. Ember build tools will
+ remove any calls to `Ember.warn()` when doing a production build.
- * In a production build, this method is defined as an empty function (NOP).
- Uses of this method in Ember itself are stripped from the ember.prod.js build.
-
@method warn
@param {String} message A warning to display.
@param {Boolean} test An optional boolean. If falsy, the warning
will be displayed.
- @param {Object} options An ojbect that can be used to pass a unique
+ @param {Object} options An object that can be used to pass a unique
`id` for this warning. The `id` can be used by Ember debugging tools
to change the behavior (raise, log, or silence) for that specific warning.
The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped"
@for Ember
@public
@@ -6732,11 +6749,11 @@
* `canCatalogEntriesByType`
* `catalogEntriesByType`
The adapter will need to be registered
- in the application's container as `container-debug-adapter:main`
+ in the application's container as `container-debug-adapter:main`.
Example:
```javascript
Application.initializer({
@@ -6767,11 +6784,11 @@
/**
Returns true if it is possible to catalog a list of available
classes in the resolver for a given type.
@method canCatalogEntriesByType
- @param {String} type The type. e.g. "model", "controller", "route"
+ @param {String} type The type. e.g. "model", "controller", "route".
@return {boolean} whether a list is available for this type.
@public
*/
canCatalogEntriesByType: function (type) {
if (type === 'model' || type === 'template') {
@@ -6782,11 +6799,11 @@
},
/**
Returns the available classes a given type.
@method catalogEntriesByType
- @param {String} type The type. e.g. "model", "controller", "route"
+ @param {String} type The type. e.g. "model", "controller", "route".
@return {Array} An array of strings.
@public
*/
catalogEntriesByType: function (type) {
var namespaces = _emberRuntimeSystemNative_array.A(_emberRuntimeSystemNamespace.default.NAMESPACES);
@@ -6841,11 +6858,11 @@
* `getRecordFilterValues`
* `getRecordColor`
* `observeRecord`
The adapter will need to be registered
- in the application's container as `dataAdapter:main`
+ in the application's container as `dataAdapter:main`.
Example:
```javascript
Application.initializer({
@@ -6877,11 +6894,11 @@
@public
**/
containerDebugAdapter: undefined,
/**
- Number of attributes to send
+ The number of attributes to send
as columns. (Enough to make the record
identifiable).
@private
@property attributeLimit
@default 3
@@ -6968,23 +6985,23 @@
/**
Fetch the records of a given type and observe them for changes.
@public
@method watchRecords
- @param {String} modelName The model name
+ @param {String} modelName The model name.
@param {Function} recordsAdded Callback to call to add records.
Takes an array of objects containing wrapped records.
The object should have the following properties:
- columnValues: {Object} key and value of a table cell
- object: {Object} the actual record object
+ columnValues: {Object} The key and value of a table cell.
+ object: {Object} The actual record object.
@param {Function} recordsUpdated Callback to call when a record has changed.
Takes an array of objects containing wrapped records.
@param {Function} recordsRemoved Callback to call when a record has removed.
Takes the following parameters:
- index: the array index where the records were removed
- count: the number of records removed
- @return {Function} Method to call to remove all observers
+ index: The array index where the records were removed.
+ count: The number of records removed.
+ @return {Function} Method to call to remove all observers.
*/
watchRecords: function (modelName, recordsAdded, recordsUpdated, recordsRemoved) {
var _this2 = this;
var releaseMethods = _emberRuntimeSystemNative_array.A();
@@ -7046,40 +7063,40 @@
},
/**
Detect whether a class is a model.
Test that against the model class
- of your persistence library
+ of your persistence library.
@private
@method detect
- @param {Class} klass The class to test
- @return boolean Whether the class is a model class or not
+ @param {Class} klass The class to test.
+ @return boolean Whether the class is a model class or not.
*/
detect: function (klass) {
return false;
},
/**
Get the columns for a given model type.
@private
@method columnsForType
- @param {Class} type The model type
+ @param {Class} type The model type.
@return {Array} An array of columns of the following format:
- name: {String} name of the column
- desc: {String} Humanized description (what would show in a table column name)
+ name: {String} The name of the column.
+ desc: {String} Humanized description (what would show in a table column name).
*/
columnsForType: function (type) {
return _emberRuntimeSystemNative_array.A();
},
/**
Adds observers to a model type class.
@private
@method observeModelType
- @param {String} modelName The model type name
+ @param {String} modelName The model type name.
@param {Function} typesUpdated Called when a type is modified.
- @return {Function} The function to call to remove observers
+ @return {Function} The function to call to remove observers.
*/
observeModelType: function (modelName, typesUpdated) {
var _this3 = this;
@@ -7109,21 +7126,21 @@
/**
Wraps a given model type and observes changes to it.
@private
@method wrapModelType
- @param {Class} klass A model class
- @param {String} modelName Name of the class
- @return {Object} contains the wrapped type and the function to remove observers
+ @param {Class} klass A model class.
+ @param {String} modelName Name of the class.
+ @return {Object} Contains the wrapped type and the function to remove observers
Format:
- type: {Object} the wrapped type
+ type: {Object} The wrapped type.
The wrapped type has the following format:
- name: {String} name of the type
- count: {Integer} number of records available
- columns: {Columns} array of columns to describe the record
- object: {Class} the actual Model type class
- release: {Function} The function to remove observers
+ name: {String} The name of the type.
+ count: {Integer} The number of records available.
+ columns: {Columns} An array of columns to describe the record.
+ object: {Class} The actual Model type class.
+ release: {Function} The function to remove observers.
*/
wrapModelType: function (klass, name) {
var records = this.getRecords(klass, name);
var typeToSend;
@@ -7139,11 +7156,11 @@
/**
Fetches all models defined in the application.
@private
@method getModelTypes
- @return {Array} Array of model types
+ @return {Array} Array of model types.
*/
getModelTypes: function () {
var _this4 = this;
var containerDebugAdapter = this.get('containerDebugAdapter');
@@ -7153,11 +7170,11 @@
types = containerDebugAdapter.catalogEntriesByType('model');
} else {
types = this._getObjectsOnNamespaces();
}
- // New adapters return strings instead of classes
+ // New adapters return strings instead of classes.
types = _emberRuntimeSystemNative_array.A(types).map(function (name) {
return {
klass: _this4._nameToClass(name),
name: name
};
@@ -7169,14 +7186,14 @@
return _emberRuntimeSystemNative_array.A(types);
},
/**
Loops over all namespaces and all objects
- attached to them
+ attached to them.
@private
@method _getObjectsOnNamespaces
- @return {Array} Array of model type strings
+ @return {Array} Array of model type strings.
*/
_getObjectsOnNamespaces: function () {
var _this5 = this;
var namespaces = _emberRuntimeSystemNative_array.A(_emberRuntimeSystemNamespace.default.NAMESPACES);
@@ -7258,35 +7275,35 @@
/**
Returns the values of filters defined by `getFilters`.
@private
@method getRecordFilterValues
- @param {Object} record The record instance
- @return {Object} The filter values
+ @param {Object} record The record instance.
+ @return {Object} The filter values.
*/
getRecordFilterValues: function (record) {
return {};
},
/**
Each record can have a color that represents its state.
@private
@method getRecordColor
@param {Object} record The record instance
- @return {String} The record's color
- Possible options: black, red, blue, green
+ @return {String} The records color.
+ Possible options: black, red, blue, green.
*/
getRecordColor: function (record) {
return null;
},
/**
Observes all relevant properties and re-sends the wrapped record
when a change occurs.
@private
@method observerRecord
- @param {Object} record The record instance
+ @param {Object} record The record instance.
@param {Function} recordUpdated The callback to call when a record is updated.
@return {Function} The function to call to remove all observers.
*/
observeRecord: function (record, recordUpdated) {
return function () {};
@@ -7413,11 +7430,11 @@
```handlebars
<div>{{format-currency cents currency="$"}}</div>
```
- Additionally a helper can be called as a nested helper (sometimes called a
+ Additionally, a helper can be called as a nested helper (sometimes called a
subexpression). In this example, the computed value of a helper is passed
to a component named `show-money`:
```handlebars
{{show-money amount=(format-currency cents currency="$")}}
@@ -7436,11 +7453,11 @@
```
Each time the input to a helper changes, the `compute` function will be
called again.
- As instances, these helpers also have access to the container and will accept
+ As instances, these helpers also have access to the container an will accept
injected dependencies.
Additionally, class helpers can call `recompute` to force a new computation.
@class Ember.Helper
@@ -7517,40 +7534,10 @@
};
}
exports.default = Helper;
});
-enifed('ember-htmlbars/helpers/-concat', ['exports'], function (exports) {
- /**
- @module ember
- @submodule ember-templates
- */
-
- /**
- Concatenates input params together.
-
- Example:
-
- ```handlebars
- {{some-component name=(concat firstName " " lastName)}}
-
- {{! would pass name="<first name value> <last name value>" to the component}}
- ```
-
- @public
- @method concat
- @for Ember.Templates.helpers
- @since 1.13.0
- */
- 'use strict';
-
- exports.default = concat;
-
- function concat(params) {
- return params.join('');
- }
-});
enifed('ember-htmlbars/helpers/-html-safe', ['exports', 'htmlbars-util/safe-string'], function (exports, _htmlbarsUtilSafeString) {
'use strict';
exports.default = htmlSafeHelper;
@@ -7567,11 +7554,11 @@
return new _htmlbarsUtilSafeString.default(value);
}
});
enifed('ember-htmlbars/helpers/-join-classes', ['exports'], function (exports) {
/*
- this private helper is used to join and compact a list of class names
+ This private helper is used to join and compact a list of class names.
@private
*/
'use strict';
@@ -7599,11 +7586,11 @@
function legacyEachWithControllerHelper(params, hash, blocks) {
var list = params[0];
var keyPath = hash.key;
- // TODO: Correct falsy semantics
+ // TODO: Correct falsy semantics.
if (!list || _emberMetalProperty_get.get(list, 'length') === 0) {
if (blocks.inverse.yield) {
blocks.inverse.yield();
}
return;
@@ -7690,22 +7677,22 @@
var value = params[1];
var activeClass = hash.activeClass;
var inactiveClass = hash.inactiveClass;
// When using the colon syntax, evaluate the truthiness or falsiness
- // of the value to determine which className to return
+ // of the value to determine which className to return.
if (activeClass || inactiveClass) {
if (!!value) {
return activeClass;
} else {
return inactiveClass;
}
// If value is a Boolean and true, return the dasherized property
// name.
} else if (value === true) {
- // Only apply to last segment in the path
+ // Only apply to last segment in the path.
if (propName && _emberMetalPath_cache.isPath(propName)) {
var segments = propName.split('.');
propName = segments[segments.length - 1];
}
@@ -7721,10 +7708,40 @@
} else {
return null;
}
}
});
+enifed('ember-htmlbars/helpers/concat', ['exports'], function (exports) {
+ /**
+ @module ember
+ @submodule ember-templates
+ */
+
+ /**
+ Concatenates the given arguments into a string.
+
+ Example:
+
+ ```handlebars
+ {{some-component name=(concat firstName " " lastName)}}
+
+ {{! would pass name="<first name value> <last name value>" to the component}}
+ ```
+
+ @public
+ @method concat
+ @for Ember.Templates.helpers
+ @since 1.13.0
+ */
+ 'use strict';
+
+ exports.default = concat;
+
+ function concat(args) {
+ return args.join('');
+ }
+});
enifed('ember-htmlbars/helpers/each-in', ['exports', 'ember-views/streams/should_display'], function (exports, _emberViewsStreamsShould_display) {
/**
@module ember
@submodule ember-templates
*/
@@ -7950,11 +7967,11 @@
You can also specify a template to show if the property is falsey by using
the `else` helper.
```handlebars
- {{! is it raining outside?}}
+ {{!Is it raining outside?}}
{{#if isRaining}}
Yes, grab an umbrella!
{{else}}
No, it's lovely outside!
{{/if}}
@@ -8068,11 +8085,11 @@
See [Ember.String.loc](/api/classes/Ember.String.html#method_loc) for how to
set up localized string references.
@method loc
@for Ember.Templates.helpers
- @param {String} str The string to format
+ @param {String} str The string to format.
@see {Ember.String#loc}
@public
*/
function locHelper(params) {
@@ -8182,11 +8199,11 @@
/**
@private
@method _registerHelper
@for Ember.HTMLBars
@param {String} name
- @param {Object|Function} helperFunc the helper function to add
+ @param {Object|Function} helperFunc The helper function to add.
*/
function registerHelper(name, helperFunc) {
helpers[name] = helperFunc;
}
@@ -8414,11 +8431,11 @@
params = [];
attrs = _emberHtmlbarsKeywordsClosureComponent.mergeInNewHash(componentCell[_emberHtmlbarsKeywordsClosureComponent.COMPONENT_HASH], newAttrs);
}
}
- // Determine if this is an initial render or a re-render
+ // Determine if this is an initial render or a re-render.
if (state.manager) {
state.manager.rerender(env, attrs, visitor);
return;
}
@@ -8453,24 +8470,31 @@
var currentComponent = env.view;
var isInvokedWithAngles = currentComponent && currentComponent._isAngleBracket;
var isInvokedWithCurlies = currentComponent && !currentComponent._isAngleBracket;
- // <div> at the top level of a <foo-bar> invocation
+ // <div> at the top level of a <foo-bar> invocation.
var isComponentHTMLElement = isAngleBracket && !isDasherized && isInvokedWithAngles;
- // <foo-bar> at the top level of a <foo-bar> invocation
+ // <foo-bar> at the top level of a <foo-bar> invocation.
var isComponentIdentityElement = isAngleBracket && isTopLevel && tagName === env.view.tagName;
- // <div> at the top level of a {{foo-bar}} invocation
+ // <div> at the top level of a {{foo-bar}} invocation.
var isNormalHTMLElement = isAngleBracket && !isDasherized && isInvokedWithCurlies;
var component = undefined,
layout = undefined;
if (isDasherized || !isAngleBracket) {
var options = {};
+ if (_emberMetalFeatures.default('ember-htmlbars-local-lookup')) {
+ var moduleName = env.meta && env.meta.moduleName;
+ if (moduleName) {
+ options.source = 'template:' + moduleName;
+ }
+ }
+
var result = _emberHtmlbarsUtilsLookupComponent.default(env.owner, tagName, options);
component = result.component;
layout = result.layout;
@@ -8851,15 +8875,15 @@
exports.default = getCellOrValue;
function getCellOrValue(ref) {
if (ref && ref[_emberHtmlbarsKeywordsMut.MUTABLE_REFERENCE]) {
- // reify the mutable reference into a mutable cell
+ // Reify the mutable reference into a mutable cell.
return ref.cell();
}
- // get the value out of the reference
+ // Get the value out of the reference.
return _emberMetalStreamsUtils.read(ref);
}
});
enifed('ember-htmlbars/hooks/get-child', ['exports', 'ember-metal/streams/utils'], function (exports, _emberMetalStreamsUtils) {
/**
@@ -8874,11 +8898,11 @@
function getChild(parent, key) {
if (_emberMetalStreamsUtils.isStream(parent)) {
return parent.getKey(key);
}
- // This should only happen when we are looking at an `attrs` hash
+ // This should only happen when we are looking at an `attrs` hash.
// That might change if it is possible to pass object literals
// through the templating system.
return parent[key];
}
});
@@ -8986,14 +9010,14 @@
exports.default = invokeHelper;
function invokeHelper(morph, env, scope, visitor, params, hash, helper, templates, context) {
var helperStream = _emberHtmlbarsSystemInvokeHelper.buildHelperStream(helper, params, hash, templates, env, scope);
- // Ember.Helper helpers are pure values, thus linkable
+ // Ember.Helper helpers are pure values, thus linkable.
if (helperStream.linkable) {
if (morph) {
- // When processing an inline expression the params and hash have already
+ // When processing an inline expression, the params and hash have already
// been linked. Thus, HTMLBars will not link the returned helperStream.
// We subscribe the morph to the helperStream here, and also subscribe
// the helperStream to any params.
var addedDependency = false;
for (var i = 0, l = params.length; i < l; i++) {
@@ -9010,11 +9034,11 @@
}
return { link: true, value: helperStream };
}
- // Built-in helpers are not linkable, they must run every rerender
+ // Built-in helpers are not linkable. They must run on every rerender.
return { value: helperStream.value() };
}
});
enifed('ember-htmlbars/hooks/link-render-node', ['exports', 'ember-htmlbars/utils/subscribe', 'ember-runtime/utils', 'ember-metal/streams/utils', 'ember-htmlbars/system/lookup-helper', 'ember-htmlbars/keywords/closure-component'], function (exports, _emberHtmlbarsUtilsSubscribe, _emberRuntimeUtils, _emberMetalStreamsUtils, _emberHtmlbarsSystemLookupHelper, _emberHtmlbarsKeywordsClosureComponent) {
/**
@@ -9046,11 +9070,11 @@
case 'with':
params[0] = shouldDisplay(params[0], identity);break;
}
}
- // If has a dot in the path, we need to subscribe to the arguments in the
+ // If there is a dot in the path, we need to subscribe to the arguments in the
// closure component as well.
if (_emberHtmlbarsSystemLookupHelper.CONTAINS_DOT_CACHE.get(path)) {
var stream = env.hooks.get(env, scope, path);
var componentCell = stream.value();
@@ -9074,11 +9098,11 @@
for (var key in hash) {
_emberHtmlbarsUtilsSubscribe.default(renderNode, env, scope, hash[key]);
}
}
- // The params and hash can be reused; they don't need to be
+ // The params and hash can be reused. They don't need to be
// recomputed on subsequent re-renders because they are
// streams.
return true;
}
@@ -9102,15 +9126,15 @@
var predicateVal = _emberMetalStreamsUtils.read(predicate);
var lengthVal = _emberMetalStreamsUtils.read(length);
var isTruthyVal = _emberMetalStreamsUtils.read(isTruthy);
if (_emberRuntimeUtils.isArray(predicateVal)) {
- return lengthVal > 0 ? coercer(predicateVal) : false;
+ return lengthVal > 0 ? predicateVal : false;
}
if (typeof isTruthyVal === 'boolean') {
- return isTruthyVal ? coercer(predicateVal) : false;
+ return isTruthyVal;
}
return coercer(predicateVal);
}, 'ShouldDisplay');
@@ -9250,11 +9274,11 @@
function willCleanupTree(env) {
var view = env.view;
// When we go to clean up the render node and all of its children, we may
// encounter views/components associated with those nodes along the way. In
- // those cases, we need to make sure we need to sever the link between the
+ // those cases, we need to sever the link between the
// existing view hierarchy and those views.
//
// However, we do *not* need to remove the child views of child views, since
// severing the connection to their parent effectively severs them from the
// view graph.
@@ -9278,11 +9302,11 @@
// untouched. This view is then cleared once cleanup is complete in
// `didCleanupTree`.
view.ownerView._destroyingSubtreeForView = view;
}
});
-enifed('ember-htmlbars/index', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-template-compiler', 'ember-htmlbars/system/make_bound_helper', 'ember-htmlbars/helpers', 'ember-htmlbars/helpers/if_unless', 'ember-htmlbars/helpers/with', 'ember-htmlbars/helpers/loc', 'ember-htmlbars/helpers/log', 'ember-htmlbars/helpers/each', 'ember-htmlbars/helpers/each-in', 'ember-htmlbars/helpers/-normalize-class', 'ember-htmlbars/helpers/-concat', 'ember-htmlbars/helpers/-join-classes', 'ember-htmlbars/helpers/-legacy-each-with-controller', 'ember-htmlbars/helpers/-legacy-each-with-keyword', 'ember-htmlbars/helpers/-html-safe', 'ember-htmlbars/helpers/hash', 'ember-htmlbars/system/dom-helper', 'ember-htmlbars/helper', 'ember-htmlbars/glimmer-component', 'ember-htmlbars/template_registry', 'ember-htmlbars/system/bootstrap', 'ember-htmlbars/compat'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberTemplateCompiler, _emberHtmlbarsSystemMake_bound_helper, _emberHtmlbarsHelpers, _emberHtmlbarsHelpersIf_unless, _emberHtmlbarsHelpersWith, _emberHtmlbarsHelpersLoc, _emberHtmlbarsHelpersLog, _emberHtmlbarsHelpersEach, _emberHtmlbarsHelpersEachIn, _emberHtmlbarsHelpersNormalizeClass, _emberHtmlbarsHelpersConcat, _emberHtmlbarsHelpersJoinClasses, _emberHtmlbarsHelpersLegacyEachWithController, _emberHtmlbarsHelpersLegacyEachWithKeyword, _emberHtmlbarsHelpersHtmlSafe, _emberHtmlbarsHelpersHash, _emberHtmlbarsSystemDomHelper, _emberHtmlbarsHelper, _emberHtmlbarsGlimmerComponent, _emberHtmlbarsTemplate_registry, _emberHtmlbarsSystemBootstrap, _emberHtmlbarsCompat) {
+enifed('ember-htmlbars/index', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-template-compiler', 'ember-htmlbars/system/make_bound_helper', 'ember-htmlbars/helpers', 'ember-htmlbars/helpers/if_unless', 'ember-htmlbars/helpers/with', 'ember-htmlbars/helpers/loc', 'ember-htmlbars/helpers/log', 'ember-htmlbars/helpers/each', 'ember-htmlbars/helpers/each-in', 'ember-htmlbars/helpers/-normalize-class', 'ember-htmlbars/helpers/concat', 'ember-htmlbars/helpers/-join-classes', 'ember-htmlbars/helpers/-legacy-each-with-controller', 'ember-htmlbars/helpers/-legacy-each-with-keyword', 'ember-htmlbars/helpers/-html-safe', 'ember-htmlbars/helpers/hash', 'ember-htmlbars/system/dom-helper', 'ember-htmlbars/helper', 'ember-htmlbars/template_registry', 'ember-htmlbars/system/bootstrap', 'ember-htmlbars/compat'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberTemplateCompiler, _emberHtmlbarsSystemMake_bound_helper, _emberHtmlbarsHelpers, _emberHtmlbarsHelpersIf_unless, _emberHtmlbarsHelpersWith, _emberHtmlbarsHelpersLoc, _emberHtmlbarsHelpersLog, _emberHtmlbarsHelpersEach, _emberHtmlbarsHelpersEachIn, _emberHtmlbarsHelpersNormalizeClass, _emberHtmlbarsHelpersConcat, _emberHtmlbarsHelpersJoinClasses, _emberHtmlbarsHelpersLegacyEachWithController, _emberHtmlbarsHelpersLegacyEachWithKeyword, _emberHtmlbarsHelpersHtmlSafe, _emberHtmlbarsHelpersHash, _emberHtmlbarsSystemDomHelper, _emberHtmlbarsHelper, _emberHtmlbarsTemplate_registry, _emberHtmlbarsSystemBootstrap, _emberHtmlbarsCompat) {
/**
Ember templates are executed by [HTMLBars](https://github.com/tildeio/htmlbars),
an HTML-friendly version of [Handlebars](http://handlebarsjs.com/). Any valid Handlebars syntax is valid in an Ember template.
### Showing a property
@@ -9425,15 +9449,15 @@
get: _emberHtmlbarsTemplate_registry.getTemplates,
set: _emberHtmlbarsTemplate_registry.setTemplates
});
});
-// importing adds template bootstrapping
-// initializer to enable embedded templates
+// Importing adds template bootstrapping
+// initializer to enable embedded templates.
-// importing ember-htmlbars/compat updates the
-// Ember.Handlebars global if htmlbars is enabled
+// Importing ember-htmlbars/compat updates the
+// Ember.Handlebars global if htmlbars is enabled.
enifed('ember-htmlbars/keywords/closure-component', ['exports', 'ember-metal/debug', 'ember-metal/is_none', 'ember-metal/symbol', 'ember-metal/streams/stream', 'ember-metal/empty_object', 'ember-metal/streams/utils', 'ember-htmlbars/hooks/subexpr', 'ember-metal/assign', 'ember-htmlbars/utils/extract-positional-params', 'ember-htmlbars/utils/lookup-component'], function (exports, _emberMetalDebug, _emberMetalIs_none, _emberMetalSymbol, _emberMetalStreamsStream, _emberMetalEmpty_object, _emberMetalStreamsUtils, _emberHtmlbarsHooksSubexpr, _emberMetalAssign, _emberHtmlbarsUtilsExtractPositionalParams, _emberHtmlbarsUtilsLookupComponent) {
/**
@module ember
@submodule ember-templates
*/
@@ -9477,13 +9501,13 @@
var s = new ClosureComponentStream(env, path, params, hash);
s.addDependency(path);
// FIXME: If the stream invalidates on every params or hash change, then
- // the {{component helper will be forces to rerender the whole component
+ // the {{component helper will be forced to re-render the whole component
// each time. Instead, these dependencies should not be required and the
- // element component keyword should add the params and hash as dependencies
+ // element component keyword should add the params and hash as dependencies.
params.forEach(function (item) {
return s.addDependency(item);
});
Object.keys(hash).forEach(function (key) {
return s.addDependency(hash[key]);
@@ -9518,11 +9542,11 @@
}
function createNestedClosureComponentCell(componentCell, params, hash) {
var _ref;
- // This needs to be done in each nesting level to avoid raising assertions
+ // This needs to be done in each nesting level to avoid raising assertions.
processPositionalParamsFromCell(componentCell, params, hash);
return _ref = {}, _ref[COMPONENT_PATH] = componentCell[COMPONENT_PATH], _ref[COMPONENT_HASH] = mergeInNewHash(componentCell[COMPONENT_HASH], hash), _ref[COMPONENT_POSITIONAL_PARAMS] = componentCell[COMPONENT_POSITIONAL_PARAMS], _ref[COMPONENT_CELL] = true, _ref;
}
@@ -9535,11 +9559,11 @@
function createNewClosureComponentCell(env, componentPath, params, hash) {
var _ref2;
var positionalParams = getPositionalParams(env.owner, componentPath);
- // This needs to be done in each nesting level to avoid raising assertions
+ // This needs to be done in each nesting level to avoid raising assertions.
_emberHtmlbarsUtilsExtractPositionalParams.processPositionalParams(null, positionalParams, params, hash);
return _ref2 = {}, _ref2[COMPONENT_PATH] = componentPath, _ref2[COMPONENT_HASH] = hash, _ref2[COMPONENT_POSITIONAL_PARAMS] = positionalParams, _ref2[COMPONENT_CELL] = true, _ref2;
}
@@ -9598,11 +9622,11 @@
And the following application code
```javascript
App = Ember.Application.create();
App.ApplicationRoute = Ember.Route.extend({
- model: function() {
+ model() {
return [{name: 'Yehuda'},{name: 'Tom'},{name: 'Peter'}];
}
});
```
@@ -9616,12 +9640,12 @@
</div>
```
### Non-block version of collection
- If you provide an `itemViewClass` option that has its own `template` you may
- omit the block.
+ If you provide an `itemViewClass` option that has its own `template`,
+ then you may omit the block.
The following template:
```handlebars
{{! application.hbs }}
@@ -9631,11 +9655,11 @@
And application code
```javascript
App = Ember.Application.create();
App.ApplicationRoute = Ember.Route.extend({
- model: function() {
+ model() {
return [{name: 'Yehuda'},{name: 'Tom'},{name: 'Peter'}];
}
});
App.AnItemView = Ember.View.extend({
@@ -10042,11 +10066,11 @@
return '(get ' + sourceLabel + ' ' + keyLabel + ')';
}
var DynamicKeyStream = _emberMetalStreamsStream.default.extend({
init: function (source, keySource) {
- // used to get the original path for debugging purposes
+ // Used to get the original path for debugging purposes.
var label = labelFor(source, keySource);
this.label = label;
this.path = label;
this.sourceDep = this.addMutableDependency(source);
@@ -10377,11 +10401,11 @@
function legacyYield(morph, env, _scope, params, hash, template, inverse, visitor) {
var scope = _scope;
var block = scope.getBlock('default');
if (block.arity === 0) {
- // Typically, the `controller` local is persists through lexical scope.
+ // Typically, the `controller` local persists through lexical scope.
// However, in this case, the `{{legacy-yield}}` in the legacy each view
// needs to override the controller local for the template it is yielding.
// This megahaxx allows us to override the controller, and most importantly,
// prevents the downstream scope from attempting to bind the `controller` local.
if (hash.controller) {
@@ -10450,44 +10474,24 @@
critical to understanding the logic of a large/complex `Component`.
To specify that a parameter is mutable, when invoking the child `Component`:
```handlebars
- {{my-child childClickCount=(mut totalClicks)}}
+ <my-child child-click-count={{mut totalClicks}} />
```
The child `Component` can then modify the parent's value as needed:
```javascript
// my-child.js
export default Component.extend({
click() {
- this.get('childClickCount').update(this.get('childClickCount').value + 1);
+ this.attrs.childClickCount.update(this.attrs.childClickCount.value + 1);
}
});
```
- 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"))}}
- ```
-
- The child `Component` would invoke the action with the new click value:
-
- ```javascript
- // my-child.js
- export default Component.extend({
- click() {
- this.get('clickCountChange')(this.get('childClickCount') + 1);
- }
- });
- ```
-
- The `mut` helper changes the `totalClicks` value to what was provided as the action argument.
-
See a [2.0 blog post](http://emberjs.com/blog/2015/05/10/run-up-to-two-oh.html#toc_the-code-mut-code-helper) for
additional information on using `{{mut}}`.
@public
@method mut
@@ -10555,14 +10559,14 @@
@submodule ember-templates
*/
'use strict';
- _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.4.6';
+ _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.5.0-beta.1';
/**
- The `{{outlet}}` helper lets you specify where a child routes will render in
+ 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:
```handlebars
{{! app/templates/application.hbs }}
@@ -10668,10 +10672,14 @@
ViewClass = env.owner._lookupFactory('view:toplevel');
}
var Component;
+ if (_emberMetalFeatures.default('ember-routing-routable-components')) {
+ Component = outletState.render.Component;
+ }
+
var options;
var attrs = {};
if (Component) {
options = {
component: Component
@@ -10718,11 +10726,11 @@
}
a = a.render;
b = b.render;
for (var key in a) {
if (a.hasOwnProperty(key)) {
- // name is only here for logging & debugging. If two different
+ // Name is only here for logging & debugging. If two different
// names result in otherwise identical states, they're still
// identical.
if (a[key] !== b[key] && key !== 'name') {
return false;
}
@@ -10774,11 +10782,11 @@
name.
@method partial
@for Ember.Templates.helpers
- @param {String} partialName the name of the template to render minus the leading underscore
+ @param {String} partialName The name of the template to render minus the leading underscore.
@public
*/
exports.default = {
setupState: function (state, env, scope, params, hash) {
@@ -11455,11 +11463,11 @@
/**
@private
@method _registerHelper
@for Ember.HTMLBars
@param {String} name
- @param {Object|Function} keyword the keyword to add
+ @param {Object|Function} keyword The keyword to add.
*/
function registerKeyword(name, keyword) {
keywords[name] = keyword;
}
@@ -11596,20 +11604,19 @@
ComponentNodeManager.create = function ComponentNodeManager_create(renderNode, env, options) {
var _createOptions;
var tagName = options.tagName;
var params = options.params;
- var attrs = options.attrs;
+ var _options$attrs = options.attrs;
+ var attrs = _options$attrs === undefined ? {} : _options$attrs;
var parentView = options.parentView;
var parentScope = options.parentScope;
var isAngleBracket = options.isAngleBracket;
var component = options.component;
var layout = options.layout;
var templates = options.templates;
- attrs = attrs || {};
-
component = component || (isAngleBracket ? _emberHtmlbarsGlimmerComponent.default : _emberViewsComponentsComponent.default);
var createOptions = (_createOptions = {
parentView: parentView
}, _createOptions[HAS_BLOCK] = !!templates.default, _createOptions);
@@ -12262,11 +12269,10 @@
_emberMetalDebug.assert('You cannot provide a template block if you also specified a templateName', !props.template || !_emberMetalProperty_get.get(props, 'templateName') && !_emberMetalProperty_get.get(viewProto, 'templateName'));
// We only want to override the `_context` computed property if there is
// no specified controller. See View#_context for more information.
-
var noControllerInProto = !viewProto.controller;
if (viewProto.controller && viewProto.controller.isDescriptor) {
noControllerInProto = true;
}
if (noControllerInProto && !viewProto.controllerBinding && !props.controller && !props.controllerBinding) {
@@ -12311,11 +12317,11 @@
*/
function bootstrap(ctx) {
var selectors = 'script[type="text/x-handlebars"], script[type="text/x-raw-handlebars"]';
_emberViewsSystemJquery.default(selectors, ctx).each(function () {
- // Get a reference to the script tag
+ // Get a reference to the script tag.
var script = _emberViewsSystemJquery.default(this);
// Get the name of the script, used by Ember.View's templateName property.
// First look for data-template-name attribute, then fall back to its
// id if no name is found.
@@ -12329,19 +12335,19 @@
template = _emberTemplateCompilerSystemCompile.default(script.html(), {
moduleName: templateName
});
}
- // Check if template of same name already exists
+ // Check if template of same name already exists.
if (_emberHtmlbarsTemplate_registry.has(templateName)) {
throw new _emberMetalError.default('Template named "' + templateName + '" already exists.');
}
- // For templates which have a name, we save them and then remove them from the DOM
+ // For templates which have a name, we save them and then remove them from the DOM.
_emberHtmlbarsTemplate_registry.set(templateName, template);
- // Remove script tag from DOM
+ // Remove script tag from DOM.
script.remove();
});
}
function _bootstrap() {
@@ -12399,14 +12405,14 @@
Provides instrumentation for node managers.
Wrap your node manager's render and re-render methods
with this function.
- @param {Object} component Component or View instance (optional)
- @param {Function} callback The function to instrument
- @param {Object} context The context to call the function with
- @return {Object} Return value from the invoked callback
+ @param {Object} component Component or View instance (optional).
+ @param {Function} callback The function to instrument.
+ @param {Object} context The context to call the function with.
+ @return {Object} Return value from the invoked callback.
@private
*/
function instrument(component, callback, context) {
var instrumentName, val, details, end;
@@ -12482,30 +12488,27 @@
/**
Used to lookup/resolve handlebars helpers. The lookup order is:
* Look for a registered helper
* If a dash exists in the name:
- * Look for a helper registed in the container
+ * Look for a helper registed in the container.
* Use Ember.ComponentLookup to find an Ember.Component that resolves
- to the given name
+ to the given name.
@private
@method resolveHelper
- @param {String} name the name of the helper to lookup
+ @param {String} name The name of the helper to lookup.
@return {Helper}
*/
function _findHelper(name, view, env, options) {
var helper = env.helpers[name];
if (!helper) {
var owner = env.owner;
if (validateLazyHelperName(name, owner, env.hooks.keywords)) {
var helperName = 'helper:' + name;
- // See https://github.com/emberjs/ember.js/issues/13071
- // See https://bugs.chromium.org/p/v8/issues/detail?id=4839
- var registered = owner.hasRegistration(helperName, options);
- if (registered) {
+ if (owner.hasRegistration(helperName, options)) {
helper = owner._lookupFactory(helperName, options);
_emberMetalDebug.assert('Expected to find an Ember.Helper with the name ' + helperName + ', but found an object of type ' + typeof helper + ' instead.', helper.isHelperFactory || helper.isHelperInstance);
}
}
}
@@ -12520,16 +12523,16 @@
options.source = 'template:' + moduleName;
}
var localHelper = _findHelper(name, view, env, options);
- // local match found, use it
+ // Local match found, use it.
if (localHelper) {
return localHelper;
}
- // fallback to global
+ // Fall back to global.
return _findHelper(name, view, env);
}
function lookupHelper(name, view, env) {
var helper = findHelper(name, view, env);
@@ -12548,11 +12551,11 @@
exports.default = makeBoundHelper;
/**
Create a bound helper. Accepts a function that receives the ordered and hash parameters
- from the template. If a bound property was provided in the template it will be resolved to its
+ from the template. If a bound property was provided in the template, it will be resolved to its
value and any changes to the bound property cause the helper function to be re-run with the updated
values.
* `params` - An array of resolved ordered parameters.
* `hash` - An object containing the hash parameters.
@@ -12591,23 +12594,23 @@
@param {Function} fn
@since 1.10.0
*/
function makeBoundHelper(fn) {
- _emberMetalDebug.deprecate('Using `Ember.HTMLBars.makeBoundHelper` is deprecated. Please refactor to using `Ember.Helper` or `Ember.Helper.helper`.', false, { id: 'ember-htmlbars.make-bound-helper', until: '3.0.0' });
+ _emberMetalDebug.deprecate('Using `Ember.HTMLBars.makeBoundHelper` is deprecated. Please refactor to use `Ember.Helper` or `Ember.Helper.helper`.', false, { id: 'ember-htmlbars.make-bound-helper', until: '3.0.0' });
return _emberHtmlbarsHelper.helper(fn);
}
});
-enifed('ember-htmlbars/system/render-env', ['exports', 'ember-htmlbars/env', 'ember-metal-views/renderer', 'container/owner'], function (exports, _emberHtmlbarsEnv, _emberMetalViewsRenderer, _containerOwner) {
+enifed('ember-htmlbars/system/render-env', ['exports', 'ember-htmlbars/env', 'ember-metal-views', 'container/owner'], function (exports, _emberHtmlbarsEnv, _emberMetalViews, _containerOwner) {
'use strict';
exports.default = RenderEnv;
function RenderEnv(options) {
this.lifecycleHooks = options.lifecycleHooks || [];
this.renderedViews = options.renderedViews || [];
- this.renderedNodes = options.renderedNodes || new _emberMetalViewsRenderer.MorphSet();
+ this.renderedNodes = options.renderedNodes || new _emberMetalViews.MorphSet();
this.hasParentOutlet = options.hasParentOutlet || false;
this.view = options.view;
this.outletState = options.outletState;
this.owner = options.owner;
@@ -12702,11 +12705,11 @@
}
});
enifed("ember-htmlbars/template_registry", ["exports"], function (exports) {
// STATE within a module is frowned apon, this exists
// to support Ember.TEMPLATES but shield ember internals from this legacy
- // global API
+ // global API.
"use strict";
exports.setTemplates = setTemplates;
exports.getTemplates = getTemplates;
exports.get = get;
@@ -13687,33 +13690,56 @@
}
if (hasComponentOrTemplate(owner, path)) {
return true; // global component found
} else {
- return false;
+ if (_emberMetalFeatures.default('ember-htmlbars-local-lookup')) {
+ var moduleName = env.meta && env.meta.moduleName;
+
+ if (!moduleName) {
+ // Without a source moduleName, we can not perform local lookups.
+ return false;
+ }
+
+ var options = { source: 'template:' + moduleName };
+
+ return hasComponentOrTemplate(owner, path, options);
+ } else {
+ return false;
+ }
}
}
}
});
-
-// without a source moduleName we can not perform local lookups
enifed('ember-htmlbars/utils/lookup-component', ['exports', 'ember-metal/features'], function (exports, _emberMetalFeatures) {
'use strict';
exports.default = lookupComponent;
- function lookupComponentPair(componentLookup, owner, tagName, options) {
+ function lookupComponentPair(componentLookup, owner, name, options) {
return {
- component: componentLookup.componentFor(tagName, owner, options),
- layout: componentLookup.layoutFor(tagName, owner, options)
+ component: componentLookup.componentFor(name, owner, options),
+ layout: componentLookup.layoutFor(name, owner, options)
};
}
- function lookupComponent(owner, tagName, options) {
+ function lookupComponent(owner, name, options) {
var componentLookup = owner.lookup('component-lookup:main');
- return lookupComponentPair(componentLookup, owner, tagName);
+ if (_emberMetalFeatures.default('ember-htmlbars-local-lookup')) {
+ var source = options && options.source;
+
+ if (source) {
+ var localResult = lookupComponentPair(componentLookup, owner, name, options);
+
+ if (localResult.component || localResult.layout) {
+ return localResult;
+ }
+ }
+ }
+
+ return lookupComponentPair(componentLookup, owner, name);
}
});
enifed('ember-htmlbars/utils/new-stream', ['exports', 'ember-metal/streams/proxy-stream', 'ember-htmlbars/utils/subscribe'], function (exports, _emberMetalStreamsProxyStream, _emberHtmlbarsUtilsSubscribe) {
'use strict';
@@ -13758,11 +13784,11 @@
```
@method htmlSafe
@for Ember.String
@static
- @return {Handlebars.SafeString} a string that will not be html escaped by Handlebars
+ @return {Handlebars.SafeString} A string that will not be HTML escaped by Handlebars.
@public
*/
function htmlSafe(str) {
if (str === null || str === undefined) {
str = '';
@@ -13900,11 +13926,11 @@
function AliasedProperty_oneWaySet(obj, keyName, value) {
_emberMetalProperties.defineProperty(obj, keyName, null);
return _emberMetalProperty_set.set(obj, keyName, value);
}
- // Backwards compatibility with Ember Data
+ // Backwards compatibility with Ember Data.
AliasedProperty.prototype._meta = undefined;
AliasedProperty.prototype.meta = _emberMetalComputed.ComputedProperty.prototype.meta;
});
enifed("ember-metal/assign", ["exports"], function (exports) {
/**
@@ -13948,11 +13974,11 @@
}
return original;
}
});
-enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logger', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/observer', 'ember-metal/run_loop', 'ember-metal/path_cache'], function (exports, _emberMetalCore, _emberMetalLogger, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalObserver, _emberMetalRun_loop, _emberMetalPath_cache) {
+enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/logger', 'ember-metal/run_loop', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/events', 'ember-metal/observer', 'ember-metal/path_cache'], function (exports, _emberMetalCore, _emberMetalLogger, _emberMetalRun_loop, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalEvents, _emberMetalObserver, _emberMetalPath_cache) {
'use strict';
exports.bind = bind;
// ES6TODO: where is Ember.lookup defined?
@@ -13976,35 +14002,26 @@
@default false
@public
*/
_emberMetalCore.default.LOG_BINDINGS = false || !!_emberMetalCore.default.ENV.LOG_BINDINGS;
- /**
- Returns true if the provided path is global (e.g., `MyApp.fooController.bar`)
- instead of local (`foo.bar.baz`).
-
- @method isGlobalPath
- @for Ember
- @private
- @param {String} path
- @return Boolean
- */
-
- function getWithGlobals(obj, path) {
- return _emberMetalProperty_get.get(_emberMetalPath_cache.isGlobal(path) ? _emberMetalCore.default.lookup : obj, path);
- }
-
// ..........................................................
// BINDING
//
function Binding(toPath, fromPath) {
- this._direction = undefined;
+ // Configuration
this._from = fromPath;
this._to = toPath;
- this._readyToSync = undefined;
this._oneWay = undefined;
+
+ // State
+ this._direction = undefined;
+ this._readyToSync = undefined;
+ this._fromObj = undefined;
+ this._fromPath = undefined;
+ this._toObj = undefined;
}
/**
@class Binding
@namespace Ember
@@ -14036,11 +14053,11 @@
connect the binding.
The binding will search for the property path starting at the root object
you pass when you `connect()` the binding. It follows the same rules as
`get()` - see that method for more information.
@method from
- @param {String} path the property path to connect to
+ @param {String} path The property path to connect to.
@return {Ember.Binding} `this`
@public
*/
from: function (path) {
this._from = path;
@@ -14053,11 +14070,11 @@
connect the binding.
The binding will search for the property path starting at the root object
you pass when you `connect()` the binding. It follows the same rules as
`get()` - see that method for more information.
@method to
- @param {String|Tuple} path A property path or tuple
+ @param {String|Tuple} path A property path or tuple.
@return {Ember.Binding} `this`
@public
*/
to: function (path) {
this._to = path;
@@ -14102,121 +14119,143 @@
@public
*/
connect: function (obj) {
_emberMetalDebug.assert('Must pass a valid object to Ember.Binding.connect()', !!obj);
- var fromPath = this._from;
- var toPath = this._to;
- _emberMetalProperty_set.trySet(obj, toPath, getWithGlobals(obj, fromPath));
+ var fromObj = undefined,
+ fromPath = undefined;
- // add an observer on the object to be notified when the binding should be updated
- _emberMetalObserver.addObserver(obj, fromPath, this, this.fromDidChange);
+ // If the binding's "from" path could be interpreted as a global, verify
+ // whether the path refers to a global or not by consulting `Ember.lookup`.
+ if (_emberMetalPath_cache.isGlobalPath(this._from)) {
+ var _name = _emberMetalPath_cache.getFirstKey(this._from);
+ var possibleGlobal = _emberMetalCore.default.lookup[_name];
- // if the binding is a two-way binding, also set up an observer on the target
+ if (possibleGlobal) {
+ fromObj = possibleGlobal;
+ fromPath = _emberMetalPath_cache.getTailPath(this._from);
+ }
+ }
+
+ if (fromObj === undefined) {
+ fromObj = obj;
+ fromPath = this._from;
+ }
+
+ _emberMetalProperty_set.trySet(obj, this._to, _emberMetalProperty_get.get(fromObj, fromPath));
+
+ // Add an observer on the object to be notified when the binding should be updated.
+ _emberMetalObserver.addObserver(fromObj, fromPath, this, 'fromDidChange');
+
+ // If the binding is a two-way binding, also set up an observer on the target.
if (!this._oneWay) {
- _emberMetalObserver.addObserver(obj, toPath, this, this.toDidChange);
+ _emberMetalObserver.addObserver(obj, this._to, this, 'toDidChange');
}
+ _emberMetalEvents.addListener(obj, 'willDestroy', this, 'disconnect');
+
this._readyToSync = true;
+ this._fromObj = fromObj;
+ this._fromPath = fromPath;
+ this._toObj = obj;
return this;
},
/**
Disconnects the binding instance. Changes will no longer be relayed. You
will not usually need to call this method.
@method disconnect
- @param {Object} obj The root object you passed when connecting the binding.
@return {Ember.Binding} `this`
@public
*/
- disconnect: function (obj) {
- _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!obj);
+ disconnect: function () {
+ _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!this._toObj);
- var twoWay = !this._oneWay;
-
- // remove an observer on the object so we're no longer notified of
+ // Remove an observer on the object so we're no longer notified of
// changes that should update bindings.
- _emberMetalObserver.removeObserver(obj, this._from, this, this.fromDidChange);
+ _emberMetalObserver.removeObserver(this._fromObj, this._fromPath, this, 'fromDidChange');
- // if the binding is two-way, remove the observer from the target as well
- if (twoWay) {
- _emberMetalObserver.removeObserver(obj, this._to, this, this.toDidChange);
+ // If the binding is two-way, remove the observer from the target as well.
+ if (!this._oneWay) {
+ _emberMetalObserver.removeObserver(this._toObj, this._to, this, 'toDidChange');
}
- this._readyToSync = false; // disable scheduled syncs...
+ this._readyToSync = false; // Disable scheduled syncs...
return this;
},
// ..........................................................
// PRIVATE
//
- /* called when the from side changes */
+ /* Called when the from side changes. */
fromDidChange: function (target) {
- this._scheduleSync(target, 'fwd');
+ this._scheduleSync('fwd');
},
- /* called when the to side changes */
+ /* Called when the to side changes. */
toDidChange: function (target) {
- this._scheduleSync(target, 'back');
+ this._scheduleSync('back');
},
- _scheduleSync: function (obj, dir) {
+ _scheduleSync: function (dir) {
var existingDir = this._direction;
- // if we haven't scheduled the binding yet, schedule it
+ // If we haven't scheduled the binding yet, schedule it.
if (existingDir === undefined) {
- _emberMetalRun_loop.default.schedule('sync', this, this._sync, obj);
+ _emberMetalRun_loop.default.schedule('sync', this, '_sync');
this._direction = dir;
}
// If both a 'back' and 'fwd' sync have been scheduled on the same object,
// default to a 'fwd' sync so that it remains deterministic.
if (existingDir === 'back' && dir === 'fwd') {
this._direction = 'fwd';
}
},
- _sync: function (obj) {
+ _sync: function () {
var log = _emberMetalCore.default.LOG_BINDINGS;
- // don't synchronize destroyed objects or disconnected bindings
- if (obj.isDestroyed || !this._readyToSync) {
+ var toObj = this._toObj;
+
+ // Don't synchronize destroyed objects or disconnected bindings.
+ if (toObj.isDestroyed || !this._readyToSync) {
return;
}
- // get the direction of the binding for the object we are
- // synchronizing from
+ // Get the direction of the binding for the object we are
+ // synchronizing from.
var direction = this._direction;
- var fromPath = this._from;
- var toPath = this._to;
+ var fromObj = this._fromObj;
+ var fromPath = this._fromPath;
this._direction = undefined;
- // if we're synchronizing from the remote object...
+ // If we're synchronizing from the remote object...
if (direction === 'fwd') {
- var fromValue = getWithGlobals(obj, this._from);
+ var fromValue = _emberMetalProperty_get.get(fromObj, fromPath);
if (log) {
- _emberMetalLogger.default.log(' ', this.toString(), '->', fromValue, obj);
+ _emberMetalLogger.default.log(' ', this.toString(), '->', fromValue, fromObj);
}
if (this._oneWay) {
- _emberMetalProperty_set.trySet(obj, toPath, fromValue);
+ _emberMetalProperty_set.trySet(toObj, this._to, fromValue);
} else {
- _emberMetalObserver._suspendObserver(obj, toPath, this, this.toDidChange, function () {
- _emberMetalProperty_set.trySet(obj, toPath, fromValue);
+ _emberMetalObserver._suspendObserver(toObj, this._to, this, 'toDidChange', function () {
+ _emberMetalProperty_set.trySet(toObj, this._to, fromValue);
});
}
- // if we're synchronizing *to* the remote object
+ // If we're synchronizing *to* the remote object.
} else if (direction === 'back') {
- var toValue = _emberMetalProperty_get.get(obj, this._to);
+ var toValue = _emberMetalProperty_get.get(toObj, this._to);
if (log) {
- _emberMetalLogger.default.log(' ', this.toString(), '<-', toValue, obj);
+ _emberMetalLogger.default.log(' ', this.toString(), '<-', toValue, toObj);
}
- _emberMetalObserver._suspendObserver(obj, fromPath, this, this.fromDidChange, function () {
- _emberMetalProperty_set.trySet(_emberMetalPath_cache.isGlobal(fromPath) ? _emberMetalCore.default.lookup : obj, fromPath, toValue);
+ _emberMetalObserver._suspendObserver(fromObj, fromPath, this, 'fromDidChange', function () {
+ _emberMetalProperty_set.trySet(fromObj, fromPath, toValue);
});
}
}
};
@@ -14253,11 +14292,11 @@
});
/**
An `Ember.Binding` connects the properties of two objects so that whenever
the value of one property changes, the other property will be changed also.
- ## Automatic Creation of Bindings with `/^*Binding/`-named Properties
+ ## Automatic Creation of Bindings with `/^*Binding/`-named Properties.
You do not usually create Binding objects directly but instead describe
bindings in your class or object definition using automatic binding
detection.
@@ -14302,11 +14341,11 @@
## Adding Bindings Manually
All of the examples above show you how to configure a custom binding, but the
result of these customizations will be a binding template, not a fully active
Binding instance. The binding will actually become active only when you
- instantiate the object the binding belongs to. It is useful however, to
+ instantiate the object the binding belongs to. It is useful, however, to
understand what actually happens when the binding is activated.
For a binding to function it must have at least a `from` property and a `to`
property. The `from` property path points to the object/key that you want to
bind from while the `to` path points to the object/key you want to bind to.
@@ -14401,11 +14440,10 @@
function bind(obj, to, from) {
return new Binding(to, from).connect(obj);
}
exports.Binding = Binding;
- exports.isGlobalPath = _emberMetalPath_cache.isGlobal;
});
// Ember.LOG_BINDINGS
enifed('ember-metal/cache', ['exports', 'ember-metal/empty_object'], function (exports, _emberMetalEmpty_object) {
'use strict';
@@ -14459,14 +14497,13 @@
this.hits = 0;
this.misses = 0;
}
};
});
-enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/meta', 'ember-metal/watch_key', 'ember-metal/empty_object'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalMeta, _emberMetalWatch_key, _emberMetalEmpty_object) {
+enifed('ember-metal/chains', ['exports', 'ember-metal/property_get', 'ember-metal/meta', 'ember-metal/watch_key', 'ember-metal/empty_object'], function (exports, _emberMetalProperty_get, _emberMetalMeta, _emberMetalWatch_key, _emberMetalEmpty_object) {
'use strict';
- exports.flushPendingChains = flushPendingChains;
exports.finishChains = finishChains;
var FIRST_KEY = /^([^\.]+)/;
function firstKey(path) {
@@ -14479,13 +14516,11 @@
function isVolatile(obj) {
return !(isObject(obj) && obj.isDescriptor && obj._volatile === false);
}
- function ChainWatchers(obj) {
- // this obj would be the referencing chain node's parent node's value
- this.obj = obj;
+ function ChainWatchers() {
// chain nodes that reference a key in this obj by key
// we only create ChainWatchers when we are going to add them
// so create this upfront
this.chains = new _emberMetalEmpty_object.default();
}
@@ -14566,35 +14601,14 @@
callback(obj, path);
}
}
};
- var pendingQueue = [];
-
- // attempts to add the pendingQueue chains again. If some of them end up
- // back in the queue and reschedule is true, schedules a timeout to try
- // again.
-
- function flushPendingChains() {
- if (pendingQueue.length === 0) {
- return;
- }
-
- var queue = pendingQueue;
- pendingQueue = [];
-
- queue.forEach(function (q) {
- return q[0].add(q[1]);
- });
-
- _emberMetalDebug.warn('Watching an undefined global, Ember expects watched globals to be ' + 'setup by the time the run loop is flushed, check for typos', pendingQueue.length === 0, { id: 'ember-metal.chains-flush-pending-chains' });
+ function makeChainWatcher() {
+ return new ChainWatchers();
}
- function makeChainWatcher(obj) {
- return new ChainWatchers(obj);
- }
-
function addChainWatcher(obj, keyName, node) {
if (!isObject(obj)) {
return;
}
@@ -14711,88 +14725,53 @@
},
// called on the root node of a chain to setup watchers on the specified
// path.
add: function (path) {
- var obj, tuple, key, src, paths;
-
- paths = this._paths;
+ var paths = this._paths;
paths[path] = (paths[path] || 0) + 1;
- obj = this.value();
- tuple = _emberMetalProperty_get.normalizeTuple(obj, path);
+ var key = firstKey(path);
+ var tail = path.slice(key.length + 1);
- // the path was a local path
- if (tuple[0] && tuple[0] === obj) {
- path = tuple[1];
- key = firstKey(path);
- path = path.slice(key.length + 1);
-
- // global path, but object does not exist yet.
- // put into a queue and try to connect later.
- } else if (!tuple[0]) {
- pendingQueue.push([this, path]);
- tuple.length = 0;
- return;
-
- // global path, and object already exists
- } else {
- src = tuple[0];
- key = path.slice(0, 0 - (tuple[1].length + 1));
- path = tuple[1];
- }
-
- tuple.length = 0;
- this.chain(key, path, src);
+ this.chain(key, tail);
},
// called on the root node of a chain to teardown watcher on the specified
// path
remove: function (path) {
- var obj, tuple, key, src, paths;
-
- paths = this._paths;
+ var paths = this._paths;
if (paths[path] > 0) {
paths[path]--;
}
- obj = this.value();
- tuple = _emberMetalProperty_get.normalizeTuple(obj, path);
- if (tuple[0] === obj) {
- path = tuple[1];
- key = firstKey(path);
- path = path.slice(key.length + 1);
- } else {
- src = tuple[0];
- key = path.slice(0, 0 - (tuple[1].length + 1));
- path = tuple[1];
- }
+ var key = firstKey(path);
+ var tail = path.slice(key.length + 1);
- tuple.length = 0;
- this.unchain(key, path);
+ this.unchain(key, tail);
},
- chain: function (key, path, src) {
+ chain: function (key, path) {
var chains = this._chains;
var node;
if (chains === undefined) {
chains = this._chains = new _emberMetalEmpty_object.default();
} else {
node = chains[key];
}
if (node === undefined) {
- node = chains[key] = new ChainNode(this, key, src);
+ node = chains[key] = new ChainNode(this, key, undefined);
}
node.count++; // count chains...
// chain rest of path if there is one
if (path) {
key = firstKey(path);
path = path.slice(key.length + 1);
- node.chain(key, path); // NOTE: no src means it will observe changes...
+ node.chain(key, path);
}
},
unchain: function (key, path) {
var chains = this._chains;
@@ -14835,29 +14814,25 @@
}
}
}
if (affected && this._parent) {
- this._parent.populateAffected(this, this._key, 1, affected);
+ this._parent.populateAffected(this._key, 1, affected);
}
},
- populateAffected: function (chain, path, depth, affected) {
+ populateAffected: function (path, depth, affected) {
if (this._key) {
path = this._key + '.' + path;
}
if (this._parent) {
- this._parent.populateAffected(this, path, depth + 1, affected);
+ this._parent.populateAffected(path, depth + 1, affected);
} else {
if (depth > 1) {
affected.push(this.value(), path);
}
- path = 'this.' + path;
- if (this._paths[path] > 0) {
- affected.push(this.value(), path);
- }
}
}
};
function finishChains(obj) {
@@ -14894,10 +14869,14 @@
function UNDEFINED() {}
var DEEP_EACH_REGEX = /\.@each\.[^.]+\./;
+ // ..........................................................
+ // COMPUTED PROPERTY
+ //
+
/**
A computed property transforms an object literal with object's accessor function(s) into a property.
By default the function backing the computed property will only be called
once and the result will be cached. You can specify various properties
@@ -14996,10 +14975,11 @@
- [New CP syntax RFC](https://github.com/emberjs/rfcs/blob/master/text/0011-improved-cp-syntax.md)
- [New computed syntax explained in "Ember 1.12 released" ](http://emberjs.com/blog/2015/05/13/ember-1-12-released.html#toc_new-computed-syntax)
@class ComputedProperty
@namespace Ember
+ @constructor
@public
*/
function ComputedProperty(config, opts) {
this.isDescriptor = true;
if (typeof config === 'function') {
@@ -15154,10 +15134,11 @@
@method meta
@param {Object} meta
@chainable
@public
*/
+
ComputedPropertyPrototype.meta = function (meta) {
if (arguments.length === 0) {
return this._meta || {};
} else {
this._meta = meta;
@@ -15184,10 +15165,37 @@
cache[keyName] = undefined;
_emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta);
}
};
+ /**
+ Access the value of the function backing the computed property.
+ If this property has already been cached, return the cached result.
+ Otherwise, call the function passing the property name as an argument.
+
+ ```javascript
+ let Person = Ember.Object.extend({
+ fullName: Ember.computed('firstName', 'lastName', function(keyName) {
+ // the keyName parameter is 'fullName' in this case.
+ return this.get('firstName') + ' ' + this.get('lastName');
+ })
+ });
+
+
+ let tom = Person.create({
+ firstName: 'Tom',
+ lastName: 'Dale'
+ });
+
+ tom.get('fullName') // 'Tom Dale'
+ ```
+
+ @method get
+ @param {String} keyName The key being accessed.
+ @return {Object} The return value of the function backing the CP.
+ @public
+ */
ComputedPropertyPrototype.get = function (obj, keyName) {
if (this._volatile) {
return this._getter.call(obj, keyName);
}
@@ -15215,10 +15223,58 @@
_emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta);
return ret;
};
+ /**
+ Set the value of a computed property. If the function that backs your
+ computed property does not accept arguments then the default action for
+ setting would be to define the property on the current object, and set
+ the value of the property to the value being set.
+
+ Generally speaking if you intend for your computed property to be set
+ you should pass `set(key, value)` function in hash as argument to `Ember.computed()` along with `get(key)` function.
+
+ ```javascript
+ let Person = Ember.Object.extend({
+ // these will be supplied by `create`
+ firstName: null,
+ lastName: null,
+
+ fullName: Ember.computed('firstName', 'lastName', {
+ // getter
+ get() {
+ let firstName = this.get('firstName');
+ let lastName = this.get('lastName');
+
+ return firstName + ' ' + lastName;
+ },
+ // setter
+ set(key, value) {
+ let [firstName, lastName] = value.split(' ');
+
+ this.set('firstName', firstName);
+ this.set('lastName', lastName);
+
+ return value;
+ }
+ })
+ });
+
+ let person = Person.create();
+
+ person.set('fullName', 'Peter Wagenet');
+ person.get('firstName'); // 'Peter'
+ person.get('lastName'); // 'Wagenet'
+ ```
+
+ @method set
+ @param {String} keyName The key being accessed.
+ @param {Object} newValue The new value being assigned.
+ @return {Object} The return value of the function backing the CP.
+ @public
+ */
ComputedPropertyPrototype.set = function computedPropertySetEntry(obj, keyName, value) {
if (this._readOnly) {
this._throwReadOnlyError(obj, keyName);
}
@@ -15358,11 +15414,11 @@
this.firstName = 'Betty';
this.lastName = 'Jones';
},
- fullName: Ember.computed('firstName', 'lastName', {
+ fullName: Ember.computed({
get(key) {
return `${this.get('firstName')} ${this.get('lastName')}`;
},
set(key, value) {
let [firstName, lastName] = value.split(/\s+/);
@@ -16136,19 +16192,21 @@
/**
This namespace contains all Ember methods and functions. Future versions of
Ember may overwrite this namespace and therefore, you should avoid adding any
new properties.
+ You can also use the shorthand `Em` instead of `Ember`.
+
At the heart of Ember is Ember-Runtime, a set of core functions that provide
cross-platform compatibility and object property observing. Ember-Runtime is
small and performance-focused so you can use it alongside other
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.4.6
+ @version 2.5.0-beta.1
@public
*/
if ('undefined' === typeof Ember) {
// Create core object. Make it act like an instance of Ember.Namespace so that
@@ -16186,15 +16244,15 @@
/**
The semantic version.
@property VERSION
@type String
- @default '2.4.6'
+ @default '2.5.0-beta.1'
@static
@public
*/
- Ember.VERSION = '2.4.6';
+ Ember.VERSION = '2.5.0-beta.1';
/**
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
@@ -16921,22 +16979,21 @@
var events = args;
func.__ember_listens__ = events;
return func;
}
});
-enifed('ember-metal/expand_properties', ['exports', 'ember-metal/error'], function (exports, _emberMetalError) {
+enifed('ember-metal/expand_properties', ['exports', 'ember-metal/debug'], function (exports, _emberMetalDebug) {
'use strict';
exports.default = expandProperties;
/**
@module ember
@submodule ember-metal
*/
var SPLIT_REGEX = /\{|\}/;
-
var END_WITH_EACH_REGEX = /\.@each$/;
/**
Expands `pattern`, invoking `callback` for each expansion.
@@ -16964,29 +17021,25 @@
@param {Function} callback The callback to invoke. It is invoked once per
expansion, and is passed the expansion.
*/
function expandProperties(pattern, callback) {
- if (pattern.indexOf(' ') > -1) {
- throw new _emberMetalError.default('Brace expanded properties cannot contain spaces, e.g. \'user.{firstName, lastName}\' should be \'user.{firstName,lastName}\'');
- }
+ _emberMetalDebug.assert('A computed property key must be a string', typeof pattern === 'string');
+ _emberMetalDebug.assert('Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"', pattern.indexOf(' ') === -1);
- if ('string' === typeof pattern) {
- var parts = pattern.split(SPLIT_REGEX);
- var properties = [parts];
+ var parts = pattern.split(SPLIT_REGEX);
+ var properties = [parts];
- parts.forEach(function (part, index) {
- if (part.indexOf(',') >= 0) {
- properties = duplicateAndReplace(properties, part.split(','), index);
- }
- });
+ for (var i = 0; i < parts.length; i++) {
+ var part = parts[i];
+ if (part.indexOf(',') >= 0) {
+ properties = duplicateAndReplace(properties, part.split(','), i);
+ }
+ }
- properties.forEach(function (property) {
- callback(property.join('').replace(END_WITH_EACH_REGEX, '.[]'));
- });
- } else {
- callback(pattern.replace(END_WITH_EACH_REGEX, '.[]'));
+ for (var i = 0; i < properties.length; i++) {
+ callback(properties[i].join('').replace(END_WITH_EACH_REGEX, '.[]'));
}
}
function duplicateAndReplace(properties, currentParts, index) {
var all = [];
@@ -17018,15 +17071,13 @@
@namespace Ember
@static
@since 1.1.0
@public
*/
- var KNOWN_FEATURES = {};exports.KNOWN_FEATURES = KNOWN_FEATURES;
+ var FEATURES = _emberMetalAssign.default({}, _emberMetalCore.default.ENV.FEATURES);exports.FEATURES = FEATURES;
// jshint ignore:line
- var FEATURES = _emberMetalAssign.default(KNOWN_FEATURES, _emberMetalCore.default.ENV.FEATURES);
- exports.FEATURES = FEATURES;
/**
Determine whether the specified `feature` is enabled. Used by Ember's
build tools to exclude experimental features from beta/stable builds.
You can define the following configuration options:
@@ -17096,11 +17147,11 @@
ret[propertyNames[i]] = _emberMetalProperty_get.get(obj, propertyNames[i]);
}
return ret;
}
});
-enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/assign', 'ember-metal/merge', 'ember-metal/instrumentation', 'ember-metal/utils', 'ember-metal/meta', 'ember-metal/error', 'ember-metal/cache', 'ember-metal/logger', 'ember-metal/property_get', 'ember-metal/events', 'ember-metal/observer_set', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/property_set', 'ember-metal/map', 'ember-metal/get_properties', 'ember-metal/set_properties', 'ember-metal/watch_key', 'ember-metal/chains', 'ember-metal/watch_path', 'ember-metal/watching', 'ember-metal/expand_properties', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/computed_macros', 'ember-metal/observer', 'ember-metal/mixin', 'ember-metal/binding', 'ember-metal/run_loop', 'ember-metal/libraries', 'ember-metal/is_none', 'ember-metal/is_empty', 'ember-metal/is_blank', 'ember-metal/is_present', 'backburner'], function (exports, _require, _emberMetalCore, _emberMetalDebug, _emberMetalFeatures, _emberMetalAssign, _emberMetalMerge, _emberMetalInstrumentation, _emberMetalUtils, _emberMetalMeta, _emberMetalError, _emberMetalCache, _emberMetalLogger, _emberMetalProperty_get, _emberMetalEvents, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalProperty_set, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalExpand_properties, _emberMetalComputed, _emberMetalAlias, _emberMetalComputed_macros, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalRun_loop, _emberMetalLibraries, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _backburner) {
+enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/assign', 'ember-metal/merge', 'ember-metal/instrumentation', 'ember-metal/utils', 'ember-metal/meta', 'ember-metal/error', 'ember-metal/cache', 'ember-metal/logger', 'ember-metal/property_get', 'ember-metal/events', 'ember-metal/observer_set', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/property_set', 'ember-metal/map', 'ember-metal/get_properties', 'ember-metal/set_properties', 'ember-metal/watch_key', 'ember-metal/chains', 'ember-metal/watch_path', 'ember-metal/watching', 'ember-metal/expand_properties', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/computed_macros', 'ember-metal/observer', 'ember-metal/mixin', 'ember-metal/binding', 'ember-metal/path_cache', 'ember-metal/run_loop', 'ember-metal/libraries', 'ember-metal/is_none', 'ember-metal/is_empty', 'ember-metal/is_blank', 'ember-metal/is_present', 'backburner'], function (exports, _require, _emberMetalCore, _emberMetalDebug, _emberMetalFeatures, _emberMetalAssign, _emberMetalMerge, _emberMetalInstrumentation, _emberMetalUtils, _emberMetalMeta, _emberMetalError, _emberMetalCache, _emberMetalLogger, _emberMetalProperty_get, _emberMetalEvents, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalProperty_set, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalExpand_properties, _emberMetalComputed, _emberMetalAlias, _emberMetalComputed_macros, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalPath_cache, _emberMetalRun_loop, _emberMetalLibraries, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _backburner) {
/**
@module ember
@submodule ember-metal
*/
@@ -17166,11 +17217,10 @@
_emberMetalCore.default.Logger = _emberMetalLogger.default;
_emberMetalCore.default.get = _emberMetalProperty_get.get;
_emberMetalCore.default.getWithDefault = _emberMetalProperty_get.getWithDefault;
- _emberMetalCore.default.normalizeTuple = _emberMetalProperty_get.normalizeTuple;
_emberMetalCore.default._getPath = _emberMetalProperty_get._getPath;
_emberMetalCore.default.on = _emberMetalEvents.on;
_emberMetalCore.default.addListener = _emberMetalEvents.addListener;
_emberMetalCore.default.removeListener = _emberMetalEvents.removeListener;
@@ -17204,11 +17254,10 @@
_emberMetalCore.default.setProperties = _emberMetalSet_properties.default;
_emberMetalCore.default.watchKey = _emberMetalWatch_key.watchKey;
_emberMetalCore.default.unwatchKey = _emberMetalWatch_key.unwatchKey;
- _emberMetalCore.default.flushPendingChains = _emberMetalChains.flushPendingChains;
_emberMetalCore.default.removeChainWatcher = _emberMetalChains.removeChainWatcher;
_emberMetalCore.default._ChainNode = _emberMetalChains.ChainNode;
_emberMetalCore.default.finishChains = _emberMetalChains.finishChains;
_emberMetalCore.default.watchPath = _emberMetalWatch_path.watchPath;
@@ -17240,11 +17289,11 @@
_emberMetalCore.default.mixin = _emberMetalMixin.mixin;
_emberMetalCore.default.Mixin = _emberMetalMixin.Mixin;
_emberMetalCore.default.bind = _emberMetalBinding.bind;
_emberMetalCore.default.Binding = _emberMetalBinding.Binding;
- _emberMetalCore.default.isGlobalPath = _emberMetalBinding.isGlobalPath;
+ _emberMetalCore.default.isGlobalPath = _emberMetalPath_cache.isGlobalPath;
_emberMetalCore.default.run = _emberMetalRun_loop.default;
/**
@class Backburner
@@ -17262,10 +17311,11 @@
_emberMetalCore.default.isNone = _emberMetalIs_none.default;
_emberMetalCore.default.isEmpty = _emberMetalIs_empty.default;
_emberMetalCore.default.isBlank = _emberMetalIs_blank.default;
_emberMetalCore.default.isPresent = _emberMetalIs_present.default;
+ _emberMetalCore.default.assign = Object.assign || _emberMetalAssign.default;
_emberMetalCore.default.merge = _emberMetalMerge.default;
_emberMetalCore.default.FEATURES = _emberMetalFeatures.FEATURES;
_emberMetalCore.default.FEATURES.isEnabled = _emberMetalFeatures.default;
@@ -17303,10 +17353,14 @@
_emberMetalCore.default.Debug.registerDeprecationHandler = function () {};
_emberMetalCore.default.Debug.registerWarnHandler = function () {};
}
+ _emberMetalDebug.deprecate('Support for the `ember-legacy-views` addon will end soon, please remove it from your application.', !!_emberMetalCore.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT, { id: 'ember-legacy-views', until: '2.6.0', url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-view' });
+
+ _emberMetalDebug.deprecate('Support for the `ember-legacy-controllers` addon will end soon, please remove it from your application.', !!_emberMetalCore.default.ENV._ENABLE_LEGACY_CONTROLLER_SUPPORT, { id: 'ember-legacy-controllers', until: '2.6.0', url: 'http://emberjs.com/deprecations/v1.x/#toc_objectcontroller' });
+
_emberMetalCore.default.create = _emberMetalDebug.deprecateFunc('Ember.create is deprecated in favor of Object.create', { id: 'ember-metal.ember-create', until: '3.0.0' }, Object.create);
_emberMetalCore.default.keys = _emberMetalDebug.deprecateFunc('Ember.keys is deprecated in favor of Object.keys', { id: 'ember-metal.ember.keys', until: '3.0.0' }, Object.keys);
exports.default = _emberMetalCore.default;
});
@@ -17833,10 +17887,16 @@
this._registry.splice(index, 1);
}
}
};
+ if (_emberMetalFeatures.default('ember-libraries-isregistered')) {
+ Libraries.prototype.isRegistered = function (name) {
+ return !!this._getLibraryByName(name);
+ };
+ }
+
exports.default = Libraries;
});
enifed('ember-metal/logger', ['exports', 'ember-metal/core', 'ember-metal/error'], function (exports, _emberMetalCore, _emberMetalError) {
'use strict';
@@ -18504,10 +18564,13 @@
@return {Object}
@public
*/
function merge(original, updates) {
+ if (_emberMetalFeatures.default('ember-metal-ember-assign')) {
+ _emberMetalDebug.deprecate('Usage of `Ember.merge` is deprecated, use `Ember.assign` instead.', false, { id: 'ember-metal.merge', until: '3.0.0' });
+ }
if (!updates || typeof updates !== 'object') {
return original;
}
@@ -20359,13 +20422,13 @@
// define a simple property
Ember.defineProperty(contact, 'lastName', undefined, 'Jolley');
// define a computed property
- Ember.defineProperty(contact, 'fullName', Ember.computed('firstName', 'lastName', function() {
+ Ember.defineProperty(contact, 'fullName', Ember.computed(function() {
return this.firstName+' '+this.lastName;
- }));
+ }).property('firstName', 'lastName'));
```
@private
@method defineProperty
@for Ember
@@ -20743,24 +20806,21 @@
exports.overrideChains = overrideChains;
exports.beginPropertyChanges = beginPropertyChanges;
exports.endPropertyChanges = endPropertyChanges;
exports.changeProperties = changeProperties;
});
-enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/debug', 'ember-metal/error', 'ember-metal/path_cache'], function (exports, _emberMetalCore, _emberMetalDebug, _emberMetalError, _emberMetalPath_cache) {
+enifed('ember-metal/property_get', ['exports', 'ember-metal/debug', 'ember-metal/path_cache'], function (exports, _emberMetalDebug, _emberMetalPath_cache) {
/**
@module ember-metal
*/
'use strict';
exports.get = get;
- exports.normalizeTuple = normalizeTuple;
exports._getPath = _getPath;
exports.getWithDefault = getWithDefault;
- var FIRST_KEY = /^([^\.]+)/;
-
// ..........................................................
// GET AND SET
//
// If we are on a platform that supports accessors we can use those.
// Otherwise simulate accessors by looking up the property directly on the
@@ -20822,81 +20882,28 @@
return ret;
}
}
- /**
- Normalizes a target/path pair to reflect that actual target/path that should
- be observed, etc. This takes into account passing in global property
- paths (i.e. a path beginning with a capital letter not defined on the
- target).
-
- @private
- @method normalizeTuple
- @for Ember
- @param {Object} target The current target. May be `null`.
- @param {String} path A path on the target or a global property path.
- @return {Array} a temporary array with the normalized target/path pair.
- */
-
- function normalizeTuple(target, path) {
- var hasThis = _emberMetalPath_cache.hasThis(path);
- var isGlobal = !hasThis && _emberMetalPath_cache.isGlobal(path);
- var key;
-
- if (!target && !isGlobal) {
- return [undefined, ''];
- }
-
- if (hasThis) {
- path = path.slice(5);
- }
-
- if (!target || isGlobal) {
- target = _emberMetalCore.default.lookup;
- }
-
- if (isGlobal && _emberMetalPath_cache.isPath(path)) {
- key = path.match(FIRST_KEY)[0];
- target = get(target, key);
- path = path.slice(key.length + 1);
- }
-
- // must return some kind of path to be valid else other things will break.
- validateIsPath(path);
-
- return [target, path];
- }
-
- function validateIsPath(path) {
- if (!path || path.length === 0) {
- throw new _emberMetalError.default('Object in path ' + path + ' could not be found or was destroyed.');
- }
- }
-
function _getPath(root, path) {
- var hasThis, parts, tuple, idx, len;
+ var obj = root;
+ var parts = path.split('.');
+ var len = parts.length;
- // detect complicated paths and normalize them
- hasThis = _emberMetalPath_cache.hasThis(path);
+ for (var i = 0; i < len; i++) {
+ if (obj == null) {
+ return obj;
+ }
- if (!root || hasThis) {
- tuple = normalizeTuple(root, path);
- root = tuple[0];
- path = tuple[1];
- tuple.length = 0;
- }
+ obj = get(obj, parts[i]);
- parts = path.split('.');
- len = parts.length;
- for (idx = 0; root != null && idx < len; idx++) {
- root = get(root, parts[idx]);
- if (root && root.isDestroyed) {
+ if (obj && obj.isDestroyed) {
return undefined;
}
}
- return root;
+
+ return obj;
}
/**
Retrieves the value of a property from an Object, or a default value in the
case that the property returns `undefined`.
@@ -20962,11 +20969,11 @@
var isUnknown, currentValue;
if (desc === undefined && _emberMetalPath_cache.isPath(keyName)) {
return setPath(obj, keyName, value, tolerant);
}
- _emberMetalDebug.assert('calling set on destroyed object', !obj.isDestroyed);
+ _emberMetalDebug.assert('calling set on destroyed object: ' + _emberMetalUtils.toString(obj) + '.' + keyName + ' = ' + _emberMetalUtils.toString(value), !obj.isDestroyed);
if (desc) {
desc.set(obj, keyName, value);
} else {
if (value !== undefined && typeof obj === 'object' && obj[keyName] === value) {
@@ -22456,17 +22463,17 @@
exports.zipHash = zipHash;
exports.chain = chain;
exports.setValue = setValue;
/*
- Check whether an object is a stream or not
+ Check whether an object is a stream or not.
@private
@for Ember.stream
@function isStream
- @param {Object|Stream} object object to check whether it is a stream
- @return {Boolean} `true` if the object is a stream, `false` otherwise
+ @param {Object|Stream} object Object to check whether it is a stream.
+ @return {Boolean} `true` if the object is a stream, `false` otherwise.
*/
function isStream(object) {
return object && object.isStream;
}
@@ -22476,14 +22483,14 @@
object. If a non-stream object is passed, the function does nothing.
@public
@for Ember.stream
@function subscribe
- @param {Object|Stream} object object or stream to potentially subscribe to
- @param {Function} callback function to run when stream value changes
+ @param {Object|Stream} object Object or stream to potentially subscribe to.
+ @param {Function} callback Function to run when stream value changes.
@param {Object} [context] the callback will be executed with this context if it
- is provided
+ is provided.
*/
function subscribe(object, callback, context) {
if (object && object.isStream) {
return object.subscribe(callback, context);
@@ -22495,30 +22502,30 @@
object. If a non-stream object is passed, the function does nothing.
@private
@for Ember.stream
@function unsubscribe
- @param {Object|Stream} object object or stream to potentially unsubscribe from
- @param {Function} callback function originally passed to `subscribe()`
- @param {Object} [context] object originally passed to `subscribe()`
+ @param {Object|Stream} object Object or stream to potentially unsubscribe from.
+ @param {Function} callback Function originally passed to `subscribe()`.
+ @param {Object} [context] Object originally passed to `subscribe()`.
*/
function unsubscribe(object, callback, context) {
if (object && object.isStream) {
object.unsubscribe(callback, context);
}
}
/*
- Retrieve the value of a stream, or in the case a non-stream object is passed,
+ Retrieve the value of a stream, or in the case where a non-stream object is passed,
return the object itself.
@private
@for Ember.stream
@function read
- @param {Object|Stream} object object to return the value of
- @return the stream's current value, or the non-stream object itself
+ @param {Object|Stream} object Object to return the value of.
+ @return The stream's current value, or the non-stream object itself.
*/
function read(object) {
if (object && object.isStream) {
return object.value();
@@ -22532,11 +22539,11 @@
@private
@for Ember.stream
@function readArray
@param {Array} array The array to read values from
- @return {Array} a new array of the same length with the values of non-stream
+ @return {Array} A new array of the same length with the values of non-stream
objects mapped from their original positions untouched, and
the values of stream objects retaining their original position
and replaced with the stream's current value.
*/
@@ -22554,12 +22561,12 @@
stream.
@private
@for Ember.stream
@function readHash
- @param {Object} object The hash to read keys and values from
- @return {Object} a new object with the same keys as the passed object. The
+ @param {Object} object The hash to read keys and values from.
+ @return {Object} A new object with the same keys as the passed object. The
property values in the new object are the original values in
the case of non-stream objects, and the streams' current
values in the case of stream objects.
*/
@@ -22570,18 +22577,18 @@
}
return ret;
}
/*
- Check whether an array contains any stream values
+ Check whether an array contains any stream values.
@private
@for Ember.stream
@function scanArray
- @param {Array} array array given to a handlebars helper
+ @param {Array} array Array given to a handlebars helper.
@return {Boolean} `true` if the array contains a stream/bound value, `false`
- otherwise
+ otherwise.
*/
function scanArray(array) {
var length = array.length;
var containsStream = false;
@@ -22595,18 +22602,18 @@
return containsStream;
}
/*
- Check whether a hash has any stream property values
+ Check whether a hash has any stream property values.
@private
@for Ember.stream
@function scanHash
- @param {Object} hash "hash" argument given to a handlebars helper
+ @param {Object} hash "hash" argument given to a handlebars helper.
@return {Boolean} `true` if the object contains a stream/bound value, `false`
- otherwise
+ otherwise.
*/
function scanHash(hash) {
var containsStream = false;
@@ -22623,12 +22630,12 @@
var ConcatStream = _emberMetalStreamsStream.default.extend({
init: function (array, separator) {
this.array = array;
this.separator = separator;
- // used by angle bracket components to detect an attribute was provided
- // as a string literal
+ // Used by angle bracket components to detect an attribute was provided
+ // as a string literal.
this.isConcat = true;
},
label: function () {
var labels = labelsFor(this.array);
@@ -22639,21 +22646,21 @@
return concat(readArray(this.array), this.separator);
}
});
/*
- Join an array, with any streams replaced by their current values
+ Join an array, with any streams replaced by their current values.
@private
@for Ember.stream
@function concat
@param {Array} array An array containing zero or more stream objects and
- zero or more non-stream objects
- @param {String} separator string to be used to join array elements
+ zero or more non-stream objects.
+ @param {String} separator String to be used to join array elements.
@return {String} String with array elements concatenated and joined by the
provided separator, and any stream array members having been
- replaced by the current value of the stream
+ replaced by the current value of the stream.
*/
function concat(array, separator) {
// TODO: Create subclass ConcatStream < Stream. Defer
// subscribing to streams until the value() is called.
@@ -22789,13 +22796,13 @@
source was numeric.
@private
@for Ember.stream
@function chain
- @param {Object|Stream} value A stream or non-stream object
- @param {Function} fn function to be run when the stream value changes, or to
- be run once in the case of a non-stream object
+ @param {Object|Stream} value A stream or non-stream object.
+ @param {Function} fn Function to be run when the stream value changes, or to
+ be run once in the case of a non-stream object.
@return {Object|Stream} In the case of a stream `value` parameter, a new
stream that will be updated with the return value of
the provided function `fn`. In the case of a
non-stream object, the return value of the provided
function `fn`.
@@ -22858,10 +22865,11 @@
exports.makeArray = makeArray;
exports.inspect = inspect;
exports.apply = apply;
exports.applyStr = applyStr;
exports.lookupDescriptor = lookupDescriptor;
+ exports.toString = toString;
var _uuid = 0;
/**
Generates a universally unique identifier. This method
is used internally by Ember for assisting with
@@ -23242,11 +23250,11 @@
// ........................................
// TYPING & ARRAY MESSAGING
//
- var toString = Object.prototype.toString;
+ var objectToString = Object.prototype.toString;
/**
Forces the passed object to be part of an array. If the object is already
an array, it will return the object. Otherwise, it will add the object to
an array. If obj is `null` or `undefined`, it will return an empty array.
@@ -23306,11 +23314,11 @@
var type = typeof obj;
if (type !== 'object' && type !== 'symbol') {
return '' + obj;
}
// overridden toString
- if (typeof obj.toString === 'function' && obj.toString !== toString) {
+ if (typeof obj.toString === 'function' && obj.toString !== objectToString) {
return obj.toString();
}
// Object.prototype.toString === {}.toString
var v;
@@ -23324,11 +23332,11 @@
if (typeof v === 'function') {
v = 'function() { ... }';
}
if (v && typeof v.toString !== 'function') {
- ret.push(key + ': ' + toString.call(v));
+ ret.push(key + ': ' + objectToString.call(v));
} else {
ret.push(key + ': ' + v);
}
}
}
@@ -23406,10 +23414,21 @@
}
return null;
}
+ // A `toString` util function that supports objects without a `toString`
+ // method, e.g. an object created with `Object.create(null)`.
+
+ function toString(obj) {
+ if (obj && obj.toString) {
+ return obj.toString();
+ } else {
+ return objectToString.call(obj);
+ }
+ }
+
exports.GUID_KEY = GUID_KEY;
exports.makeArray = makeArray;
exports.canInvoke = canInvoke;
});
enifed('ember-metal/watch_key', ['exports', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/properties', 'ember-metal/utils'], function (exports, _emberMetalFeatures, _emberMetalMeta, _emberMetalProperties, _emberMetalUtils) {
@@ -23625,12 +23644,10 @@
function watcherCount(obj, key) {
var meta = _emberMetalMeta.peekMeta(obj);
return meta && meta.peekWatching(key) || 0;
}
- watch.flushPending = _emberMetalChains.flushPendingChains;
-
function unwatch(obj, _keyPath, m) {
// can't watch length on Array - it is special...
if (_keyPath === 'length' && Array.isArray(obj)) {
return;
}
@@ -23782,21 +23799,21 @@
} else {
return false;
}
};
});
-enifed('ember-metal-views/index', ['exports', 'ember-metal-views/renderer'], function (exports, _emberMetalViewsRenderer) {
+enifed('ember-metal-views/htmlbars-renderer', ['exports', 'ember-metal/run_loop', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/assign', 'ember-metal/set_properties', 'ember-views/system/build-component-template', 'ember-metal/environment', 'htmlbars-runtime'], function (exports, _emberMetalRun_loop, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalAssign, _emberMetalSet_properties, _emberViewsSystemBuildComponentTemplate, _emberMetalEnvironment, _htmlbarsRuntime) {
'use strict';
- exports.Renderer = _emberMetalViewsRenderer.default;
-});
-enifed('ember-metal-views/renderer', ['exports', 'ember-metal/run_loop', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/assign', 'ember-metal/set_properties', 'ember-views/system/build-component-template', 'ember-metal/environment'], function (exports, _emberMetalRun_loop, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalAssign, _emberMetalSet_properties, _emberViewsSystemBuildComponentTemplate, _emberMetalEnvironment) {
- 'use strict';
-
+ exports.Renderer = Renderer;
exports.MorphSet = MorphSet;
- function Renderer(domHelper, destinedForDOM) {
+ function Renderer(domHelper) {
+ var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+
+ var destinedForDOM = _ref.destinedForDOM;
+
this._dom = domHelper;
// This flag indicates whether the resulting rendered element will be
// inserted into the DOM. This should be set to `false` if the rendered
// element is going to be serialized to HTML without being inserted into
@@ -23827,11 +23844,11 @@
view.lastResult = renderNode.lastResult;
this.clearRenderedViews(view.env);
};
Renderer.prototype.renderTopLevelView = function Renderer_renderTopLevelView(view, renderNode) {
- // Check to see if insertion has been canceled
+ // Check to see if insertion has been canceled.
if (view._willInsert) {
view._willInsert = false;
this.prerenderTopLevelView(view, renderNode);
this.dispatchLifecycleHooks(view.env);
}
@@ -23906,11 +23923,11 @@
Renderer.prototype.clearRenderedViews = function Renderer_clearRenderedViews(env) {
env.renderedNodes.clear();
env.renderedViews.length = 0;
};
- // This entry point is called from top-level `view.appendTo`
+ // This entry point is called from top-level `view.appendTo`.
Renderer.prototype.appendTo = function Renderer_appendTo(view, target) {
var morph = this._dom.appendMorph(target);
morph.ownerNode = morph;
view._willInsert = true;
_emberMetalRun_loop.default.schedule('render', this, this.renderTopLevelView, view, morph);
@@ -23941,30 +23958,30 @@
Renderer.prototype.willInsertElement = function (view) {
if (view.trigger) {
view.trigger('willInsertElement');
}
- }; // will place into DOM
+ }; // Will place into DOM.
Renderer.prototype.setAttrs = function (view, attrs) {
_emberMetalProperty_set.set(view, 'attrs', attrs);
- }; // set attrs the first time
+ }; // Set attrs the first time.
Renderer.prototype.componentInitAttrs = function (component, attrs) {
component.trigger('didInitAttrs', { attrs: attrs });
component.trigger('didReceiveAttrs', { newAttrs: attrs });
- }; // set attrs the first time
+ }; // Set attrs the first time.
Renderer.prototype.didInsertElement = function (view) {
if (view._transitionTo) {
view._transitionTo('inDOM');
}
if (view.trigger) {
view.trigger('didInsertElement');
}
- }; // inDOM // placed into DOM
+ }; // inDOM // Placed into DOM.
Renderer.prototype.didUpdate = function (view) {
if (view.trigger) {
view.trigger('didUpdate');
}
@@ -23976,11 +23993,11 @@
}
};
Renderer.prototype.updateAttrs = function (view, attrs) {
this.setAttrs(view, attrs);
- }; // setting new attrs
+ }; // Setting new attrs.
Renderer.prototype.componentUpdateAttrs = function (component, newAttrs) {
var oldAttrs = null;
if (component.attrs) {
@@ -24012,10 +24029,24 @@
Renderer.prototype.componentWillRender = function (component) {
component.trigger('willRender');
};
+ Renderer.prototype.rerender = function (view) {
+ var renderNode = view._renderNode;
+
+ renderNode.isDirty = true;
+ _htmlbarsRuntime.internal.visitChildren(renderNode.childNodes, function (node) {
+ if (node.getState().manager) {
+ node.shouldReceiveAttrs = true;
+ }
+ node.isDirty = true;
+ });
+
+ renderNode.ownerNode.emberView.scheduleRevalidate(renderNode, view.toString(), 'rerendering');
+ };
+
Renderer.prototype.remove = function (view, shouldDestroy) {
this.willDestroyElement(view);
view._willRemoveElement = true;
_emberMetalRun_loop.default.schedule('render', this, this.renderElementRemoval, view);
@@ -24063,14 +24094,23 @@
}
if (view.trigger) {
view.trigger('didDestroyElement');
}
- }; // element destroyed so view.destroy shouldn't try to remove it removedFromDOM
+ }; // Element destroyed so view.destroy shouldn't try to remove it removedFromDOM
exports.default = Renderer;
});
+enifed('ember-metal-views/index', ['exports', 'ember-metal-views/htmlbars-renderer'], function (exports, _emberMetalViewsHtmlbarsRenderer) {
+ 'use strict';
+
+ function _interopExportWildcard(obj, defaults) { var newObj = defaults({}, obj); delete newObj['default']; return newObj; }
+
+ function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
+
+ _defaults(exports, _interopExportWildcard(_emberMetalViewsHtmlbarsRenderer, _defaults));
+});
enifed('ember-routing/ext/controller', ['exports', 'ember-metal/property_get', 'ember-runtime/mixins/controller'], function (exports, _emberMetalProperty_get, _emberRuntimeMixinsController) {
'use strict';
/**
@module ember
@@ -25741,10 +25781,16 @@
controllerProto = definedControllerClass.proto();
var controllerDefinedQueryParameterConfiguration = _emberMetalProperty_get.get(controllerProto, 'queryParams');
var normalizedControllerQueryParameterConfiguration = _emberRoutingUtils.normalizeControllerQueryParams(controllerDefinedQueryParameterConfiguration);
combinedQueryParameterConfiguration = mergeEachQueryParams(normalizedControllerQueryParameterConfiguration, queryParameterConfiguraton);
+
+ if (_emberMetalFeatures.default('ember-routing-route-configured-query-params')) {
+ if (controllerDefinedQueryParameterConfiguration.length) {
+ _emberMetalDebug.deprecate('Configuring query parameters on a controller is deprecated. Migrate the query parameters configuration from the \'' + controllerName + '\' controller to the \'' + this.routeName + '\' route: ' + combinedQueryParameterConfiguration, false, { id: 'ember-routing.controller-configured-query-params', until: '3.0.0' });
+ }
+ }
} else if (hasRouterDefinedQueryParams) {
// the developer has not defined a controller but *has* supplied route query params.
// Generate a class for them so we can later insert default values
var generatedControllerClass = _emberRoutingSystemGenerate_controller.generateControllerFactory(_containerOwner.getOwner(this), controllerName);
controllerProto = generatedControllerClass.proto();
@@ -25767,10 +25813,23 @@
continue;
}
var desc = combinedQueryParameterConfiguration[propName];
+ if (_emberMetalFeatures.default('ember-routing-route-configured-query-params')) {
+ // apply default values to controllers
+ // detect that default value defined on router config
+ if (desc.hasOwnProperty('defaultValue')) {
+ // detect that property was not defined on controller
+ if (controllerProto[propName] === undefined) {
+ controllerProto[propName] = desc.defaultValue;
+ } else {
+ deprecateQueryParamDefaultValuesSetOnController(controllerName, this.routeName, propName);
+ }
+ }
+ }
+
var scope = desc.scope || 'model';
var parts;
if (scope === 'controller') {
parts = [];
@@ -27345,11 +27404,11 @@
the Route calls `render`:
```javascript
//
this.render('post', { // the template name associated with 'post' Route
into: 'application', // the parent route to 'post' Route
- outlet: 'main', // {{outlet}} and {{outlet 'main'}} are synonymous,
+ outlet: 'main', // {{outlet}} and {{outlet 'main' are synonymous}},
view: 'post', // the view associated with the 'post' Route
controller: 'post', // the controller associated with the 'post' Route
})
```
By default the controller's `model` will be the route's model, so it does not
@@ -27574,10 +27633,21 @@
ViewClass: ViewClass,
template: template
};
var Component = undefined;
+ if (_emberMetalFeatures.default('ember-routing-routable-components')) {
+ var componentName = options && options.component || namePassed && name || route.componentName || name;
+ var componentLookup = owner.lookup('component-lookup:main');
+ Component = componentLookup.lookupFactory(componentName);
+ var isGlimmerComponent = Component && Component.proto().isGlimmerComponent;
+ if (!template && !ViewClass && Component && isGlimmerComponent) {
+ renderOptions.Component = Component;
+ renderOptions.ViewClass = undefined;
+ renderOptions.attrs = { model: _emberMetalProperty_get.get(controller, 'model') };
+ }
+ }
if (!ViewClass && !template && !Component) {
_emberMetalDebug.assert('Could not find "' + name + '" template, view, or component.', isDefaultRender);
if (LOG_VIEW_LOOKUPS) {
var fullName = 'template:' + name;
@@ -27641,16 +27711,20 @@
*/
function mergeEachQueryParams(controllerQP, routeQP) {
var keysAlreadyMergedOrSkippable;
var qps = {};
- keysAlreadyMergedOrSkippable = {
- defaultValue: true,
- type: true,
- scope: true,
- as: true
- };
+ if (_emberMetalFeatures.default('ember-routing-route-configured-query-params')) {
+ keysAlreadyMergedOrSkippable = {};
+ } else {
+ keysAlreadyMergedOrSkippable = {
+ defaultValue: true,
+ type: true,
+ scope: true,
+ as: true
+ };
+ }
// first loop over all controller qps, merging them with any matching route qps
// into a new empty object to avoid mutating.
for (var cqpName in controllerQP) {
if (!controllerQP.hasOwnProperty(cqpName)) {
@@ -27693,15 +27767,10 @@
}
exports.default = Route;
});
// FEATURES, A, deprecate, assert, Logger
-
-// apply default values to controllers
-// detect that default value defined on router config
-
-// detect that property was not defined on controller
enifed('ember-routing/system/router', ['exports', 'ember-metal/logger', 'ember-metal/debug', 'ember-metal/error', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/properties', 'ember-metal/empty_object', 'ember-metal/computed', 'ember-metal/assign', 'ember-metal/run_loop', 'ember-runtime/system/object', 'ember-runtime/mixins/evented', 'ember-routing/system/dsl', 'ember-routing/location/api', 'ember-routing/utils', 'ember-metal/utils', 'ember-routing/system/router_state', 'container/owner', 'ember-metal/dictionary', 'router', 'router/transition'], function (exports, _emberMetalLogger, _emberMetalDebug, _emberMetalError, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalProperties, _emberMetalEmpty_object, _emberMetalComputed, _emberMetalAssign, _emberMetalRun_loop, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented, _emberRoutingSystemDsl, _emberRoutingLocationApi, _emberRoutingUtils, _emberMetalUtils, _emberRoutingSystemRouter_state, _containerOwner, _emberMetalDictionary, _router4, _routerTransition) {
'use strict';
exports.triggerEvent = triggerEvent;
@@ -27878,13 +27947,13 @@
var Router = Ember.Router.extend({
location: config.locationType,
didTransition: function() {
this._super(...arguments);
return ga('send', 'pageview', {
- 'page': this.get('url'),
- 'title': this.get('url')
- });
+ 'page': this.get('url'),
+ 'title': this.get('url')
+ });
}
});
```
@method didTransition
@public
@@ -27982,11 +28051,11 @@
transitioning to the route.
@param {Object} [options] optional hash with a queryParams property
containing a mapping of query parameters
@return {Transition} the transition object associated with this
attempted transition
- @private
+ @public
*/
transitionTo: function () {
var queryParams;
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
@@ -29184,17 +29253,17 @@
{{input on-input=(action "save")}}
{{yield (action "refreshData") andAnotherParam}}
```
In these contexts,
- the helper is called a "closure action" helper. It's behavior is simple:
+ the helper is called a "closure action" helper. Its behavior is simple:
If passed a function name, read that function off the `actions` property
of the current context. Once that function is read (or if a function was
passed), create a closure over that function and any arguments.
The resulting value of an action helper used this way is simply a function.
- For example with this attribute context example:
+ For example, in the attribute context:
```handlebars
{{! An example of attribute context }}
<div onclick={{action "save"}}></div>
```
@@ -29211,11 +29280,11 @@
div.onclick = actionFunction;
```
Thus when the div is clicked, the action on that context is called.
Because the `actionFunction` is just a function, closure actions can be
- passed between components the still execute in the correct context.
+ passed between components and still execute in the correct context.
Here is an example action handler on a component:
```js
export default Ember.Component.extend({
@@ -29259,12 +29328,12 @@
}
});
```
The first argument (`model`) was curried over, and the run-time argument (`event`)
- becomes a second argument. Action calls be nested this way because each simply
- returns a function. Any function can be passed to the `{{action` helper, including
+ becomes a second argument. Action calls can be nested this way because each simply
+ returns a function. Any function can be passed to the `{{action}}` helper, including
other actions.
Actions invoked with `sendAction` have the same currying behavior as demonstrated
with `on-input` above. For example:
@@ -29290,32 +29359,31 @@
this.sendAction('submit', 'bob');
}
});
```
- ### Attaching actions to DOM
+ ### Attaching actions to DOM elements
- The third context the `{{action` helper can be used in we call "element space".
+ The third context of the `{{action}}` helper can be called "element space".
For example:
```handlebars
{{! An example of element space }}
<div {{action "save"}}></div>
```
Used this way, the `{{action}}` helper provides a useful shortcut for
- registering an HTML element within a template for a single DOM event and
+ registering an HTML element in a template for a single DOM event and
forwarding that interaction to the template's context (controller or component).
If the context of a template is a controller, actions used this way will
bubble to routes when the controller does not implement the specified action.
Once an action hits a route, it will bubble through the route hierarchy.
### Event Propagation
- `{{action}}` helpers called in element space can control event bubbling. Note
- that the closure style actions cannot.
+ `{{action}}` helpers called in element space can control event bubbling.
Events triggered through the action helper will automatically have
`.preventDefault()` called on them. You do not need to do so in your event
handlers. If you need to allow event propagation (to handle file inputs for
example) you can supply the `preventDefault=false` option to the `{{action}}` helper:
@@ -29331,66 +29399,45 @@
```handlebars
<button {{action 'edit' post bubbles=false}}>Edit</button>
```
- To disable bubbling with closure style actions you must create your own
- wrapper helper that makes use of `event.stopPropagation()`:
-
- ```handlebars
- <div onclick={{disable-bubbling (action "sayHello")}}>Hello</div>
- ```
-
- ```js
- // app/helpers/disable-bubbling.js
- import Ember from 'ember';
-
- export function disableBubbling([action]) {
- return function(event) {
- event.stopPropagation();
-
- return action(event);
- };
- }
-
- export default Ember.Helper.helper(disableBubbling);
- ```
-
If you need the default handler to trigger you should either register your
- own event handler, or use event methods on your view class. See [Ember.View](/api/classes/Ember.View.html)
- 'Responding to Browser Events' for more information.
+ own event handler, or use event methods on your view class. See
+ ["Responding to Browser Events"](/api/classes/Ember.View.html#toc_responding-to-browser-events)
+ in the documentation for Ember.View for more information.
### Specifying DOM event type
- `{{action` helpers called in element space can specify an event type.
+ `{{action}}` helpers called in element space can specify an event type.
By default the `{{action}}` helper registers for DOM `click` events. You can
supply an `on` option to the helper to specify a different DOM event name:
```handlebars
<div {{action "anActionName" on="doubleClick"}}>
click me
</div>
```
- See [Event Names](/api/classes/Ember.View.html#toc_event-names) for a list of
+ See ["Event Names"](/api/classes/Ember.View.html#toc_event-names) for a list of
acceptable DOM event names.
### Specifying whitelisted modifier keys
- `{{action` helpers called in element space can specify modifier keys.
+ `{{action}}` helpers called in element space can specify modifier keys.
- By default the `{{action}}` helper will ignore click event with pressed modifier
+ By default the `{{action}}` helper will ignore click events with pressed modifier
keys. You can supply an `allowedKeys` option to specify which keys should not be ignored.
```handlebars
<div {{action "anActionName" allowedKeys="alt"}}>
click me
</div>
```
- This way the `{{action}}` will fire when clicking with the alt key pressed down.
+ This way the action will fire when clicking with the alt key pressed down.
Alternatively, supply "any" to the `allowedKeys` option to accept any combination of modifier keys.
```handlebars
<div {{action "anActionName" allowedKeys="any"}}>
@@ -29473,13 +29520,10 @@
}
if (!action) {
throw new _emberMetalError.default('An action named \'' + actionName + '\' was not found in ' + target + '.');
}
- } else if (action && typeof action[INVOKE] === 'function') {
- target = action;
- action = action[INVOKE];
} else if (actionType !== 'function') {
throw new _emberMetalError.default('An action could not be made for `' + rawAction.label + '` in ' + target + '. Please confirm that you are using either a quoted action name (i.e. `(action \'' + rawAction.label + '\')`) or a function available in ' + target + '.');
}
}
@@ -29847,29 +29891,28 @@
controllerName = name;
controllerFullName = 'controller:' + controllerName;
}
var parentController = _emberMetalStreamsUtils.read(scope.getLocal('controller'));
- var target = parentController || router;
var controller;
// choose name
if (params.length > 1) {
var factory = owner._lookupFactory(controllerFullName) || _emberRoutingSystemGenerate_controller.generateControllerFactory(owner, controllerName);
controller = factory.create({
model: _emberMetalStreamsUtils.read(context),
parentController: parentController,
- target: target
+ target: parentController
});
node.addDestruction(controller);
} else {
controller = owner.lookup(controllerFullName) || _emberRoutingSystemGenerate_controller.default(owner, controllerName);
controller.setProperties({
- target: target,
+ target: parentController,
parentController: parentController
});
}
if (view) {
@@ -30285,11 +30328,11 @@
@submodule ember-routing-views
*/
'use strict';
- _emberHtmlbarsTemplatesLinkTo.default.meta.revision = 'Ember@2.4.6';
+ _emberHtmlbarsTemplatesLinkTo.default.meta.revision = 'Ember@2.5.0-beta.1';
/**
`Ember.LinkComponent` renders an element whose `click` event triggers a
transition of the application's instance of `Ember.Router` to
a supplied route by name.
@@ -30724,11 +30767,11 @@
var params = _emberMetalProperty_get.get(this, 'params').slice();
_emberMetalDebug.assert('You must provide one or more parameters to the link-to component.', params.length);
var disabledWhen = _emberMetalProperty_get.get(this, 'disabledWhen');
- if (disabledWhen !== undefined) {
+ if (disabledWhen) {
this.set('disabled', disabledWhen);
}
// Process the positional arguments, in order.
// 1. Inline link title comes first, if present.
@@ -30788,11 +30831,11 @@
@submodule ember-routing-views
*/
'use strict';
- _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.4.6';
+ _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.5.0-beta.1';
var CoreOutletView = _emberViewsViewsView.default.extend({
defaultTemplate: _emberHtmlbarsTemplatesTopLevelView.default,
init: function () {
@@ -30939,12 +30982,23 @@
case 'boolean':
case 'number':
return spaceship(v, w);
case 'string':
- return spaceship(v.localeCompare(w), 0);
+ // We are comparing Strings using operators instead of `String#localeCompare`
+ // because of unexpected behavior for certain edge cases.
+ // For example `'Z'.localeCompare('a')` returns `1`.
+ //
+ // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare#Description
+ if (v < w) {
+ return -1;
+ } else if (v === w) {
+ return 0;
+ }
+ return 1;
+
case 'array':
var vLen = v.length;
var wLen = w.length;
var len = Math.min(vLen, wLen);
@@ -33256,23 +33310,12 @@
/**
Returns a special object that can be used to observe individual properties
on the array. Just get an equivalent property on this object and it will
return an enumerable that maps automatically to the named key on the
member objects.
- `@each` should only be used in a non-terminal context. Example:
- ```javascript
- myMethod: computed('posts.@each.author', function(){
- ...
- });
- ```
- If you merely want to watch for the array being changed, like an object being
- replaced, added or removed, use `[]` instead of `@each`.
- ```javascript
- myMethod: computed('posts.[]', function(){
- ...
- });
- ```
+ If you merely want to watch for any items being added or removed to the array,
+ use the `[]` property instead of `@each`.
@property @each
@public
*/
'@each': _emberMetalComputed.computed(function () {
// TODO use Symbol or add to meta
@@ -33725,11 +33768,10 @@
var arr = [];
arr.get('firstObject'); // undefined
```
@property firstObject
@return {Object} the object or undefined
- @readOnly
@public
*/
firstObject: _emberMetalComputed.computed('[]', function () {
if (_emberMetalProperty_get.get(this, 'length') === 0) {
return undefined;
@@ -33754,11 +33796,10 @@
var arr = [];
arr.get('lastObject'); // undefined
```
@property lastObject
@return {Object} the last object or undefined
- @readOnly
@public
*/
lastObject: _emberMetalComputed.computed('[]', function () {
var len = _emberMetalProperty_get.get(this, 'length');
@@ -36282,12 +36323,13 @@
@method triggerAction
@param opts {Object} (optional, with the optional keys action, target and/or actionContext)
@return {Boolean} true if the action was sent successfully and did not return false
@private
*/
- triggerAction: function (opts) {
- opts = opts || {};
+ triggerAction: function () {
+ var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
var action = opts.action || _emberMetalProperty_get.get(this, 'action');
var target = opts.target || _emberMetalProperty_get.get(this, 'targetObject');
var actionContext = opts.actionContext;
function args(options, actionName) {
@@ -36827,11 +36869,11 @@
}
if (mergedProperties && mergedProperties.length && mergedProperties.indexOf(keyName) >= 0) {
var originalValue = this[keyName];
- value = _emberMetalAssign.default({}, originalValue, value);
+ value = _emberMetalAssign.default(originalValue, value);
}
if (desc) {
desc.set(this, keyName, value);
} else {
@@ -38116,18 +38158,18 @@
var A;
if (_emberMetalCore.default.EXTEND_PROTOTYPES === true || _emberMetalCore.default.EXTEND_PROTOTYPES.Array) {
NativeArray.apply(Array.prototype);
exports. // ES6TODO: Setting A onto the object returned by ember-metal/core to avoid circles
- A = A = function (arr) {
- return arr || [];
+ A = A = function () {
+ var arr = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
+ return arr;
};
} else {
- exports.A = A = function (arr) {
- if (arr === undefined) {
- arr = [];
- }
+ exports.A = A = function () {
+ var arr = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
+
return _emberRuntimeMixinsArray.default.detect(arr) ? arr : NativeArray.apply(arr);
};
}
_emberMetalCore.default.A = A;exports.A = A;
@@ -38774,24 +38816,23 @@
EmberHandlebars.precompile = _emberTemplateCompilerCompatPrecompile.default;
EmberHandlebars.compile = _emberTemplateCompilerSystemCompile.default;
EmberHandlebars.template = _emberTemplateCompilerSystemTemplate.default;
});
-enifed('ember-template-compiler/index', ['exports', 'ember-metal', 'ember-template-compiler/system/precompile', 'ember-template-compiler/system/compile', 'ember-template-compiler/system/template', 'ember-template-compiler/plugins', 'ember-template-compiler/plugins/transform-old-binding-syntax', 'ember-template-compiler/plugins/transform-old-class-binding-syntax', 'ember-template-compiler/plugins/transform-item-class', 'ember-template-compiler/plugins/transform-closure-component-attrs-into-mut', 'ember-template-compiler/plugins/transform-component-attrs-into-mut', 'ember-template-compiler/plugins/transform-component-curly-to-readonly', 'ember-template-compiler/plugins/transform-angle-bracket-components', 'ember-template-compiler/plugins/transform-input-on-to-onEvent', 'ember-template-compiler/plugins/transform-top-level-components', 'ember-template-compiler/plugins/transform-each-into-collection', 'ember-template-compiler/plugins/transform-unescaped-inline-link-to', 'ember-template-compiler/plugins/deprecate-render-block', 'ember-template-compiler/plugins/assert-no-view-and-controller-paths', 'ember-template-compiler/plugins/assert-no-view-helper', 'ember-template-compiler/compat'], function (exports, _emberMetal, _emberTemplateCompilerSystemPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemTemplate, _emberTemplateCompilerPlugins, _emberTemplateCompilerPluginsTransformOldBindingSyntax, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax, _emberTemplateCompilerPluginsTransformItemClass, _emberTemplateCompilerPluginsTransformClosureComponentAttrsIntoMut, _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut, _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly, _emberTemplateCompilerPluginsTransformAngleBracketComponents, _emberTemplateCompilerPluginsTransformInputOnToOnEvent, _emberTemplateCompilerPluginsTransformTopLevelComponents, _emberTemplateCompilerPluginsTransformEachIntoCollection, _emberTemplateCompilerPluginsTransformUnescapedInlineLinkTo, _emberTemplateCompilerPluginsDeprecateRenderBlock, _emberTemplateCompilerPluginsAssertNoViewAndControllerPaths, _emberTemplateCompilerPluginsAssertNoViewHelper, _emberTemplateCompilerCompat) {
+enifed('ember-template-compiler/index', ['exports', 'ember-metal', 'ember-template-compiler/system/precompile', 'ember-template-compiler/system/compile', 'ember-template-compiler/system/template', 'ember-template-compiler/plugins', 'ember-template-compiler/plugins/transform-old-binding-syntax', 'ember-template-compiler/plugins/transform-old-class-binding-syntax', 'ember-template-compiler/plugins/transform-item-class', 'ember-template-compiler/plugins/transform-component-attrs-into-mut', 'ember-template-compiler/plugins/transform-component-curly-to-readonly', 'ember-template-compiler/plugins/transform-angle-bracket-components', 'ember-template-compiler/plugins/transform-input-on-to-onEvent', 'ember-template-compiler/plugins/transform-top-level-components', 'ember-template-compiler/plugins/transform-each-into-collection', 'ember-template-compiler/plugins/transform-unescaped-inline-link-to', 'ember-template-compiler/plugins/assert-no-view-and-controller-paths', 'ember-template-compiler/plugins/assert-no-view-helper', 'ember-template-compiler/plugins/assert-no-each-in', 'ember-template-compiler/compat'], function (exports, _emberMetal, _emberTemplateCompilerSystemPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemTemplate, _emberTemplateCompilerPlugins, _emberTemplateCompilerPluginsTransformOldBindingSyntax, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax, _emberTemplateCompilerPluginsTransformItemClass, _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut, _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly, _emberTemplateCompilerPluginsTransformAngleBracketComponents, _emberTemplateCompilerPluginsTransformInputOnToOnEvent, _emberTemplateCompilerPluginsTransformTopLevelComponents, _emberTemplateCompilerPluginsTransformEachIntoCollection, _emberTemplateCompilerPluginsTransformUnescapedInlineLinkTo, _emberTemplateCompilerPluginsAssertNoViewAndControllerPaths, _emberTemplateCompilerPluginsAssertNoViewHelper, _emberTemplateCompilerPluginsAssertNoEachIn, _emberTemplateCompilerCompat) {
'use strict';
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformOldBindingSyntax.default);
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformOldClassBindingSyntax.default);
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformItemClass.default);
- _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformClosureComponentAttrsIntoMut.default);
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut.default);
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly.default);
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformAngleBracketComponents.default);
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformInputOnToOnEvent.default);
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformTopLevelComponents.default);
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformUnescapedInlineLinkTo.default);
- _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsDeprecateRenderBlock.default);
+ _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsAssertNoEachIn.default);
if (_emberMetal.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT) {
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformEachIntoCollection.default);
} else {
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsAssertNoViewAndControllerPaths.default);
@@ -38804,17 +38845,60 @@
exports.template = _emberTemplateCompilerSystemTemplate.default;
exports.registerPlugin = _emberTemplateCompilerPlugins.registerPlugin;
});
// used for adding Ember.Handlebars.compile for backwards compat
+enifed('ember-template-compiler/plugins/assert-no-each-in', ['exports', 'ember-metal/core', 'ember-metal/debug', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberMetalDebug, _emberTemplateCompilerSystemCalculateLocationDisplay) {
+ 'use strict';
+
+ function AssertNoEachIn() {
+ var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
+ this.syntax = null;
+ this.options = options;
+ }
+
+ AssertNoEachIn.prototype.transform = function AssertNoEachIn_transform(ast) {
+ if (!!_emberMetalCore.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT) {
+ return ast;
+ }
+ var walker = new this.syntax.Walker();
+ var moduleName = this.options && this.options.moduleName;
+
+ walker.visit(ast, function (node) {
+ if (!validate(node)) {
+ return;
+ }
+ assertHelper(moduleName, node);
+ });
+
+ return ast;
+ };
+
+ function assertHelper(moduleName, node) {
+ var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, node.loc);
+ var singular = node.params[0].original;
+ var plural = node.params[2].original;
+
+ _emberMetalDebug.assert('Using {{#each ' + singular + ' in ' + plural + '}} ' + moduleInfo + 'is no longer supported in Ember 2.0+, please use {{#each ' + plural + ' as |' + singular + '|}}');
+ }
+
+ function validate(node) {
+ return (node.type === 'BlockStatement' || node.type === 'MustacheStatement') && node.path.original === 'each' && node.params.length === 3 && node.params[1].type === 'PathExpression' && node.params[1].original === 'in';
+ }
+
+ exports.default = AssertNoEachIn;
+});
enifed('ember-template-compiler/plugins/assert-no-view-and-controller-paths', ['exports', 'ember-metal/core', 'ember-metal/debug', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberMetalDebug, _emberTemplateCompilerSystemCalculateLocationDisplay) {
'use strict';
- function AssertNoViewAndControllerPaths(options) {
+ function AssertNoViewAndControllerPaths() {
+ var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
// set later within HTMLBars to the syntax package
this.syntax = null;
- this.options = options || {};
+ this.options = options;
}
/**
@private
@method transform
@@ -38885,14 +38969,16 @@
exports.default = AssertNoViewAndControllerPaths;
});
enifed('ember-template-compiler/plugins/assert-no-view-helper', ['exports', 'ember-metal/core', 'ember-metal/debug', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberMetalDebug, _emberTemplateCompilerSystemCalculateLocationDisplay) {
'use strict';
- function AssertNoViewHelper(options) {
+ function AssertNoViewHelper() {
+ var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
// set later within HTMLBars to the syntax package
this.syntax = null;
- this.options = options || {};
+ this.options = options;
}
/**
@private
@method transform
@@ -38930,49 +39016,10 @@
return (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && node.path.parts[0] === 'view';
}
exports.default = AssertNoViewHelper;
});
-enifed('ember-template-compiler/plugins/deprecate-render-block', ['exports', 'ember-metal/debug', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalDebug, _emberTemplateCompilerSystemCalculateLocationDisplay) {
- 'use strict';
-
- exports.default = DeprecateRenderBlock;
-
- function DeprecateRenderBlock(options) {
- this.syntax = null;
- this.options = options;
- }
-
- DeprecateRenderBlock.prototype.transform = function DeprecateRenderBlock_transform(ast) {
- var moduleName = this.options.moduleName;
- var walker = new this.syntax.Walker();
-
- walker.visit(ast, function (node) {
- if (!validate(node)) {
- return;
- }
-
- _emberMetalDebug.deprecate(deprecationMessage(moduleName, node), false, {
- id: 'ember-template-compiler.deprecate-render-block',
- until: '2.4.0',
- url: 'http://emberjs.com/deprecations/v2.x#toc_render-helper-with-block'
- });
- });
-
- return ast;
- };
-
- function validate(node) {
- return node.type === 'BlockStatement' && node.path.original === 'render';
- }
-
- function deprecationMessage(moduleName, node) {
- var sourceInformation = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, node.loc);
-
- return 'Usage of `render` in block form is deprecated ' + sourceInformation + '.';
- }
-});
enifed('ember-template-compiler/plugins/transform-angle-bracket-components', ['exports'], function (exports) {
'use strict';
function TransformAngleBracketComponents() {
// set later within HTMLBars to the syntax package
@@ -39002,92 +39049,10 @@
return node.type === 'ComponentNode';
}
exports.default = TransformAngleBracketComponents;
});
-enifed('ember-template-compiler/plugins/transform-closure-component-attrs-into-mut', ['exports'], function (exports) {
- 'use strict';
-
- function TransformClosureComponentAttrsIntoMut() {
- // set later within HTMLBars to the syntax package
- this.syntax = null;
- }
-
- /**
- @private
- @method transform
- @param {AST} ast The AST to be transformed.
- */
- TransformClosureComponentAttrsIntoMut.prototype.transform = function TransformClosureComponentAttrsIntoMut_transform(ast) {
- var b = this.syntax.builders;
- var walker = new this.syntax.Walker();
-
- walker.visit(ast, function (node) {
- if (validate(node)) {
- processExpression(b, node);
- }
- });
-
- return ast;
- };
-
- function processExpression(builder, node) {
- processSubExpressionsInNode(builder, node);
-
- if (isComponentClosure(node)) {
- mutParameters(builder, node);
- }
- }
-
- function processSubExpressionsInNode(builder, node) {
- for (var i = 0; i < node.params.length; i++) {
- if (node.params[i].type === 'SubExpression') {
- processExpression(builder, node.params[i]);
- }
- }
-
- each(node.hash.pairs, function (pair) {
- var value = pair.value;
-
- if (value.type === 'SubExpression') {
- processExpression(builder, value);
- }
- });
- }
-
- function isComponentClosure(node) {
- return node.type === 'SubExpression' && node.path.original === 'component';
- }
-
- function mutParameters(builder, node) {
- for (var i = 1; i < node.params.length; i++) {
- if (node.params[i].type === 'PathExpression') {
- node.params[i] = builder.sexpr(builder.path('@mut'), [node.params[i]]);
- }
- }
-
- each(node.hash.pairs, function (pair) {
- var value = pair.value;
-
- if (value.type === 'PathExpression') {
- pair.value = builder.sexpr(builder.path('@mut'), [pair.value]);
- }
- });
- }
-
- function validate(node) {
- return node.type === 'BlockStatement' || node.type === 'MustacheStatement';
- }
-
- function each(list, callback) {
- for (var i = 0, l = list.length; i < l; i++) {
- callback(list[i]);
- }
- }
-
- exports.default = TransformClosureComponentAttrsIntoMut;
-});
enifed('ember-template-compiler/plugins/transform-component-attrs-into-mut', ['exports'], function (exports) {
'use strict';
function TransformComponentAttrsIntoMut() {
// set later within HTMLBars to the syntax package
@@ -39179,79 +39144,10 @@
}
}
exports.default = TransformComponentCurlyToReadonly;
});
-enifed('ember-template-compiler/plugins/transform-each-in-to-hash', ['exports'], function (exports) {
- /**
- @module ember
- @submodule ember-htmlbars
- */
-
- /**
- An HTMLBars AST transformation that replaces all instances of
-
- ```handlebars
- {{#each item in items}}
- {{/each}}
- ```
-
- with
-
- ```handlebars
- {{#each items keyword="item"}}
- {{/each}}
- ```
-
- @class TransformEachInToHash
- @private
- */
- 'use strict';
-
- function TransformEachInToHash(options) {
- // set later within HTMLBars to the syntax package
- this.syntax = null;
- this.options = options || {};
- }
-
- /**
- @private
- @method transform
- @param {AST} ast The AST to be transformed.
- */
- TransformEachInToHash.prototype.transform = function TransformEachInToHash_transform(ast) {
- var pluginContext = this;
- var walker = new pluginContext.syntax.Walker();
- var b = pluginContext.syntax.builders;
-
- walker.visit(ast, function (node) {
- if (pluginContext.validate(node)) {
- if (node.program && node.program.blockParams.length) {
- throw new Error('You cannot use keyword (`{{each foo in bar}}`) and block params (`{{each bar as |foo|}}`) at the same time.');
- }
-
- var removedParams = node.sexpr.params.splice(0, 2);
- var keyword = removedParams[0].original;
-
- // TODO: This may not be necessary.
- if (!node.sexpr.hash) {
- node.sexpr.hash = b.hash();
- }
-
- node.sexpr.hash.pairs.push(b.pair('keyword', b.string(keyword)));
- }
- });
-
- return ast;
- };
-
- TransformEachInToHash.prototype.validate = function TransformEachInToHash_validate(node) {
- return (node.type === 'BlockStatement' || node.type === 'MustacheStatement') && node.sexpr.path.original === 'each' && node.sexpr.params.length === 3 && node.sexpr.params[1].type === 'PathExpression' && node.sexpr.params[1].original === 'in';
- };
-
- exports.default = TransformEachInToHash;
-});
enifed('ember-template-compiler/plugins/transform-each-into-collection', ['exports', 'ember-metal/debug', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalDebug, _emberTemplateCompilerSystemCalculateLocationDisplay) {
'use strict';
exports.default = TransformEachIntoCollection;
@@ -39337,14 +39233,16 @@
```
@private
@class TransformInputOnToOnEvent
*/
- function TransformInputOnToOnEvent(options) {
+ function TransformInputOnToOnEvent() {
+ var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
// set later within HTMLBars to the syntax package
this.syntax = null;
- this.options = options || {};
+ this.options = options;
}
/**
@private
@method transform
@@ -39689,11 +39587,11 @@
}
return segments;
}
});
-enifed('ember-template-compiler/plugins/transform-top-level-components', ['exports', 'ember-metal/features'], function (exports, _emberMetalFeatures) {
+enifed('ember-template-compiler/plugins/transform-top-level-components', ['exports'], function (exports) {
'use strict';
function TransformTopLevelComponents() {
// set later within HTMLBars to the syntax package
this.syntax = null;
@@ -39840,12 +39738,12 @@
enifed('ember-template-compiler/system/calculate-location-display', ['exports'], function (exports) {
'use strict';
exports.default = calculateLocationDisplay;
- function calculateLocationDisplay(moduleName, _loc) {
- var loc = _loc || {};
+ function calculateLocationDisplay(moduleName) {
+ var loc = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var _ref = loc.start || {};
var column = _ref.column;
var line = _ref.line;
@@ -39903,11 +39801,11 @@
var templateSpec = compile(templateString, _emberTemplateCompilerSystemCompile_options.default(options));
return _emberTemplateCompilerSystemTemplate.default(templateSpec);
};
});
-enifed('ember-template-compiler/system/compile_options', ['exports', 'ember-metal/features', 'ember-metal/assign', 'ember-template-compiler/plugins'], function (exports, _emberMetalFeatures, _emberMetalAssign, _emberTemplateCompilerPlugins) {
+enifed('ember-template-compiler/system/compile_options', ['exports', 'ember-metal/assign', 'ember-template-compiler/plugins'], function (exports, _emberMetalAssign, _emberTemplateCompilerPlugins) {
/**
@module ember
@submodule ember-template-compiler
*/
@@ -39943,11 +39841,11 @@
options.plugins = plugins;
options.buildMeta = function buildMeta(program) {
return {
fragmentReason: fragmentReason(program),
- revision: 'Ember@2.4.6',
+ revision: 'Ember@2.5.0-beta.1',
loc: program.loc,
moduleName: options.moduleName
};
};
@@ -40151,62 +40049,136 @@
exception: function (error) {
ok(false, _emberMetalUtils.inspect(error));
}
});
});
-enifed('ember-testing/helpers', ['exports', 'ember-metal/property_get', 'ember-metal/error', 'ember-metal/run_loop', 'ember-views/system/jquery', 'ember-testing/test', 'ember-runtime/ext/rsvp'], function (exports, _emberMetalProperty_get, _emberMetalError, _emberMetalRun_loop, _emberViewsSystemJquery, _emberTestingTest, _emberRuntimeExtRsvp) {
+enifed('ember-testing/helpers', ['exports', 'ember-metal/property_get', 'ember-metal/error', 'ember-metal/run_loop', 'ember-views/system/jquery', 'ember-testing/test', 'ember-runtime/ext/rsvp', 'ember-metal/features'], function (exports, _emberMetalProperty_get, _emberMetalError, _emberMetalRun_loop, _emberViewsSystemJquery, _emberTestingTest, _emberRuntimeExtRsvp, _emberMetalFeatures) {
'use strict';
/**
@module ember
@submodule ember-testing
*/
var helper = _emberTestingTest.default.registerHelper;
var asyncHelper = _emberTestingTest.default.registerAsyncHelper;
- function currentRouteName(app) {
- var appController = app.__container__.lookup('controller:application');
+ var keyboardEventTypes, mouseEventTypes, buildKeyboardEvent, buildMouseEvent, buildBasicEvent, fireEvent, focus;
- return _emberMetalProperty_get.get(appController, 'currentRouteName');
- }
+ var defaultEventOptions = { canBubble: true, cancelable: true };
+ keyboardEventTypes = ['keydown', 'keypress', 'keyup'];
+ mouseEventTypes = ['click', 'mousedown', 'mouseup', 'dblclick', 'mousenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover'];
- function currentPath(app) {
- var appController = app.__container__.lookup('controller:application');
+ buildKeyboardEvent = function buildKeyboardEvent(type) {
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
- return _emberMetalProperty_get.get(appController, 'currentPath');
- }
+ var event = undefined;
+ try {
+ event = document.createEvent('KeyEvents');
+ var eventOpts = _emberViewsSystemJquery.default.extend({}, defaultEventOptions, options);
+ event.initKeyEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.keyCode, eventOpts.charCode);
+ } catch (e) {
+ event = buildBasicEvent(type, options);
+ }
+ return event;
+ };
- function currentURL(app) {
- var router = app.__container__.lookup('router:main');
+ buildMouseEvent = function buildMouseEvent(type) {
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
- return _emberMetalProperty_get.get(router, 'location').getURL();
- }
+ var event = undefined;
+ try {
+ event = document.createEvent('MouseEvents');
+ var eventOpts = _emberViewsSystemJquery.default.extend({}, defaultEventOptions, options);
+ event.initMouseEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.detail, eventOpts.screenX, eventOpts.screenY, eventOpts.clientX, eventOpts.clientY, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.button, eventOpts.relatedTarget);
+ } catch (e) {
+ event = buildBasicEvent(type, options);
+ }
+ return event;
+ };
- function pauseTest() {
- _emberTestingTest.default.adapter.asyncStart();
- return new _emberRuntimeExtRsvp.default.Promise(function () {}, 'TestAdapter paused promise');
- }
+ buildBasicEvent = function buildBasicEvent(type) {
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
- function focus(el) {
- if (el && el.is(':input, [contenteditable=true]')) {
- var type = el.prop('type');
+ var event = document.createEvent('Events');
+ event.initEvent(type, true, true);
+ _emberViewsSystemJquery.default.extend(event, options);
+ return event;
+ };
+
+ fireEvent = function fireEvent(element, type) {
+ var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
+
+ if (!element) {
+ return;
+ }
+ var event = undefined;
+ if (keyboardEventTypes.indexOf(type) > -1) {
+ event = buildKeyboardEvent(type, options);
+ } else if (mouseEventTypes.indexOf(type) > -1) {
+ var rect = element.getBoundingClientRect();
+ var x = rect.left + 1;
+ var y = rect.top + 1;
+ var simulatedCoordinates = {
+ screenX: x + 5,
+ screenY: y + 95,
+ clientX: x,
+ clientY: y
+ };
+ event = buildMouseEvent(type, _emberViewsSystemJquery.default.extend(simulatedCoordinates, options));
+ } else {
+ event = buildBasicEvent(type, options);
+ }
+ element.dispatchEvent(event);
+ };
+
+ focus = function focus(el) {
+ if (!el) {
+ return;
+ }
+ var $el = _emberViewsSystemJquery.default(el);
+ if ($el.is(':input, [contenteditable=true]')) {
+ var type = $el.prop('type');
if (type !== 'checkbox' && type !== 'radio' && type !== 'hidden') {
- _emberMetalRun_loop.default(el, function () {
+ _emberMetalRun_loop.default(null, function () {
// Firefox does not trigger the `focusin` event if the window
// does not have focus. If the document doesn't have focus just
// use trigger('focusin') instead.
+
if (!document.hasFocus || document.hasFocus()) {
- this.focus();
+ el.focus();
} else {
- this.trigger('focusin');
+ $el.trigger('focusin');
}
});
}
}
+ };
+
+ function currentRouteName(app) {
+ var routingService = app.__container__.lookup('service:-routing');
+
+ return _emberMetalProperty_get.get(routingService, 'currentRouteName');
}
+ function currentPath(app) {
+ var routingService = app.__container__.lookup('service:-routing');
+
+ return _emberMetalProperty_get.get(routingService, 'currentPath');
+ }
+
+ function currentURL(app) {
+ var router = app.__container__.lookup('router:main');
+
+ return _emberMetalProperty_get.get(router, 'location').getURL();
+ }
+
+ function pauseTest() {
+ _emberTestingTest.default.adapter.asyncStart();
+ return new _emberRuntimeExtRsvp.default.Promise(function () {}, 'TestAdapter paused promise');
+ }
+
function visit(app, url) {
var router = app.__container__.lookup('router:main');
var shouldHandleURL = false;
app.boot().then(function () {
@@ -40228,17 +40200,19 @@
return app.testHelpers.wait();
}
function click(app, selector, context) {
var $el = app.testHelpers.findWithAssert(selector, context);
- _emberMetalRun_loop.default($el, 'mousedown');
+ var el = $el[0];
- focus($el);
+ _emberMetalRun_loop.default(null, fireEvent, el, 'mousedown');
- _emberMetalRun_loop.default($el, 'mouseup');
- _emberMetalRun_loop.default($el, 'click');
+ focus(el);
+ _emberMetalRun_loop.default(null, fireEvent, el, 'mouseup');
+ _emberMetalRun_loop.default(null, fireEvent, el, 'click');
+
return app.testHelpers.wait();
}
function triggerEvent(app, selector, contextOrType, typeOrOptions, possibleOptions) {
var arity = arguments.length;
@@ -40270,15 +40244,14 @@
type = typeOrOptions;
options = possibleOptions;
}
var $el = app.testHelpers.findWithAssert(selector, context);
+ var el = $el[0];
- var event = _emberViewsSystemJquery.default.Event(type, options);
+ _emberMetalRun_loop.default(null, fireEvent, el, type, options);
- _emberMetalRun_loop.default($el, 'trigger', event);
-
return app.testHelpers.wait();
}
function keyEvent(app, selector, contextOrType, typeOrKeyCode, keyCode) {
var context, type;
@@ -40294,22 +40267,23 @@
return app.testHelpers.triggerEvent(selector, context, type, { keyCode: keyCode, which: keyCode });
}
function fillIn(app, selector, contextOrText, text) {
- var $el, context;
+ var $el, el, context;
if (typeof text === 'undefined') {
text = contextOrText;
} else {
context = contextOrText;
}
$el = app.testHelpers.findWithAssert(selector, context);
- focus($el);
+ el = $el[0];
+ focus(el);
_emberMetalRun_loop.default(function () {
$el.val(text);
- $el.trigger('input');
- $el.change();
+ fireEvent(el, 'input');
+ fireEvent(el, 'change');
});
return app.testHelpers.wait();
}
function findWithAssert(app, selector, context) {
@@ -40332,14 +40306,14 @@
return app.testHelpers.wait(callback(app));
}
function wait(app, value) {
return new _emberRuntimeExtRsvp.default.Promise(function (resolve) {
+ var router = app.__container__.lookup('router:main');
+
// Every 10ms, poll for the async thing to have finished
var watcher = setInterval(function () {
- var router = app.__container__.lookup('router:main');
-
// 1. If the router is loading, keep polling
var routerIsLoading = router.router && !!router.router.activeTransition;
if (routerIsLoading) {
return;
}
@@ -40616,10 +40590,14 @@
@since 1.5.0
@public
*/
asyncHelper('triggerEvent', triggerEvent);
});
+
+// Firefox does not trigger the `focusin` event if the window
+// does not have focus. If the document doesn't have focus just
+// use trigger('focusin') instead.
enifed('ember-testing/index', ['exports', 'ember-metal/core', 'ember-testing/initializers', 'ember-testing/support', 'ember-testing/setup_for_testing', 'ember-testing/test', 'ember-testing/adapters/adapter', 'ember-testing/adapters/qunit', 'ember-testing/helpers'], function (exports, _emberMetalCore, _emberTestingInitializers, _emberTestingSupport, _emberTestingSetup_for_testing, _emberTestingTest, _emberTestingAdaptersAdapter, _emberTestingAdaptersQunit, _emberTestingHelpers) {
'use strict';
// adds helpers to helpers object in Test
@@ -41513,11 +41491,10 @@
requirement in web components.
@class Component
@namespace Ember
@extends Ember.View
- @uses Ember.ViewTargetActionSupport
@public
*/
var Component = _emberViewsViewsView.default.extend(_emberRuntimeMixinsTarget_action_support.default, {
isComponent: true,
/*
@@ -41840,119 +41817,19 @@
@static
@public
@property positionalParams
@since 1.13.0
*/
-
- /**
- Called when the attributes passed into the component have been updated.
- Called both during the initial render of a container and during a rerender.
- Can be used in place of an observer; code placed here will be executed
- every time any attribute updates.
- @method didReceiveAttrs
- @public
- @since 1.13.0
- */
-
- /**
- Called when the attributes passed into the component have been updated.
- Called both during the initial render of a container and during a rerender.
- Can be used in place of an observer; code placed here will be executed
- every time any attribute updates.
- @event didReceiveAttrs
- @public
- @since 1.13.0
- */
-
- /**
- Called after a component has been rendered, both on initial render and
- in subsequent rerenders.
- @method didRender
- @public
- @since 1.13.0
- */
-
- /**
- Called after a component has been rendered, both on initial render and
- in subsequent rerenders.
- @event didRender
- @public
- @since 1.13.0
- */
-
- /**
- Called before a component has been rendered, both on initial render and
- in subsequent rerenders.
- @method willRender
- @public
- @since 1.13.0
- */
-
- /**
- Called before a component has been rendered, both on initial render and
- in subsequent rerenders.
- @event willRender
- @public
- @since 1.13.0
- */
-
- /**
- Called when the attributes passed into the component have been changed.
- Called only during a rerender, not during an initial render.
- @method didUpdateAttrs
- @public
- @since 1.13.0
- */
-
- /**
- Called when the attributes passed into the component have been changed.
- Called only during a rerender, not during an initial render.
- @event didUpdateAttrs
- @public
- @since 1.13.0
- */
-
- /**
- Called when the component is about to update and rerender itself.
- Called only during a rerender, not during an initial render.
- @method willUpdate
- @public
- @since 1.13.0
- */
-
- /**
- Called when the component is about to update and rerender itself.
- Called only during a rerender, not during an initial render.
- @event willUpdate
- @public
- @since 1.13.0
- */
-
- /**
- Called when the component has updated and rerendered itself.
- Called only during a rerender, not during an initial render.
- @event didUpdate
- @public
- @since 1.13.0
- */
-
- /**
- Called when the component has updated and rerendered itself.
- Called only during a rerender, not during an initial render.
- @event didUpdate
- @public
- @since 1.13.0
- */
});
Component.reopenClass({
isComponentFactory: true
});
exports.default = Component;
});
-enifed('ember-views/index', ['exports', 'ember-runtime', 'ember-views/system/jquery', 'ember-views/system/utils', 'ember-views/system/ext', 'ember-views/views/states', 'ember-metal-views/renderer', 'ember-views/views/core_view', 'ember-views/views/view', 'ember-views/views/container_view', 'ember-views/views/collection_view', 'ember-views/components/component', 'ember-views/system/event_dispatcher', 'ember-views/mixins/view_target_action_support', 'ember-views/component_lookup', 'ember-views/views/checkbox', 'ember-views/mixins/text_support', 'ember-views/views/text_field', 'ember-views/views/text_area', 'ember-views/views/select', 'ember-views/compat/metamorph_view', 'ember-views/views/legacy_each_view'], function (exports, _emberRuntime, _emberViewsSystemJquery, _emberViewsSystemUtils, _emberViewsSystemExt, _emberViewsViewsStates, _emberMetalViewsRenderer, _emberViewsViewsCore_view, _emberViewsViewsView, _emberViewsViewsContainer_view, _emberViewsViewsCollection_view, _emberViewsComponentsComponent, _emberViewsSystemEvent_dispatcher, _emberViewsMixinsView_target_action_support, _emberViewsComponent_lookup, _emberViewsViewsCheckbox, _emberViewsMixinsText_support, _emberViewsViewsText_field, _emberViewsViewsText_area, _emberViewsViewsSelect, _emberViewsCompatMetamorph_view, _emberViewsViewsLegacy_each_view) {
+enifed('ember-views/index', ['exports', 'ember-runtime', 'ember-views/system/jquery', 'ember-views/system/utils', 'ember-views/system/ext', 'ember-views/views/states', 'ember-metal-views', 'ember-views/views/core_view', 'ember-views/views/view', 'ember-views/views/container_view', 'ember-views/views/collection_view', 'ember-views/components/component', 'ember-views/system/event_dispatcher', 'ember-views/mixins/view_target_action_support', 'ember-views/component_lookup', 'ember-views/views/checkbox', 'ember-views/mixins/text_support', 'ember-views/views/text_field', 'ember-views/views/text_area', 'ember-views/views/select', 'ember-views/compat/metamorph_view', 'ember-views/views/legacy_each_view'], function (exports, _emberRuntime, _emberViewsSystemJquery, _emberViewsSystemUtils, _emberViewsSystemExt, _emberViewsViewsStates, _emberMetalViews, _emberViewsViewsCore_view, _emberViewsViewsView, _emberViewsViewsContainer_view, _emberViewsViewsCollection_view, _emberViewsComponentsComponent, _emberViewsSystemEvent_dispatcher, _emberViewsMixinsView_target_action_support, _emberViewsComponent_lookup, _emberViewsViewsCheckbox, _emberViewsMixinsText_support, _emberViewsViewsText_field, _emberViewsViewsText_area, _emberViewsViewsSelect, _emberViewsCompatMetamorph_view, _emberViewsViewsLegacy_each_view) {
/**
@module ember
@submodule ember-views
*/
@@ -41982,16 +41859,16 @@
if (_emberRuntime.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT) {
_emberRuntime.default.CoreView = _emberViewsViewsCore_view.DeprecatedCoreView;
_emberRuntime.default.View = _emberViewsViewsView.DeprecatedView;
_emberRuntime.default.View.states = _emberViewsViewsStates.states;
_emberRuntime.default.View.cloneStates = _emberViewsViewsStates.cloneStates;
- _emberRuntime.default.View._Renderer = _emberMetalViewsRenderer.default;
+ _emberRuntime.default.View._Renderer = _emberMetalViews.Renderer;
_emberRuntime.default.ContainerView = _emberViewsViewsContainer_view.DeprecatedContainerView;
_emberRuntime.default.CollectionView = _emberViewsViewsCollection_view.default;
}
- _emberRuntime.default._Renderer = _emberMetalViewsRenderer.default;
+ _emberRuntime.default._Renderer = _emberMetalViews.Renderer;
_emberRuntime.default.Checkbox = _emberViewsViewsCheckbox.default;
_emberRuntime.default.TextField = _emberViewsViewsText_field.default;
_emberRuntime.default.TextArea = _emberViewsViewsText_area.default;
@@ -42788,22 +42665,23 @@
@param {Class|String} viewClass
@param {Object} [attrs] Attributes to add
@return {Ember.View} new instance
@private
*/
- createChildView: function (maybeViewClass, _attrs) {
+ createChildView: function (maybeViewClass) {
+ var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+
if (!maybeViewClass) {
throw new TypeError('createChildViews first argument must exist');
}
var owner = _containerOwner.getOwner(this);
if (maybeViewClass.isView && maybeViewClass.parentView === this && _containerOwner.getOwner(maybeViewClass) === owner) {
return maybeViewClass;
}
- var attrs = _attrs || {};
var view;
attrs.parentView = this;
attrs.renderer = this.renderer;
attrs._viewRegistry = this._viewRegistry;
@@ -45384,11 +45262,11 @@
exports.DeprecatedCollectionView = DeprecatedCollectionView;
});
enifed('ember-views/views/container_view', ['exports', 'ember-metal/core', 'ember-metal/debug', 'ember-runtime/mixins/mutable_array', 'ember-runtime/system/native_array', 'ember-views/views/view', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/mixin', 'ember-metal/events', 'ember-htmlbars/templates/container-view'], function (exports, _emberMetalCore, _emberMetalDebug, _emberRuntimeMixinsMutable_array, _emberRuntimeSystemNative_array, _emberViewsViewsView, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberMetalEvents, _emberHtmlbarsTemplatesContainerView) {
'use strict';
- _emberHtmlbarsTemplatesContainerView.default.meta.revision = 'Ember@2.4.6';
+ _emberHtmlbarsTemplatesContainerView.default.meta.revision = 'Ember@2.5.0-beta.1';
/**
@module ember
@submodule ember-views
*/
@@ -45709,11 +45587,11 @@
return this;
};
exports.default = ContainerView;
});
-enifed('ember-views/views/core_view', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-runtime/system/object', 'ember-runtime/mixins/evented', 'ember-runtime/mixins/action_handler', 'ember-runtime/utils', 'ember-metal-views/renderer', 'ember-views/views/states', 'htmlbars-runtime', 'require'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented, _emberRuntimeMixinsAction_handler, _emberRuntimeUtils, _emberMetalViewsRenderer, _emberViewsViewsStates, _htmlbarsRuntime, _require) {
+enifed('ember-views/views/core_view', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-runtime/system/object', 'ember-runtime/mixins/evented', 'ember-runtime/mixins/action_handler', 'ember-runtime/utils', 'ember-metal-views', 'ember-views/views/states', 'htmlbars-runtime', 'require'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented, _emberRuntimeMixinsAction_handler, _emberRuntimeUtils, _emberMetalViews, _emberViewsViewsStates, _htmlbarsRuntime, _require) {
'use strict';
function K() {
return this;
}
@@ -45754,11 +45632,11 @@
// Fallback for legacy cases where the view was created directly
// via `create()` instead of going through the container.
if (!this.renderer) {
var DOMHelper = domHelper();
- renderer = renderer || new _emberMetalViewsRenderer.default(new DOMHelper());
+ renderer = renderer || new _emberMetalViews.Renderer(new DOMHelper());
this.renderer = renderer;
}
this._destroyingSubtreeForView = null;
this._dispatching = null;
@@ -46615,11 +46493,11 @@
}
});
exports.default = destroying;
});
-enifed('ember-views/views/states/has_element', ['exports', 'ember-views/views/states/default', 'ember-metal/assign', 'ember-views/system/jquery', 'ember-metal/run_loop', 'ember-metal/property_get', 'htmlbars-runtime'], function (exports, _emberViewsViewsStatesDefault, _emberMetalAssign, _emberViewsSystemJquery, _emberMetalRun_loop, _emberMetalProperty_get, _htmlbarsRuntime) {
+enifed('ember-views/views/states/has_element', ['exports', 'ember-views/views/states/default', 'ember-metal/assign', 'ember-views/system/jquery', 'ember-metal/run_loop', 'ember-metal/property_get'], function (exports, _emberViewsViewsStatesDefault, _emberMetalAssign, _emberViewsSystemJquery, _emberMetalRun_loop, _emberMetalProperty_get) {
'use strict';
var hasElement = Object.create(_emberViewsViewsStatesDefault.default);
_emberMetalAssign.default(hasElement, {
@@ -46641,22 +46519,11 @@
// once the view has been inserted into the DOM, rerendering is
// deferred to allow bindings to synchronize.
rerender: function (view) {
view.renderer.ensureViewNotRendering(view);
-
- var renderNode = view._renderNode;
-
- renderNode.isDirty = true;
- _htmlbarsRuntime.internal.visitChildren(renderNode.childNodes, function (node) {
- if (node.getState().manager) {
- node.shouldReceiveAttrs = true;
- }
- node.isDirty = true;
- });
-
- renderNode.ownerNode.emberView.scheduleRevalidate(renderNode, view.toString(), 'rerendering');
+ view.renderer.rerender(view);
},
cleanup: function (view) {
view._currentState.destroyElement(view);
},
@@ -47193,24 +47060,25 @@
```html
<use xlink:href="#triangle"></use>
```
If the return value of an `attributeBindings` monitored property is a boolean
- the property's value will be set as a coerced string:
+ the property will follow HTML's pattern of repeating the attribute's name as
+ its value:
```javascript
MyTextInput = Ember.View.extend({
tagName: 'input',
attributeBindings: ['disabled'],
- disabled: false
+ disabled: true
});
```
- Will result in a view instance with an HTML representation of:
+ Will result in view instances with an HTML representation of:
```html
- <input id="ember1" class="ember-view" disabled="false" />
+ <input id="ember1" class="ember-view" disabled="disabled" />
```
`attributeBindings` can refer to computed properties:
```javascript
@@ -47225,21 +47093,10 @@
}
})
});
```
- To prevent setting an attribute altogether, use `null` or `undefined` as the
- return value of the `attributeBindings` monitored property:
-
- ```javascript
- MyTextInput = Ember.View.extend({
- tagName: 'form',
- attributeBindings: ['novalidate'],
- novalidate: null
- });
- ```
-
Updates to the property of an attribute binding will result in automatic
update of the HTML attribute in the view's rendered HTML representation.
`attributeBindings` is a concatenated property. See [Ember.Object](/api/classes/Ember.Object.html)
documentation for more information about concatenated properties.
@@ -47564,11 +47421,10 @@
@class View
@namespace Ember
@extends Ember.CoreView
@deprecated See http://emberjs.com/deprecations/v1.x/#toc_ember-view
- @uses Ember.ViewSupport
@uses Ember.ViewContextSupport
@uses Ember.ViewChildViewsSupport
@uses Ember.TemplateRenderingSupport
@uses Ember.ClassNamesSupport
@uses Ember.AttributeBindingsSupport
@@ -54941,10 +54797,12 @@
enifed('rsvp/node', ['exports', 'rsvp/promise', 'rsvp/-internal', 'rsvp/utils'], function (exports, _rsvpPromise, _rsvpInternal, _rsvpUtils) {
'use strict';
exports.default = denodeify;
+ function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
+
function Result() {
this.value = undefined;
}
var ERROR = new Result();
@@ -55171,10 +55029,10 @@
} else {
return handleValueInput(promise, args, nodeFunc, self);
}
};
- fn.__proto__ = nodeFunc;
+ _defaults(fn, nodeFunc);
return fn;
}
function handleValueInput(promise, args, nodeFunc, self) {