dist/ember-template-compiler.js in ember-source-1.13.6 vs dist/ember-template-compiler.js in ember-source-1.13.7

- old
+ new

@@ -3,11 +3,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 1.13.6 + * @version 1.13.7 */ (function() { var enifed, requireModule, eriuqer, requirejs, Ember; var mainContext = this; @@ -1869,11 +1869,11 @@ exports.removeChainWatcher = removeChainWatcher; exports.ChainNode = ChainNode; }); // warn, assert, etc; -enifed("ember-metal/computed", ["exports", "ember-metal/property_set", "ember-metal/utils", "ember-metal/expand_properties", "ember-metal/error", "ember-metal/properties", "ember-metal/property_events", "ember-metal/dependent_keys"], function (exports, _emberMetalProperty_set, _emberMetalUtils, _emberMetalExpand_properties, _emberMetalError, _emberMetalProperties, _emberMetalProperty_events, _emberMetalDependent_keys) { +enifed("ember-metal/computed", ["exports", "ember-metal/core", "ember-metal/property_set", "ember-metal/utils", "ember-metal/expand_properties", "ember-metal/error", "ember-metal/properties", "ember-metal/property_events", "ember-metal/dependent_keys"], function (exports, _emberMetalCore, _emberMetalProperty_set, _emberMetalUtils, _emberMetalExpand_properties, _emberMetalError, _emberMetalProperties, _emberMetalProperty_events, _emberMetalDependent_keys) { "use strict"; /** @module ember @submodule ember-metal @@ -1972,11 +1972,11 @@ this.isDescriptor = true; if (typeof config === "function") { config.__ember_arity = config.length; this._getter = config; if (config.__ember_arity > 1) { - Ember.deprecate("Using the same function as getter and setter is deprecated.", false, { + _emberMetalCore["default"].deprecate("Using the same function as getter and setter is deprecated.", false, { url: "http://emberjs.com/deprecations/v1.x/#toc_deprecate-using-the-same-function-as-getter-and-setter-in-computed-properties" }); this._setter = config; } } else { @@ -1989,14 +1989,14 @@ this._dependentKeys = undefined; this._suspended = undefined; this._meta = undefined; - Ember.deprecate("Passing opts.cacheable to the CP constructor is deprecated. Invoke `volatile()` on the CP instead.", !opts || !opts.hasOwnProperty('cacheable')); + _emberMetalCore["default"].deprecate("Passing opts.cacheable to the CP constructor is deprecated. Invoke `volatile()` on the CP instead.", !opts || !opts.hasOwnProperty('cacheable')); this._cacheable = opts && opts.cacheable !== undefined ? opts.cacheable : true; // TODO: Set always to `true` once this deprecation is gone. this._dependentKeys = opts && opts.dependentKeys; - Ember.deprecate("Passing opts.readOnly to the CP constructor is deprecated. All CPs are writable by default. You can invoke `readOnly()` on the CP to change this.", !opts || !opts.hasOwnProperty('readOnly')); + _emberMetalCore["default"].deprecate("Passing opts.readOnly to the CP constructor is deprecated. All CPs are writable by default. You can invoke `readOnly()` on the CP to change this.", !opts || !opts.hasOwnProperty('readOnly')); this._readOnly = opts && (opts.readOnly !== undefined || !!opts.readOnly) || false; // TODO: Set always to `false` once this deprecation is gone. } ComputedProperty.prototype = new _emberMetalProperties.Descriptor(); @@ -2018,11 +2018,11 @@ @chainable @deprecated All computed properties are cacheble by default. Use `volatile()` instead to opt-out to caching. @public */ ComputedPropertyPrototype.cacheable = function (aFlag) { - Ember.deprecate('ComputedProperty.cacheable() is deprecated. All computed properties are cacheable by default.'); + _emberMetalCore["default"].deprecate('ComputedProperty.cacheable() is deprecated. All computed properties are cacheable by default.'); this._cacheable = aFlag !== false; return this; }; /** @@ -2067,13 +2067,13 @@ @return {Ember.ComputedProperty} this @chainable @public */ ComputedPropertyPrototype.readOnly = function (readOnly) { - Ember.deprecate('Passing arguments to ComputedProperty.readOnly() is deprecated.', arguments.length === 0); + _emberMetalCore["default"].deprecate('Passing arguments to ComputedProperty.readOnly() is deprecated.', arguments.length === 0); this._readOnly = readOnly === undefined || !!readOnly; // Force to true once this deprecation is gone - Ember.assert("Computed properties that define a setter using the new syntax cannot be read-only", !(this._readOnly && this._setter && this._setter !== this._getter)); + _emberMetalCore["default"].assert("Computed properties that define a setter using the new syntax cannot be read-only", !(this._readOnly && this._setter && this._setter !== this._getter)); return this; }; /** Sets the dependent keys on this computed property. Pass any number of @@ -2105,10 +2105,12 @@ */ ComputedPropertyPrototype.property = function () { var args; var addArg = function (property) { + _emberMetalCore["default"].deprecate("Depending on arrays using a dependent key ending with `@each` is deprecated. " + ("Please refactor from `Ember.computed('" + property + "', function() {});` to `Ember.computed('" + property.slice(0, -6) + ".[]', function() {})`."), property.slice(-5) !== '@each', { id: 'ember-metal.@each-dependent-key-leaf', until: '2.0.0' }); + args.push(property); }; args = []; for (var i = 0, l = arguments.length; i < l; i++) { @@ -2966,10 +2968,11 @@ } } return value; }); + exports.and = and; /** A computed property which performs a logical `or` on the original values for the provided dependent properties. Example @@ -2993,20 +2996,20 @@ @param {String} dependentKey* @return {Ember.ComputedProperty} computed property which performs a logical `or` on the values of all the original values for properties. @public */ - exports.and = and; var or = generateComputedWithProperties(function (properties) { for (var key in properties) { if (properties.hasOwnProperty(key) && properties[key]) { return properties[key]; } } return false; }); + exports.or = or; /** A computed property that returns the first truthy value from a list of dependent properties. Example @@ -3029,21 +3032,21 @@ @return {Ember.ComputedProperty} computed property which returns the first truthy value of given list of properties. @deprecated Use `Ember.computed.or` instead. @public */ - exports.or = or; var any = generateComputedWithProperties(function (properties) { _emberMetalCore["default"].deprecate('Usage of Ember.computed.any is deprecated, use `Ember.computed.or` instead.'); for (var key in properties) { if (properties.hasOwnProperty(key) && properties[key]) { return properties[key]; } } return null; }); + exports.any = any; /** A computed property that returns the array of values for the provided dependent properties. Example @@ -3066,11 +3069,10 @@ @param {String} dependentKey* @return {Ember.ComputedProperty} computed property which maps values of all passed in properties to an array. @public */ - exports.any = any; var collect = generateComputedWithProperties(function (properties) { var res = _emberMetalCore["default"].A(); for (var key in properties) { if (properties.hasOwnProperty(key)) { if (_emberMetalIs_none["default"](properties[key])) { @@ -3081,10 +3083,11 @@ } } return res; }); + exports.collect = collect; /** Creates a new property that is an alias for another property on an object. Calls to `get` or `set` this property behave as though they were called on the original property. @@ -3142,11 +3145,10 @@ @param {String} dependentKey @return {Ember.ComputedProperty} computed property which creates a one way computed property to the original value for property. @public */ - exports.collect = collect; function oneWay(dependentKey) { return _emberMetalAlias["default"](dependentKey).oneWay(); } @@ -3295,11 +3297,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 1.13.6 + @version 1.13.7 @public */ 'use strict'; @@ -3329,15 +3331,15 @@ /** The semantic version. @property VERSION @type String - @default '1.13.6' + @default '1.13.7' @static @public */ - Ember.VERSION = '1.13.6'; + Ember.VERSION = '1.13.7'; /** 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 @@ -3486,11 +3488,10 @@ /** An empty function useful for some operations. Always returns `this`. @method K - @private @return {Object} @public */ function K() { return this; @@ -4553,11 +4554,12 @@ Ember.expandProperties('foo.{bar,baz}.@each', echo) //=> 'foo.bar.@each', 'foo.baz.@each' Ember.expandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs' Ember.expandProperties('{foo}.bar.{baz}') //=> 'foo.bar.baz' ``` - @method + @method expandProperties + @for Ember @private @param {String} pattern The property pattern to expand. @param {Function} callback The callback to invoke. It is invoked once per expansion, and is passed the expansion. */ @@ -5915,11 +5917,11 @@ @method merge @for Ember @param {Object} original The object to merge into @param {Object} updates The object to copy properties from @return {Object} - @private + @public */ function merge(original, updates) { if (!updates || typeof updates !== 'object') { return original; @@ -6802,10 +6804,12 @@ var func = args.slice(-1)[0]; var paths; var addWatchedProperty = function (path) { + _emberMetalCore["default"].deprecate("Depending on arrays using a dependent key ending with `@each` is deprecated. " + ("Please refactor from `Ember.observer('" + path + "', function() {});` to `Ember.computed('" + path.slice(0, -6) + ".[]', function() {})`."), path.slice(-5) !== '@each', { id: 'ember-metal.@each-dependent-key-leaf', until: '2.0.0' }); + paths.push(path); }; var _paths = args.slice(0, -1); if (typeof func !== "function") { @@ -7978,11 +7982,11 @@ exports.overrideChains = overrideChains; exports.beginPropertyChanges = beginPropertyChanges; exports.endPropertyChanges = endPropertyChanges; exports.changeProperties = changeProperties; }); -enifed("ember-metal/property_get", ["exports", "ember-metal/core", "ember-metal/error", "ember-metal/path_cache", "ember-metal/platform/define_property", "ember-metal/utils", "ember-metal/is_none"], function (exports, _emberMetalCore, _emberMetalError, _emberMetalPath_cache, _emberMetalPlatformDefine_property, _emberMetalUtils, _emberMetalIs_none) { +enifed("ember-metal/property_get", ["exports", "ember-metal/core", "ember-metal/error", "ember-metal/path_cache", "ember-metal/platform/define_property", "ember-metal/is_none"], function (exports, _emberMetalCore, _emberMetalError, _emberMetalPath_cache, _emberMetalPlatformDefine_property, _emberMetalIs_none) { /** @module ember-metal */ "use strict"; @@ -7992,14 +7996,10 @@ exports._getPath = _getPath; exports.getWithDefault = getWithDefault; var FIRST_KEY = /^([^\.]+)/; - var INTERCEPT_GET = _emberMetalUtils.symbol("INTERCEPT_GET"); - exports.INTERCEPT_GET = INTERCEPT_GET; - var UNHANDLED_GET = _emberMetalUtils.symbol("UNHANDLED_GET"); - // .......................................................... // 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 @@ -8028,11 +8028,10 @@ @param {Object} obj The object to retrieve from. @param {String} keyName The property key to retrieve @return {Object} the property value or `null`. @public */ - exports.UNHANDLED_GET = UNHANDLED_GET; function get(obj, keyName) { _emberMetalCore["default"].deprecate("Get must be called with two arguments; an object and a property key", arguments.length === 2); // Helpers that operate with 'this' within an #each if (keyName === '') { @@ -8051,17 +8050,10 @@ if (_emberMetalIs_none["default"](obj)) { _emberMetalCore["default"].deprecate('Calling Ember.get without a target object has been deprecated, please specify a target object.'); return _getPath(obj, keyName); } - if (obj && typeof obj[INTERCEPT_GET] === 'function') { - var result = obj[INTERCEPT_GET](obj, keyName); - if (result !== UNHANDLED_GET) { - return result; - } - } - var meta = obj['__ember_meta__']; var possibleDesc = obj[keyName]; var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; var ret; @@ -8171,18 +8163,15 @@ return value; } exports["default"] = get; }); -enifed("ember-metal/property_set", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/property_events", "ember-metal/properties", "ember-metal/error", "ember-metal/path_cache", "ember-metal/platform/define_property", "ember-metal/utils"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalProperties, _emberMetalError, _emberMetalPath_cache, _emberMetalPlatformDefine_property, _emberMetalUtils) { +enifed("ember-metal/property_set", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/property_events", "ember-metal/properties", "ember-metal/error", "ember-metal/path_cache", "ember-metal/platform/define_property"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalProperties, _emberMetalError, _emberMetalPath_cache, _emberMetalPlatformDefine_property) { "use strict"; exports.set = set; exports.trySet = trySet; - var INTERCEPT_SET = _emberMetalUtils.symbol("INTERCEPT_SET"); - exports.INTERCEPT_SET = INTERCEPT_SET; - var UNHANDLED_SET = _emberMetalUtils.symbol("UNHANDLED_SET"); /** Sets the value of a property on an object, respecting computed properties and notifying observers and other listeners of the change. If the property is not defined but the object implements the `setUnknownProperty` @@ -8194,11 +8183,10 @@ @param {String} keyName The property key to set @param {Object} value The value to set @return {Object} the passed value. @public */ - exports.UNHANDLED_SET = UNHANDLED_SET; function set(obj, keyName, value, tolerant) { if (typeof obj === 'string') { _emberMetalCore["default"].assert("Path '" + obj + "' must be global if no obj is given.", _emberMetalPath_cache.isGlobalPath(obj)); _emberMetalCore["default"].deprecate('Calling Ember.set with only a property key and a value has been deprecated, please also specify a target object.'); @@ -8212,20 +8200,10 @@ if (obj === _emberMetalCore["default"].lookup) { return setPath(obj, keyName, value, tolerant); } - // This path exists purely to implement backwards-compatible - // effects (specifically, setting a property on a view may - // invoke a mutator on `attrs`). - if (obj && typeof obj[INTERCEPT_SET] === 'function') { - var result = obj[INTERCEPT_SET](obj, keyName, value, tolerant); - if (result !== UNHANDLED_SET) { - return result; - } - } - var meta, possibleDesc, desc; if (obj) { meta = obj['__ember_meta__']; possibleDesc = obj[keyName]; desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; @@ -10210,10 +10188,11 @@ var NEXT_SUPER_PROPERTY = { name: '__nextSuper', descriptor: undefinedDescriptor }; + exports.NEXT_SUPER_PROPERTY = NEXT_SUPER_PROPERTY; /** Generates a new guid, optionally saving the guid to the object that you pass in. You will rarely need to use this method. Instead you should call `Ember.guidFor(obj)`, which return an existing guid if available. @@ -10227,11 +10206,10 @@ If no object is passed, just generate a new guid. @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to separate the guid into separate namespaces. @return {String} the guid */ - exports.NEXT_SUPER_PROPERTY = NEXT_SUPER_PROPERTY; function generateGuid(obj, prefix) { if (!prefix) { prefix = GUID_PREFIX; } @@ -11225,11 +11203,11 @@ } } } } }); -enifed("ember-template-compiler", ["exports", "ember-metal/core", "ember-template-compiler/system/precompile", "ember-template-compiler/system/compile", "ember-template-compiler/system/template", "ember-template-compiler/plugins", "ember-template-compiler/plugins/transform-each-in-to-block-params", "ember-template-compiler/plugins/transform-with-as-to-hash", "ember-template-compiler/plugins/transform-bind-attr-to-attributes", "ember-template-compiler/plugins/transform-each-into-collection", "ember-template-compiler/plugins/transform-single-arg-each", "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/deprecate-view-and-controller-paths", "ember-template-compiler/plugins/deprecate-view-helper", "ember-template-compiler/compat"], function (exports, _emberMetalCore, _emberTemplateCompilerSystemPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemTemplate, _emberTemplateCompilerPlugins, _emberTemplateCompilerPluginsTransformEachInToBlockParams, _emberTemplateCompilerPluginsTransformWithAsToHash, _emberTemplateCompilerPluginsTransformBindAttrToAttributes, _emberTemplateCompilerPluginsTransformEachIntoCollection, _emberTemplateCompilerPluginsTransformSingleArgEach, _emberTemplateCompilerPluginsTransformOldBindingSyntax, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax, _emberTemplateCompilerPluginsTransformItemClass, _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut, _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly, _emberTemplateCompilerPluginsTransformAngleBracketComponents, _emberTemplateCompilerPluginsTransformInputOnToOnEvent, _emberTemplateCompilerPluginsDeprecateViewAndControllerPaths, _emberTemplateCompilerPluginsDeprecateViewHelper, _emberTemplateCompilerCompat) { +enifed("ember-template-compiler", ["exports", "ember-metal/core", "ember-template-compiler/system/precompile", "ember-template-compiler/system/compile", "ember-template-compiler/system/template", "ember-template-compiler/plugins", "ember-template-compiler/plugins/transform-each-in-to-block-params", "ember-template-compiler/plugins/transform-with-as-to-hash", "ember-template-compiler/plugins/transform-bind-attr-to-attributes", "ember-template-compiler/plugins/transform-each-into-collection", "ember-template-compiler/plugins/transform-single-arg-each", "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/deprecate-view-and-controller-paths", "ember-template-compiler/plugins/deprecate-view-helper", "ember-template-compiler/plugins/deprecate-with-controller", "ember-template-compiler/plugins/deprecate-unbound-block-and-multi-param", "ember-template-compiler/compat"], function (exports, _emberMetalCore, _emberTemplateCompilerSystemPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemTemplate, _emberTemplateCompilerPlugins, _emberTemplateCompilerPluginsTransformEachInToBlockParams, _emberTemplateCompilerPluginsTransformWithAsToHash, _emberTemplateCompilerPluginsTransformBindAttrToAttributes, _emberTemplateCompilerPluginsTransformEachIntoCollection, _emberTemplateCompilerPluginsTransformSingleArgEach, _emberTemplateCompilerPluginsTransformOldBindingSyntax, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax, _emberTemplateCompilerPluginsTransformItemClass, _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut, _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly, _emberTemplateCompilerPluginsTransformAngleBracketComponents, _emberTemplateCompilerPluginsTransformInputOnToOnEvent, _emberTemplateCompilerPluginsDeprecateViewAndControllerPaths, _emberTemplateCompilerPluginsDeprecateViewHelper, _emberTemplateCompilerPluginsDeprecateWithController, _emberTemplateCompilerPluginsDeprecateUnboundBlockAndMultiParam, _emberTemplateCompilerCompat) { "use strict"; _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformWithAsToHash["default"]); _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformEachInToBlockParams["default"]); _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformBindAttrToAttributes["default"]); @@ -11242,10 +11220,12 @@ _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly["default"]); _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformAngleBracketComponents["default"]); _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformInputOnToOnEvent["default"]); _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsDeprecateViewAndControllerPaths["default"]); _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsDeprecateViewHelper["default"]); + _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsDeprecateWithController["default"]); + _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsDeprecateUnboundBlockAndMultiParam["default"]); exports._Ember = _emberMetalCore["default"]; exports.precompile = _emberTemplateCompilerSystemPrecompile["default"]; exports.compile = _emberTemplateCompilerSystemCompile["default"]; exports.template = _emberTemplateCompilerSystemTemplate["default"]; @@ -11321,10 +11301,58 @@ plugins[type].push(Plugin); } exports["default"] = plugins; }); +enifed('ember-template-compiler/plugins/deprecate-unbound-block-and-multi-param', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { + 'use strict'; + + function DeprecateUnboundBlockAndMultiParam(options) { + // set later within HTMLBars to the syntax package + this.syntax = null; + this.options = options || {}; + } + + DeprecateUnboundBlockAndMultiParam.prototype.transform = function (ast) { + var pluginContext = this; + var walker = new pluginContext.syntax.Walker(); + var moduleName = pluginContext.options.moduleName; + + walker.visit(ast, function (node) { + + if (pluginContext.isBlockUsage(node)) { + var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay["default"](moduleName, node.loc); + + _emberMetalCore["default"].deprecate('Using the {{unbound}} helper with a block ' + moduleInfo + 'is deprecated and will be removed in 2.0.0.', false, { + id: 'ember-template-compiler.unbound-block', + until: '2.0.0', + url: 'http://emberjs.com/deprecations/v1.x/#toc_block-and-multi-argument-unbound-helper' + }); + } else if (pluginContext.hasMultipleParams(node)) { + var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay["default"](moduleName, node.loc); + + _emberMetalCore["default"].deprecate('Using the {{unbound}} helper with multiple params ' + moduleInfo + 'is deprecated and will be removed in 2.0.0. Please refactor to nested helper usage.', false, { + id: 'ember-template-compiler.unbound-multiple-params', + until: '2.0.0', + url: 'http://emberjs.com/deprecations/v1.x/#toc_block-and-multi-argument-unbound-helper' + }); + } + }); + + return ast; + }; + + DeprecateUnboundBlockAndMultiParam.prototype.isBlockUsage = function (node) { + return node.type === 'BlockStatement' && node.path.original === 'unbound'; + }; + + DeprecateUnboundBlockAndMultiParam.prototype.hasMultipleParams = function (node) { + return (node.type === 'BlockStatement' || node.type === 'MustacheStatement') && node.path.original === 'unbound' && node.params.length > 1; + }; + + exports["default"] = DeprecateUnboundBlockAndMultiParam; +}); enifed("ember-template-compiler/plugins/deprecate-view-and-controller-paths", ["exports", "ember-metal/core", "ember-template-compiler/system/calculate-location-display"], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { "use strict"; function DeprecateViewAndControllerPaths(options) { // set later within HTMLBars to the syntax package @@ -11450,10 +11478,69 @@ return (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && node.path.parts[0] === 'view'; } exports["default"] = DeprecateViewHelper; }); +enifed('ember-template-compiler/plugins/deprecate-with-controller', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { + 'use strict'; + + /** + @module ember + @submodule ember-template-compiler + */ + + /** + An HTMLBars AST transformation that deprecates usage of `controller` with the `{{with}}` + helper. + + @private + @class DeprecateWithController + */ + function DeprecateWithController(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. + */ + DeprecateWithController.prototype.transform = function DeprecateWithController_transform(ast) { + var pluginContext = this; + var walker = new pluginContext.syntax.Walker(); + var moduleName = pluginContext.options.moduleName; + + walker.visit(ast, function (node) { + if (pluginContext.validate(node)) { + var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay["default"](moduleName, node.loc); + + _emberMetalCore["default"].deprecate('Using the {{with}} helper with a `controller` specified ' + moduleInfo + 'is deprecated and will be removed in 2.0.0.', false, { id: 'ember-template-compiler.with-controller', until: '2.0.0' }); + } + }); + + return ast; + }; + + DeprecateWithController.prototype.validate = function TransformWithAsToHash_validate(node) { + return (node.type === 'BlockStatement' || node.type === 'MustacheStatement') && node.path.original === 'with' && hashPairForKey(node.hash, 'controller'); + }; + + function hashPairForKey(hash, key) { + for (var i = 0, l = hash.pairs.length; i < l; i++) { + var pair = hash.pairs[i]; + if (pair.key === key) { + return pair; + } + } + + return false; + } + + exports["default"] = DeprecateWithController; +}); enifed('ember-template-compiler/plugins/transform-angle-bracket-components', ['exports'], function (exports) { 'use strict'; function TransformAngleBracketComponents() { // set later within HTMLBars to the syntax package @@ -12552,11 +12639,11 @@ } options.plugins = plugins; options.buildMeta = function buildMeta(program) { return { - revision: 'Ember@1.13.6', + revision: 'Ember@1.13.7', loc: program.loc, moduleName: options.moduleName }; }; @@ -14491,11 +14578,11 @@ // this list will be pruned from the MorphList during the cleanup // process. var handledMorphs = renderState.handledMorphs; var key = undefined; - if (handledMorphs[_key]) { + if (_key in handledMorphs) { // In this branch we are dealing with a duplicate key. The strategy // is to take the original key and append a counter to it that is // incremented every time the key is reused. In order to greatly // reduce the chance of colliding with another valid key we also add // an extra string "--z8mS2hvDW0A--" to the new key. @@ -15119,10 +15206,11 @@ return !!(scope.blocks[name] && scope.blocks[name].arity); } }; + exports.keywords = keywords; /** Host Hook: partial @param {RenderNode} renderNode @param {Environment} env @@ -15145,11 +15233,10 @@ and not to the ambient lexical environment. The host hook should invoke the referenced partial with the ambient `self`. */ - exports.keywords = keywords; function partial(renderNode, env, scope, path) { var template = env.partials[path]; return template.render(scope.self, env, {}).fragment; } @@ -17486,14 +17573,14 @@ return obj; } var toString = Object.prototype.toString; + exports.toString = toString; // Sourced from lodash // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt /*eslint-disable func-style, no-var */ - exports.toString = toString; var isFunction = function (value) { return typeof value === 'function'; }; // fallback for older versions of Chrome and Safari /* istanbul ignore next */ @@ -17501,20 +17588,20 @@ exports.isFunction = isFunction = function (value) { return typeof value === 'function' && toString.call(value) === '[object Function]'; }; } var isFunction; + exports.isFunction = isFunction; /*eslint-enable func-style, no-var */ /* istanbul ignore next */ - exports.isFunction = isFunction; var isArray = Array.isArray || function (value) { return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; }; - // Older IE versions do not directly support indexOf so we must implement our own, sadly. exports.isArray = isArray; + // Older IE versions do not directly support indexOf so we must implement our own, sadly. function indexOf(array, value) { for (var i = 0, len = array.length; i < len; i++) { if (array[i] === value) { return i; @@ -18474,14 +18561,14 @@ return obj; } var toString = Object.prototype.toString; + exports.toString = toString; // Sourced from lodash // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt /*eslint-disable func-style, no-var */ - exports.toString = toString; var isFunction = function (value) { return typeof value === 'function'; }; // fallback for older versions of Chrome and Safari /* istanbul ignore next */ @@ -18489,19 +18576,19 @@ exports.isFunction = isFunction = function (value) { return typeof value === 'function' && toString.call(value) === '[object Function]'; }; } var isFunction; + exports.isFunction = isFunction; /*eslint-enable func-style, no-var */ /* istanbul ignore next */ - exports.isFunction = isFunction; var isArray = Array.isArray || function (value) { return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; }; - // Older IE versions do not directly support indexOf so we must implement our own, sadly. exports.isArray = isArray; + // Older IE versions do not directly support indexOf so we must implement our own, sadly. function indexOf(array, value) { for (var i = 0, len = array.length; i < len; i++) { if (array[i] === value) { return i; \ No newline at end of file