dist/ember.debug.js in ember-source-2.2.0.beta.1 vs dist/ember.debug.js in ember-source-2.2.0

- old
+ new

@@ -4,11 +4,11 @@ * @copyright Copyright 2011-2015 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.2.0-beta.1 + * @version 2.2.0 */ var enifed, requireModule, require, requirejs, Ember; var mainContext = this; @@ -4469,10 +4469,15 @@ initializer.initialize(App); } }); }, + /** + @private + @since 1.12.0 + @method runInstanceInitializers + */ runInstanceInitializers: function (instance) { this._runInitializer('instanceInitializers', function (name, initializer) { _emberMetalDebug.assert('No instance initializer named \'' + name + '\'', !!initializer); initializer.initialize(instance); }); @@ -5693,10 +5698,15 @@ exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; var missingOptionsUntilDeprecation = 'When calling `Ember.deprecate` you must provide `until` in options.'; exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation; /** + @module ember + @submodule ember-debug + */ + + /** Display a deprecation warning with the provided message and a stack trace (Chrome and Firefox only). Ember build tools will remove any calls to `Ember.deprecate()` when doing a production build. @method deprecate @@ -5706,10 +5716,11 @@ @param {Object} options An object that can be used to pass in a `url` to the transition guide on the emberjs.com website, and a unique `id` for this deprecation. The `id` can be used by Ember debugging tools to change the behavior (raise, log or silence) for that specific deprecation. The `id` should be namespaced by dots, e.g. "view.helper.select". + @for Ember @public */ function deprecate(message, test, options) { if (!options || !options.id && !options.until) { @@ -5818,17 +5829,27 @@ exports.missingOptionsDeprecation = missingOptionsDeprecation; var missingOptionsIdDeprecation = 'When calling `Ember.warn` you must provide `id` in options.'; exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; /** + @module ember + @submodule ember-debug + */ + + /** Display a warning with the provided message. Ember build tools will remove any calls to `Ember.warn()` when doing a production 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 + `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 */ function warn(message, test, options) { if (!options) { @@ -6010,11 +6031,13 @@ _emberMetalDebug.setDebugFunction('debugSeal', function debugSeal(obj) { Object.seal(obj); }); _emberMetalDebug.setDebugFunction('deprecate', _emberDebugDeprecate.default); + _emberMetalDebug.setDebugFunction('warn', _emberDebugWarn.default); + /** Will call `Ember.warn()` if ENABLE_ALL_FEATURES, ENABLE_OPTIONAL_FEATURES, or any specific FEATURES flag is truthy. This method is called automatically in debug canary builds. @@ -6098,10 +6121,11 @@ </ul> @public @static @method registerDeprecationHandler @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. Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn). @@ -6122,10 +6146,11 @@ </ul> @public @static @method registerWarnHandler @param handler {Function} a function to handle warnings + @since 2.1.0 */ _emberMetalCore.default.Debug.registerWarnHandler = _emberDebugWarn.registerHandler; /* We are transitioning away from `ember.js` to `ember.debug.js` to make @@ -6894,10 +6919,11 @@ Additionally, class helpers can call `recompute` to force a new computation. @class Ember.Helper @public + @since 1.13.0 */ var Helper = _emberRuntimeSystemObject.default.extend({ isHelperInstance: true, /** @@ -6917,10 +6943,11 @@ } }); ``` @method recompute @public + @since 1.13.0 */ recompute: function () { this._stream.notify(); } @@ -6928,10 +6955,11 @@ Override this function when writing a class-based helper. @method compute @param {Array} params The positional arguments to the helper @param {Object} hash The named arguments to the helper @public + @since 1.13.0 */ }); Helper.reopenClass({ isHelperFactory: true @@ -6953,10 +6981,11 @@ @static @param {Function} helper The helper function @method helper @public + @since 1.13.0 */ function helper(helperFn) { return { isHelperInstance: true, @@ -6984,10 +7013,11 @@ ``` @public @method concat @for Ember.Templates.helpers + @since 1.13.0 */ 'use strict'; exports.default = concat; @@ -7106,13 +7136,13 @@ } function bindKeyword(self, keyword, item) { var _ref; - return (_ref = { + return _ref = { self: self - }, _ref[keyword] = item, _ref); + }, _ref[keyword] = item, _ref; } var deprecation = 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each items as |item|}}`) instead.'; exports.deprecation = deprecation; }); @@ -7205,10 +7235,11 @@ Outputting their name and age. @method each-in @for Ember.Templates.helpers @public + @since 2.1.0 */ var eachInHelper = function (_ref, hash, blocks) { var object = _ref[0]; var objKeys, prop, i; @@ -8331,11 +8362,11 @@ if (self) { return self.getKey(key); } var attrs = scope.getAttrs(); - if (key in attrs) { + if (attrs && key in attrs) { // TODO: attrs // deprecate("You accessed the `" + key + "` attribute directly. Please use `attrs." + key + "` instead."); return attrs[key]; } } @@ -8734,22 +8765,22 @@ var positionalParams = componentCell[COMPONENT_POSITIONAL_PARAMS]; // This needs to be done in each nesting level to avoid raising assertions _emberHtmlbarsUtilsExtractPositionalParams.processPositionalParams(null, positionalParams, params, hash); - return (_ref = {}, _ref[COMPONENT_PATH] = componentCell[COMPONENT_PATH], _ref[COMPONENT_HASH] = mergeHash(componentCell[COMPONENT_HASH], hash), _ref[COMPONENT_POSITIONAL_PARAMS] = positionalParams, _ref[COMPONENT_CELL] = true, _ref); + return _ref = {}, _ref[COMPONENT_PATH] = componentCell[COMPONENT_PATH], _ref[COMPONENT_HASH] = mergeHash(componentCell[COMPONENT_HASH], hash), _ref[COMPONENT_POSITIONAL_PARAMS] = positionalParams, _ref[COMPONENT_CELL] = true, _ref; } function createNewClosureComponentCell(env, componentPath, params, hash) { var _ref2; var positionalParams = getPositionalParams(env.container, componentPath); // 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); + return _ref2 = {}, _ref2[COMPONENT_PATH] = componentPath, _ref2[COMPONENT_HASH] = hash, _ref2[COMPONENT_POSITIONAL_PARAMS] = positionalParams, _ref2[COMPONENT_CELL] = true, _ref2; } /* Returns the positional parameters for component `componentPath`. If it has no positional parameters, it returns the empty array. @@ -9334,10 +9365,11 @@ that fact via a two-way mutable binding. @public @method get @for Ember.Templates.helpers + @since 2.1.0 */ function getKeyword(morph, env, scope, params, hash, template, inverse, visitor) { if (morph === null) { return buildStream(params); } else { @@ -9704,11 +9736,11 @@ @submodule ember-templates */ 'use strict'; - _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.2.0-beta.1'; + _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.2.0'; /** The `{{outlet}}` helper lets you specify where a child routes will render in your template. An important use of the `{{outlet}}` helper is in your application's `application.hbs` file: @@ -11572,12 +11604,12 @@ 'use strict'; exports.buildHelperStream = buildHelperStream; function buildHelperStream(helper, params, hash, templates, env, scope, label) { - _emberMetalDebug.assert('Helpers may not be used in the block form, for example {{#my-helper}}{{/my-helper}}. Please use a component, or alternatively use the helper in combination with a built-in Ember helper, for example {{#if (my-helper)}}{{/if}}.', !(helper.isHelperInstance && !helper.isHelperFactory) || (!templates || !templates.template || !templates.template.meta)); - _emberMetalDebug.assert('Helpers may not be used in the element form, for example <div {{my-helper}}>.', !(helper.isHelperInstance && !helper.isHelperFactory) || (!templates || !templates.element)); + _emberMetalDebug.assert('Helpers may not be used in the block form, for example {{#my-helper}}{{/my-helper}}. Please use a component, or alternatively use the helper in combination with a built-in Ember helper, for example {{#if (my-helper)}}{{/if}}.', !(helper.isHelperInstance && !helper.isHelperFactory) || !templates || !templates.template || !templates.template.meta); + _emberMetalDebug.assert('Helpers may not be used in the element form, for example <div {{my-helper}}>.', !(helper.isHelperInstance && !helper.isHelperFactory) || !templates || !templates.element); if (helper.isHelperFactory) { return new _emberHtmlbarsStreamsHelperFactory.default(helper, params, hash, label); } else if (helper.isHelperInstance) { return new _emberHtmlbarsStreamsHelperInstance.default(helper, params, hash, label); } else { @@ -12674,12 +12706,19 @@ attrs[positionalParams[i]] = param; } } function processRestPositionalParameters(renderNode, positionalParamsName, params, attrs) { + var nameInAttrs = (positionalParamsName in attrs); + + // when no params are used, do not override the specified `attrs.stringParamName` value + if (params.length === 0 && nameInAttrs) { + return; + } + // If there is already an attribute for that variable, do nothing - _emberMetalDebug.assert('You cannot specify positional parameters and the hash argument `' + positionalParamsName + '`.', !(positionalParamsName in attrs)); + _emberMetalDebug.assert('You cannot specify positional parameters and the hash argument `' + positionalParamsName + '`.', !nameInAttrs); var paramsStream = new _emberMetalStreamsStream.Stream(function () { return _emberMetalStreamsUtils.readArray(params.slice(0)); }, 'params'); @@ -12780,14 +12819,12 @@ @return {Handlebars.SafeString} a string that will not be html escaped by Handlebars @public */ function htmlSafe(str) { if (str === null || str === undefined) { - return ''; - } - - if (typeof str !== 'string') { + str = ''; + } else if (typeof str !== 'string') { str = '' + str; } return new _htmlbarsUtil.SafeString(str); } @@ -14887,11 +14924,11 @@ } /** A computed property which matches the original value for the dependent property against a given RegExp, returning `true` - if they values matches the RegExp and `false` if it does not. + if the value matches the RegExp and `false` if it does not. Example ```javascript var User = Ember.Object.extend({ @@ -15388,11 +15425,11 @@ cross-platform libraries such as jQuery. For more details, see [Ember-Runtime](http://emberjs.com/api/modules/ember-runtime.html). @class Ember @static - @version 2.2.0-beta.1 + @version 2.2.0 @public */ 'use strict'; @@ -15432,15 +15469,15 @@ /** The semantic version. @property VERSION @type String - @default '2.2.0-beta.1' + @default '2.2.0' @static @public */ - Ember.VERSION = '2.2.0-beta.1'; + Ember.VERSION = '2.2.0'; /** The hash of environment variables used to control various configuration settings. To specify your own or override default settings, add the desired properties to a global hash named `EmberENV` (or `ENV` for @@ -15779,20 +15816,22 @@ if (hasDOM) { environment = { hasDOM: true, isChrome: !!window.chrome && !window.opera, isFirefox: typeof InstallTrigger !== 'undefined', + isPhantom: !!window.callPhantom, location: window.location, history: window.history, userAgent: window.navigator.userAgent, global: window }; } else { environment = { hasDOM: false, isChrome: false, isFirefox: false, + isPhantom: false, location: null, history: null, userAgent: 'Lynx (textmode)', global: null }; @@ -16750,11 +16789,11 @@ Ember.isNone(); // true Ember.isNone(null); // true Ember.isNone(undefined); // true Ember.isNone(''); // false Ember.isNone([]); // false - Ember.isNone(function() {}); // false + Ember.isNone(function() {}); // false ``` @method isNone @for Ember @param {Object} obj Value to test @@ -16779,16 +16818,16 @@ ```javascript Ember.isPresent(); // false Ember.isPresent(null); // false Ember.isPresent(undefined); // false - Ember.isPresent(false); // false Ember.isPresent(''); // false Ember.isPresent([]); // false Ember.isPresent('\n\t'); // false Ember.isPresent(' '); // false Ember.isPresent({}); // true + Ember.isPresent(false); // true Ember.isPresent('\n\t Hello'); // true Ember.isPresent('Hello world'); // true Ember.isPresent([1,2,3]); // true ``` @@ -16802,63 +16841,10 @@ function isPresent(obj) { return !_emberMetalIs_blank.default(obj); } }); -enifed('ember-metal/keys', ['exports'], function (exports) { - /** - Returns all of the keys defined on an object or hash. This is useful - when inspecting objects for debugging. On browsers that support it, this - uses the native `Object.keys` implementation. - - @method keys - @for Ember - @param {Object} obj - @return {Array} Array containing keys of obj - @private - */ - 'use strict'; - - var keys = Object.keys; - - if (!keys) { - // modified from - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys - keys = (function () { - var hasOwnProperty = Object.prototype.hasOwnProperty; - var hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'); - var dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor']; - var dontEnumsLength = dontEnums.length; - - return function keys(obj) { - if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { - throw new TypeError('Object.keys called on non-object'); - } - - var result = []; - var prop, i; - - for (prop in obj) { - if (prop !== '_super' && prop.lastIndexOf('__', 0) !== 0 && hasOwnProperty.call(obj, prop)) { - result.push(prop); - } - } - - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); - } - } - } - return result; - }; - })(); - } - - exports.default = keys; -}); enifed('ember-metal/libraries', ['exports', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalDebug, _emberMetalFeatures) { 'use strict'; /** Helper class that allows you to register your library with Ember. @@ -22009,11 +21995,11 @@ var HAS_SUPER_PATTERN = /\.(_super|call\(this|apply\(this)/; var checkHasSuper = (function () { var sourceAvailable = (function () { return this; - }).toString().indexOf('return this;') > -1; + }).toString().indexOf('return this') > -1; if (sourceAvailable) { return function checkHasSuper(func) { return HAS_SUPER_PATTERN.test(func.toString()); }; @@ -22022,10 +22008,11 @@ return function checkHasSuper() { return true; }; })(); + exports.checkHasSuper = checkHasSuper; function ROOT() {} ROOT.__hasSuper = false; function hasSuper(func) { if (func.__hasSuper === undefined) { @@ -27762,13 +27749,15 @@ /** @module ember @submodule ember-routing */ -enifed('ember-routing/system/router_state', ['exports', 'ember-metal/is_empty', 'ember-metal/keys', 'ember-runtime/system/object', 'ember-metal/assign'], function (exports, _emberMetalIs_empty, _emberMetalKeys, _emberRuntimeSystemObject, _emberMetalAssign) { +enifed('ember-routing/system/router_state', ['exports', 'ember-metal/is_empty', 'ember-runtime/system/object', 'ember-metal/assign'], function (exports, _emberMetalIs_empty, _emberRuntimeSystemObject, _emberMetalAssign) { 'use strict'; + var keys = Object.keys; + var RouterState = _emberRuntimeSystemObject.default.extend({ emberRouter: null, routerJs: null, routerJsState: null, @@ -27776,11 +27765,11 @@ var state = this.routerJsState; if (!this.routerJs.isActiveIntent(routeName, models, null, state)) { return false; } - var emptyQueryParams = _emberMetalIs_empty.default(_emberMetalKeys.default(queryParams)); + var emptyQueryParams = _emberMetalIs_empty.default(keys(queryParams)); if (queryParamsMustMatch && !emptyQueryParams) { var visibleQueryParams = {}; _emberMetalAssign.default(visibleQueryParams, queryParams); @@ -28079,11 +28068,11 @@ Here is an example action handler on a component: ```js export default Ember.Component.extend({ actions: { - save(/* event *\/) { + save() { this.get('model').save(); } } }); ``` @@ -28268,11 +28257,11 @@ } return _emberRoutingHtmlbarsKeywordsClosureAction.default(morph, env, scope, params, hash, template, inverse, visitor); }; }); -enifed('ember-routing-htmlbars/keywords/closure-action', ['exports', 'ember-metal/streams/stream', 'ember-metal/streams/utils', 'ember-metal/utils', 'ember-metal/property_get', 'ember-htmlbars/hooks/subexpr', 'ember-metal/error'], function (exports, _emberMetalStreamsStream, _emberMetalStreamsUtils, _emberMetalUtils, _emberMetalProperty_get, _emberHtmlbarsHooksSubexpr, _emberMetalError) { +enifed('ember-routing-htmlbars/keywords/closure-action', ['exports', 'ember-metal/streams/stream', 'ember-metal/streams/utils', 'ember-metal/utils', 'ember-metal/property_get', 'ember-htmlbars/hooks/subexpr', 'ember-metal/error', 'ember-metal/run_loop'], function (exports, _emberMetalStreamsStream, _emberMetalStreamsUtils, _emberMetalUtils, _emberMetalProperty_get, _emberHtmlbarsHooksSubexpr, _emberMetalError, _emberMetalRun_loop) { 'use strict'; exports.default = closureAction; var INVOKE = _emberMetalUtils.symbol('INVOKE'); exports.INVOKE = INVOKE; @@ -28341,27 +28330,35 @@ var closureAction; if (actionArguments.length > 0) { closureAction = function () { var args = actionArguments; - if (arguments.length > 0) { - var passedArguments = Array.prototype.slice.apply(arguments); + + for (var _len = arguments.length, passedArguments = Array(_len), _key = 0; _key < _len; _key++) { + passedArguments[_key] = arguments[_key]; + } + + if (passedArguments.length > 0) { args = actionArguments.concat(passedArguments); } if (valuePath && args.length > 0) { args[0] = _emberMetalProperty_get.get(args[0], valuePath); } - return action.apply(target, args); + + return _emberMetalRun_loop.default.join.apply(_emberMetalRun_loop.default, [target, action].concat(args)); }; } else { closureAction = function () { - var args = arguments; + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + if (valuePath && args.length > 0) { - args = Array.prototype.slice.apply(args); args[0] = _emberMetalProperty_get.get(args[0], valuePath); } - return action.apply(target, args); + + return _emberMetalRun_loop.default.join.apply(_emberMetalRun_loop.default, [target, action].concat(args)); }; } closureAction[ACTION] = true; @@ -29126,11 +29123,11 @@ @submodule ember-routing-views */ 'use strict'; - _emberHtmlbarsTemplatesLinkTo.default.meta.revision = 'Ember@2.2.0-beta.1'; + _emberHtmlbarsTemplatesLinkTo.default.meta.revision = 'Ember@2.2.0'; /** `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. @@ -29414,18 +29411,20 @@ _invoke: function (event) { if (!_emberViewsSystemUtils.isSimpleClick(event)) { return true; } - if (this.attrs.preventDefault !== false) { - var targetAttribute = this.attrs.target; + var preventDefault = _emberMetalProperty_get.get(this, 'preventDefault'); + var targetAttribute = _emberMetalProperty_get.get(this, 'target'); + + if (preventDefault !== false) { if (!targetAttribute || targetAttribute === '_self') { event.preventDefault(); } } - if (this.attrs.bubbles === false) { + if (_emberMetalProperty_get.get(this, 'bubbles') === false) { event.stopPropagation(); } if (_emberMetalProperty_get.get(this, '_isDisabled')) { return false; @@ -29434,28 +29433,27 @@ if (_emberMetalProperty_get.get(this, 'loading')) { _emberMetalLogger.default.warn('This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.'); return false; } - var targetAttribute2 = this.attrs.target; - if (targetAttribute2 && targetAttribute2 !== '_self') { + if (targetAttribute && targetAttribute !== '_self') { return false; } var routing = _emberMetalProperty_get.get(this, '_routing'); var qualifiedRouteName = _emberMetalProperty_get.get(this, 'qualifiedRouteName'); var models = _emberMetalProperty_get.get(this, 'models'); var queryParamValues = _emberMetalProperty_get.get(this, 'queryParams.values'); - var shouldReplace = _emberMetalProperty_get.get(this, 'attrs.replace'); + var shouldReplace = _emberMetalProperty_get.get(this, 'replace'); routing.transitionTo(qualifiedRouteName, models, queryParamValues, shouldReplace); }, queryParams: null, qualifiedRouteName: _emberMetalComputed.computed('targetRouteName', '_routing.currentState', function computeLinkToComponentQualifiedRouteName() { - var params = this.attrs.params.slice(); + var params = _emberMetalProperty_get.get(this, 'params').slice(); var lastParam = params[params.length - 1]; if (lastParam && lastParam.isQueryParams) { params.pop(); } var onlyQueryParamsSupplied = this[_emberHtmlbarsNodeManagersComponentNodeManager.HAS_BLOCK] ? params.length === 0 : params.length === 1; @@ -29527,10 +29525,28 @@ } return true; }), + _getModels: function (params) { + var modelCount = params.length - 1; + var models = new Array(modelCount); + + for (var i = 0; i < modelCount; i++) { + var value = params[i + 1]; + + while (_emberRuntimeMixinsController.default.detect(value)) { + _emberMetalDebug.deprecate('Providing `{{link-to}}` with a param that is wrapped in a controller is deprecated. ' + (this.parentView ? 'Please update `' + this.parentView + '` to use `{{link-to "post" someController.model}}` instead.' : ''), false, { id: 'ember-routing-views.controller-wrapped-param', until: '3.0.0' }); + value = value.get('model'); + } + + models[i] = value; + } + + return models; + }, + /** The default href value to use while a link-to is loading. Only applies when tagName is 'a' @property loadingHref @type String @@ -29540,19 +29556,18 @@ loadingHref: '#', willRender: function () { var queryParams = undefined; - var attrs = this.attrs; - // Do not mutate params in place - var params = attrs.params.slice(); + var params = _emberMetalProperty_get.get(this, 'params').slice(); _emberMetalDebug.assert('You must provide one or more parameters to the link-to component.', params.length); - if (attrs.disabledWhen) { - this.set('disabled', attrs.disabledWhen); + var disabledWhen = _emberMetalProperty_get.get(this, 'disabledWhen'); + if (disabledWhen) { + this.set('disabled', disabledWhen); } // Process the positional arguments, in order. // 1. Inline link title comes first, if present. if (!this[_emberHtmlbarsNodeManagersComponentNodeManager.HAS_BLOCK]) { @@ -29571,24 +29586,15 @@ queryParams = {}; } this.set('queryParams', queryParams); // 4. Any remaining indices (excepting `targetRouteName` at 0) are `models`. - var models = []; - - for (var i = 1; i < params.length; i++) { - var value = params[i]; - - while (_emberRuntimeMixinsController.default.detect(value)) { - _emberMetalDebug.deprecate('Providing `{{link-to}}` with a param that is wrapped in a controller is deprecated. ' + (this.parentView ? 'Please update `' + this.parentView + '` to use `{{link-to "post" someController.model}}` instead.' : ''), false, { id: 'ember-routing-views.controller-wrapped-param', until: '3.0.0' }); - value = value.get('model'); - } - - models.push(value); + if (params.length > 1) { + this.set('models', this._getModels(params)); + } else { + this.set('models', []); } - - this.set('models', models); } }); LinkComponent.toString = function () { return 'LinkComponent'; @@ -29607,11 +29613,11 @@ @submodule ember-routing-views */ 'use strict'; - _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.2.0-beta.1'; + _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.2.0'; var CoreOutletView = _emberViewsViewsView.default.extend({ defaultTemplate: _emberHtmlbarsTemplatesTopLevelView.default, init: function () { @@ -29731,11 +29737,11 @@ @method compare @for Ember @param {Object} v First value to compare @param {Object} w Second value to compare @return {Number} -1 if v < w, 0 if v = w and 1 if v > w. - @private + @public */ function compare(v, w) { if (v === w) { return 0; @@ -38442,11 +38448,11 @@ options.plugins = plugins; options.buildMeta = function buildMeta(program) { return { fragmentReason: fragmentReason(program), - revision: 'Ember@2.2.0-beta.1', + revision: 'Ember@2.2.0', loc: program.loc, moduleName: options.moduleName }; }; @@ -40115,10 +40121,12 @@ return '{{' + this._debugContainerKey.split(':')[1] + '}}'; } }), init: function () { + var _this = this; + this._super.apply(this, arguments); _emberMetalProperty_set.set(this, 'controller', this); _emberMetalProperty_set.set(this, 'context', this); if (!this.layout && this.layoutName && this.container) { @@ -40133,10 +40141,24 @@ if (this.defaultLayout && !this.layout) { _emberMetalDebug.deprecate('Specifying `defaultLayout` to ' + this + ' is deprecated. Please use `layout` instead.', false, { id: 'ember-views.component.defaultLayout', until: '3.0.0' }); this.layout = this.defaultLayout; } + + // If in a tagless component, assert that no event handlers are defined + _emberMetalDebug.assert('You can not define a function that handles DOM events in the `' + this + '` tagless component since it doesn\'t have any DOM element.', this.tagName !== '' || !(function () { + var eventDispatcher = _this.container.lookup('event_dispatcher:main'); + var events = eventDispatcher && eventDispatcher._finalEvents || {}; + + for (var key in events) { + var methodName = events[key]; + + if (typeof _this[methodName] === 'function') { + return true; // indicate that the assertion should be triggered + } + } + })()); }, template: null, layoutName: null, layout: null, @@ -40327,10 +40349,11 @@ ``` @public @property hasBlock @param {String} [blockName="default"] The name of the block to check presence of. @returns Boolean + @since 1.13.0 */ /** Returns true when the component was invoked with a block parameter supplied. @@ -40359,10 +40382,11 @@ {{/if}} ``` @public @property hasBlockParams @returns Boolean + @since 1.13.0 */ /** Enables components to take a list of parameters as arguments For example a component that takes two parameters with the names @@ -40398,10 +40422,11 @@ {{#each attrs.names as |name|}}{{name}}{{/each}} ``` @static @public @property positionalParams + @since 1.13.0 */ }); Component.reopenClass({ isComponentFactory: true @@ -42949,11 +42974,11 @@ @method setup @param addedEvents {Object} */ setup: function (addedEvents, rootElement) { var event; - var events = _emberMetalAssign.default({}, _emberMetalProperty_get.get(this, 'events'), addedEvents); + var events = this._finalEvents = _emberMetalAssign.default({}, _emberMetalProperty_get.get(this, 'events'), addedEvents); if (!_emberMetalIs_none.default(rootElement)) { _emberMetalProperty_set.set(this, 'rootElement', rootElement); } @@ -43753,10 +43778,10 @@ 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.2.0-beta.1'; + _emberHtmlbarsTemplatesContainerView.default.meta.revision = 'Ember@2.2.0'; /** @module ember @submodule ember-views */