dist/ember.debug.js in ember-source-2.0.0.beta.3 vs dist/ember.debug.js in ember-source-2.0.0.beta.5

- old
+ new

@@ -3,19 +3,20 @@ * @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.0.0-beta.3 + * @version 2.0.0-beta.5 */ (function() { var enifed, requireModule, eriuqer, requirejs, Ember; var mainContext = this; (function() { - var isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; + var isNode = typeof window === 'undefined' && + typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; if (!isNode) { Ember = this.Ember = this.Ember || {}; } @@ -113,10 +114,12 @@ requirejs = eriuqer = requireModule = Ember.__loader.require; } })(); enifed('backburner', ['exports', './backburner/utils', './backburner/platform', './backburner/binary-search', './backburner/deferred-action-queues'], function (exports, _backburnerUtils, _backburnerPlatform, _backburnerBinarySearch, _backburnerDeferredActionQueues) { + 'use strict'; + exports.default = Backburner; function Backburner(queueNames, options) { this.queueNames = queueNames; this.options = options || {}; @@ -125,10 +128,14 @@ } this.instanceStack = []; this._debouncees = []; this._throttlers = []; this._timers = []; + this._eventCallbacks = { + end: [], + begin: [] + }; } Backburner.prototype = { begin: function () { var options = this.options; @@ -138,10 +145,11 @@ if (previousInstance) { this.instanceStack.push(previousInstance); } this.currentInstance = new _backburnerDeferredActionQueues.default(this.queueNames, options); + this._trigger('begin', this.currentInstance, previousInstance); if (onBegin) { onBegin(this.currentInstance, previousInstance); } }, @@ -164,19 +172,73 @@ if (this.instanceStack.length) { nextInstance = this.instanceStack.pop(); this.currentInstance = nextInstance; } - + this._trigger('end', currentInstance, nextInstance); if (onEnd) { onEnd(currentInstance, nextInstance); } } } }, - run: function () { + /** + Trigger an event. Supports up to two arguments. Designed around + triggering transition events from one run loop instance to the + next, which requires an argument for the first instance and then + an argument for the next instance. + @private + @method _trigger + @param {String} eventName + @param {any} arg1 + @param {any} arg2 + */ + _trigger: function (eventName, arg1, arg2) { + var callbacks = this._eventCallbacks[eventName]; + if (callbacks) { + for (var i = 0; i < callbacks.length; i++) { + callbacks[i](arg1, arg2); + } + } + }, + + on: function (eventName, callback) { + if (typeof callback !== 'function') { + throw new TypeError('Callback must be a function'); + } + var callbacks = this._eventCallbacks[eventName]; + if (callbacks) { + callbacks.push(callback); + } else { + throw new TypeError('Cannot on() event "' + eventName + '" because it does not exist'); + } + }, + + off: function (eventName, callback) { + if (eventName) { + var callbacks = this._eventCallbacks[eventName]; + var callbackFound = false; + if (!callbacks) return; + if (callback) { + for (var i = 0; i < callbacks.length; i++) { + if (callbacks[i] === callback) { + callbackFound = true; + callbacks.splice(i, 1); + i--; + } + } + } + if (!callbackFound) { + throw new TypeError('Cannot off() callback that does not exist'); + } + } else { + throw new TypeError('Cannot off() event "' + eventName + '" because it does not exist'); + } + }, + + run: function () /* target, method, args */{ var length = arguments.length; var method, target, args; if (length === 1) { method = arguments[0]; @@ -227,11 +289,11 @@ } } } }, - join: function () { + join: function () /* target, method, args */{ if (this.currentInstance) { var length = arguments.length; var method, target; if (length === 1) { @@ -681,12 +743,13 @@ } return index; } }); -/* target, method, args */ /* target, method, args */ enifed("backburner/binary-search", ["exports"], function (exports) { + "use strict"; + exports.default = binarySearch; function binarySearch(time, timers) { var start = 0; var end = timers.length - 2; @@ -710,10 +773,12 @@ return time >= timers[start] ? start + 2 : start; } }); enifed('backburner/deferred-action-queues', ['exports', './utils', './queue'], function (exports, _utils, _queue) { + 'use strict'; + exports.default = DeferredActionQueues; function DeferredActionQueues(queueNames, options) { var queues = this.queues = {}; this.queueNames = queueNames = queueNames || []; @@ -727,19 +792,27 @@ function noSuchQueue(name) { throw new Error('You attempted to schedule an action in a queue (' + name + ') that doesn\'t exist'); } + function noSuchMethod(name) { + throw new Error('You attempted to schedule an action in a queue (' + name + ') for a method that doesn\'t exist'); + } + DeferredActionQueues.prototype = { schedule: function (name, target, method, args, onceFlag, stack) { var queues = this.queues; var queue = queues[name]; if (!queue) { noSuchQueue(name); } + if (!method) { + noSuchMethod(name); + } + if (onceFlag) { return queue.pushUnique(target, method, args, stack); } else { return queue.push(target, method, args, stack); } @@ -771,10 +844,12 @@ }); enifed('backburner/platform', ['exports'], function (exports) { // In IE 6-8, try/finally doesn't work without a catch. // Unfortunately, this is impossible to test for since wrapping it in a parent try/catch doesn't trigger the bug. // This tests for another broken try/catch behavior that only exhibits in the same versions of IE. + 'use strict'; + var needsIETryCatchFix = (function (e, x) { try { x(); } catch (e) {} // jshint ignore:line return !!e; @@ -787,18 +862,20 @@ if (typeof self === 'object') { platform = self; /* global global */ } else if (typeof global === 'object') { - platform = global; - } else { - throw new Error('no global: `self` or `global` found'); - } + platform = global; + } else { + throw new Error('no global: `self` or `global` found'); + } exports.default = platform; }); enifed('backburner/queue', ['exports', './utils'], function (exports, _utils) { + 'use strict'; + exports.default = Queue; function Queue(name, options, globalOptions) { this.name = name; this.globalOptions = globalOptions || {}; @@ -1031,10 +1108,12 @@ } } }; }); enifed('backburner/utils', ['exports'], function (exports) { + 'use strict'; + exports.each = each; exports.isString = isString; exports.isFunction = isFunction; exports.isNumber = isNumber; exports.isCoercableNumber = isCoercableNumber; @@ -1079,50 +1158,13 @@ throw e; } }; } }); -enifed('calculateVersion', ['exports'], function (exports) { +enifed('container', ['exports', 'ember-metal/core', 'container/registry', 'container/container'], function (exports, _emberMetalCore, _containerRegistry, _containerContainer) { 'use strict'; - var fs = eriuqer('fs'); - var path = eriuqer('path'); - - module.exports = function () { - var packageVersion = eriuqer('../package.json').version; - var output = [packageVersion]; - var gitPath = path.join(__dirname, '..', '.git'); - var headFilePath = path.join(gitPath, 'HEAD'); - - if (packageVersion.indexOf('+') > -1) { - try { - if (fs.existsSync(headFilePath)) { - var headFile = fs.readFileSync(headFilePath, { encoding: 'utf8' }); - var branchName = headFile.split('/').slice(-1)[0].trim(); - var refPath = headFile.split(' ')[1]; - var branchSHA; - - if (refPath) { - var branchPath = path.join(gitPath, refPath.trim()); - branchSHA = fs.readFileSync(branchPath); - } else { - branchSHA = branchName; - } - - output.push(branchSHA.slice(0, 10)); - } - } catch (err) { - console.error(err.stack); - } - return output.join('.'); - } else { - return packageVersion; - } - }; -}); -enifed('container', ['exports', 'ember-metal/core', 'container/registry', 'container/container'], function (exports, _emberMetalCore, _containerRegistry, _containerContainer) { - /* 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 @@ -1141,15 +1183,12 @@ exports.Registry = _containerRegistry.default; exports.Container = _containerContainer.default; }); enifed('container/container', ['exports', 'ember-metal/core', 'ember-metal/dictionary'], function (exports, _emberMetalCore, _emberMetalDictionary) { + 'use strict'; - // TODO - Temporary workaround for v0.4.0 of the ES6 transpiler, which lacks support for circular dependencies. - // See the below usage of requireModule. Instead, it should be possible to simply `import Registry from './registry';` - var Registry; - /** A container used to instantiate and cache objects. Every `Container` must be associated with a `Registry`, which is referenced to determine the factory and options that should be used to instantiate @@ -1160,38 +1199,28 @@ @private @class Container */ function Container(registry, options) { - this._registry = registry || (function () { - _emberMetalCore.default.deprecate('A container should only be created for an already instantiated registry. For backward compatibility, an isolated registry will be instantiated just for this container.'); - - // TODO - See note above about transpiler import workaround. - if (!Registry) { - Registry = requireModule('container/registry')['default']; - } - - return new Registry(); - })(); - + this._registry = registry; this.cache = _emberMetalDictionary.default(options && options.cache ? options.cache : null); this.factoryCache = _emberMetalDictionary.default(options && options.factoryCache ? options.factoryCache : null); this.validationCache = _emberMetalDictionary.default(options && options.validationCache ? options.validationCache : null); } Container.prototype = { /** @private - @property _registry + @property _registry @type Registry @since 1.11.0 */ _registry: null, /** @private - @property cache + @property cache @type InheritingDict */ cache: null, /** @@ -1285,25 +1314,10 @@ resetCache(this); } } }; - (function exposeRegistryMethods() { - var methods = ['register', 'unregister', 'resolve', 'normalize', 'typeInjection', 'injection', 'factoryInjection', 'factoryTypeInjection', 'has', 'options', 'optionsForType']; - - function exposeRegistryMethod(method) { - Container.prototype[method] = function () { - _emberMetalCore.default.deprecate(method + ' should be called on the registry instead of the container'); - return this._registry[method].apply(this._registry, arguments); - }; - } - - for (var i = 0, l = methods.length; i < l; i++) { - exposeRegistryMethod(methods[i]); - } - })(); - function lookup(container, fullName, options) { options = options || {}; if (container.cache[fullName] && options.singleton !== false) { return container.cache[fullName]; @@ -1487,18 +1501,15 @@ } exports.default = Container; }); // Ember.assert -enifed('container/registry', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/dictionary', 'ember-metal/merge', './container'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalDictionary, _emberMetalMerge, _container) { +enifed('container/registry', ['exports', 'ember-metal/core', 'ember-metal/dictionary', 'ember-metal/merge', './container'], function (exports, _emberMetalCore, _emberMetalDictionary, _emberMetalMerge, _container) { + 'use strict'; var VALID_FULL_NAME_REGEXP = /^[^:]+.+:[^:]+$/; - var instanceInitializersFeatureEnabled; - - instanceInitializersFeatureEnabled = true; - /** A registry used to store factory and option information keyed by type. A `Registry` stores the factory and option information needed by a @@ -1609,74 +1620,21 @@ @type InheritingDict */ _typeOptions: null, /** - The first container created for this registry. - This allows deprecated access to `lookup` and `lookupFactory` to avoid - breaking compatibility for Ember 1.x initializers. - @private - @property _defaultContainer - @type Container - */ - _defaultContainer: null, - - /** Creates a container based on this registry. @private @method container @param {Object} options @return {Container} created container */ container: function (options) { - var container = new _container.default(this, options); - - // 2.0TODO - remove `registerContainer` - this.registerContainer(container); - - return container; + return new _container.default(this, options); }, /** - Register the first container created for a registery to allow deprecated - access to its `lookup` and `lookupFactory` methods to avoid breaking - compatibility for Ember 1.x initializers. - 2.0TODO: Remove this method. The bookkeeping is only needed to support - deprecated behavior. - @private - @param {Container} newly created container - */ - registerContainer: function (container) { - if (!this._defaultContainer) { - this._defaultContainer = container; - } - if (this.fallback) { - this.fallback.registerContainer(container); - } - }, - - lookup: function (fullName, options) { - _emberMetalCore.default.assert('Create a container on the registry (with `registry.container()`) before calling `lookup`.', this._defaultContainer); - - if (instanceInitializersFeatureEnabled) { - _emberMetalCore.default.deprecate('`lookup` was called on a Registry. The `initializer` API no longer receives a container, and you should use an `instanceInitializer` to look up objects from the container.', false, { url: 'http://emberjs.com/guides/deprecations#toc_deprecate-access-to-instances-in-initializers' }); - } - - return this._defaultContainer.lookup(fullName, options); - }, - - lookupFactory: function (fullName) { - _emberMetalCore.default.assert('Create a container on the registry (with `registry.container()`) before calling `lookupFactory`.', this._defaultContainer); - - if (instanceInitializersFeatureEnabled) { - _emberMetalCore.default.deprecate('`lookupFactory` was called on a Registry. The `initializer` API no longer receives a container, and you should use an `instanceInitializer` to look up objects from the container.', false, { url: 'http://emberjs.com/guides/deprecations#toc_deprecate-access-to-instances-in-initializers' }); - } - - return this._defaultContainer.lookupFactory(fullName); - }, - - /** Registers a factory for later injection. Example: ```javascript var registry = new Registry(); registry.register('model:user', Person, {singleton: false }); @@ -1896,15 +1854,10 @@ } else if (this.fallback) { return this.fallback.getOption(fullName, optionName); } }, - option: function (fullName, optionName) { - _emberMetalCore.default.deprecate('`Registry.option()` has been deprecated. Call `Registry.getOption()` instead.'); - return this.getOption(fullName, optionName); - }, - /** Used only via `injection`. Provides a specialized form of injection, specifically enabling all objects of one type to be injected with a reference to another object. @@ -2213,10 +2166,12 @@ exports.default = Registry; }); // Ember.assert enifed("dag-map", ["exports"], function (exports) { + "use strict"; + function visit(vertex, fn, visited, path) { var name = vertex.name; var vertices = vertex.incoming; var names = vertex.incomingNames; var len = names.length; @@ -2371,20 +2326,20 @@ */ DAG.prototype.addEdges = function (name, value, before, after) { var i; this.map(name, value); if (before) { - if (typeof before === "string") { + if (typeof before === 'string') { this.addEdge(name, before); } else { for (i = 0; i < before.length; i++) { this.addEdge(name, before[i]); } } } if (after) { - if (typeof after === "string") { + if (typeof after === 'string') { this.addEdge(after, name); } else { for (i = 0; i < after.length; i++) { this.addEdge(after[i], name); } @@ -2393,53 +2348,55 @@ }; exports.default = DAG; }); enifed('dag-map.umd', ['exports', './dag-map'], function (exports, _dagMap) { + 'use strict'; /* global define:true module:true window: true */ if (typeof enifed === 'function' && enifed.amd) { enifed(function () { return _dagMap.default; }); } else if (typeof module !== 'undefined' && module.exports) { module.exports = _dagMap.default; - } else if (typeof this !== 'undefined') { - this['DAG'] = _dagMap.default; + } else if (typeof undefined !== 'undefined') { + undefined['DAG'] = _dagMap.default; } }); enifed("dom-helper", ["exports", "./htmlbars-runtime/morph", "./morph-attr", "./dom-helper/build-html-dom", "./dom-helper/classes", "./dom-helper/prop"], function (exports, _htmlbarsRuntimeMorph, _morphAttr, _domHelperBuildHtmlDom, _domHelperClasses, _domHelperProp) { + "use strict"; - var doc = typeof document === "undefined" ? false : document; + var doc = typeof document === 'undefined' ? false : document; var deletesBlankTextNodes = doc && (function (document) { - var element = document.createElement("div"); - element.appendChild(document.createTextNode("")); + var element = document.createElement('div'); + element.appendChild(document.createTextNode('')); var clonedElement = element.cloneNode(true); return clonedElement.childNodes.length === 0; })(doc); var ignoresCheckedAttribute = doc && (function (document) { - var element = document.createElement("input"); - element.setAttribute("checked", "checked"); + var element = document.createElement('input'); + element.setAttribute('checked', 'checked'); var clonedElement = element.cloneNode(false); return !clonedElement.checked; })(doc); var canRemoveSvgViewBoxAttribute = doc && (doc.createElementNS ? (function (document) { - var element = document.createElementNS(_domHelperBuildHtmlDom.svgNamespace, "svg"); - element.setAttribute("viewBox", "0 0 100 100"); - element.removeAttribute("viewBox"); - return !element.getAttribute("viewBox"); + var element = document.createElementNS(_domHelperBuildHtmlDom.svgNamespace, 'svg'); + element.setAttribute('viewBox', '0 0 100 100'); + element.removeAttribute('viewBox'); + return !element.getAttribute('viewBox'); })(doc) : true); var canClone = doc && (function (document) { - var element = document.createElement("div"); - element.appendChild(document.createTextNode(" ")); - element.appendChild(document.createTextNode(" ")); + var element = document.createElement('div'); + element.appendChild(document.createTextNode(' ')); + element.appendChild(document.createTextNode(' ')); var clonedElement = element.cloneNode(true); - return clonedElement.childNodes[0].nodeValue === " "; + return clonedElement.childNodes[0].nodeValue === ' '; })(doc); // This is not the namespace of the element, but of // the elements inside that elements. function interiorNamespace(element) { @@ -2476,24 +2433,24 @@ // var omittedStartTagChildTest = /<([\w:]+)/; function detectOmittedStartTag(string, contextualElement) { // Omitted start tags are only inside table tags. - if (contextualElement.tagName === "TABLE") { + if (contextualElement.tagName === 'TABLE') { var omittedStartTagChildMatch = omittedStartTagChildTest.exec(string); if (omittedStartTagChildMatch) { var omittedStartTagChild = omittedStartTagChildMatch[1]; // It is already asserted that the contextual element is a table // and not the proper start tag. Just see if a tag was omitted. - return omittedStartTagChild === "tr" || omittedStartTagChild === "col"; + return omittedStartTagChild === 'tr' || omittedStartTagChild === 'col'; } } } function buildSVGDOM(html, dom) { - var div = dom.document.createElement("div"); - div.innerHTML = "<svg>" + html + "</svg>"; + var div = dom.document.createElement('div'); + div.innerHTML = '<svg>' + html + '</svg>'; return div.firstChild.childNodes; } var guid = 1; @@ -2559,15 +2516,37 @@ prototype.appendChild = function (element, childElement) { return element.appendChild(childElement); }; + var itemAt; + + // It appears that sometimes, in yet to be itentified scenarios PhantomJS 2.0 + // crashes on childNodes.item(index), but works as expected with childNodes[index]; + // + // Although it would be nice to move to childNodes[index] in all scenarios, + // this would require SimpleDOM to maintain the childNodes array. This would be + // quite costly, in both dev time and runtime. + // + // So instead, we choose the best possible method and call it a day. + // + /*global navigator */ + if (typeof navigator !== 'undefined' && navigator.userAgent.indexOf('PhantomJS')) { + itemAt = function (nodes, index) { + return nodes[index]; + }; + } else { + itemAt = function (nodes, index) { + return nodes.item(index); + }; + } + prototype.childAt = function (element, indices) { var child = element; for (var i = 0; i < indices.length; i++) { - child = child.childNodes.item(indices[i]); + child = itemAt(child.childNodes, indices[i]); } return child; }; @@ -2644,11 +2623,11 @@ prototype.removeAttribute = function (element, name) { element.removeAttribute(name); }; } else { prototype.removeAttribute = function (element, name) { - if (element.tagName === "svg" && name === "viewBox") { + if (element.tagName === 'svg' && name === 'viewBox') { element.setAttribute(name, null); } else { element.removeAttribute(name); } }; @@ -2657,24 +2636,23 @@ prototype.setPropertyStrict = function (element, name, value) { if (value === undefined) { value = null; } - if (value === null && (name === "value" || name === "type" || name === "src")) { - value = ""; + if (value === null && (name === 'value' || name === 'type' || name === 'src')) { + value = ''; } element[name] = value; }; prototype.getPropertyStrict = function (element, name) { return element[name]; }; prototype.setProperty = function (element, name, value, namespace) { - var lowercaseName = name.toLowerCase(); - if (element.namespaceURI === _domHelperBuildHtmlDom.svgNamespace || lowercaseName === "style") { + if (element.namespaceURI === _domHelperBuildHtmlDom.svgNamespace) { if (_domHelperProp.isAttrRemovalValue(value)) { element.removeAttribute(name); } else { if (namespace) { element.setAttributeNS(namespace, name, value); @@ -2686,11 +2664,11 @@ var _normalizeProperty = _domHelperProp.normalizeProperty(element, name); var normalized = _normalizeProperty.normalized; var type = _normalizeProperty.type; - if (type === "prop") { + if (type === 'prop') { element[normalized] = value; } else { if (_domHelperProp.isAttrRemovalValue(value)) { element.removeAttribute(name); } else { @@ -2708,11 +2686,11 @@ // Only opt into namespace detection if a contextualElement // is passed. prototype.createElement = function (tagName, contextualElement) { var namespace = this.namespace; if (contextualElement) { - if (tagName === "svg") { + if (tagName === 'svg') { namespace = _domHelperBuildHtmlDom.svgNamespace; } else { namespace = interiorNamespace(contextualElement); } } @@ -2758,22 +2736,22 @@ }; prototype.repairClonedNode = function (element, blankChildTextNodes, isChecked) { if (deletesBlankTextNodes && blankChildTextNodes.length > 0) { for (var i = 0, len = blankChildTextNodes.length; i < len; i++) { - var textNode = this.document.createTextNode(""), + var textNode = this.document.createTextNode(''), offset = blankChildTextNodes[i], before = this.childAtIndex(element, offset); if (before) { element.insertBefore(textNode, before); } else { element.appendChild(textNode); } } } if (ignoresCheckedAttribute && isChecked) { - element.setAttribute("checked", "checked"); + element.setAttribute('checked', 'checked'); } }; prototype.cloneNode = function (element, deep) { var clone = element.cloneNode(!!deep); @@ -2825,11 +2803,11 @@ prototype.replaceContentWithMorph = function (element) { var firstChild = element.firstChild; if (!firstChild) { - var comment = this.createComment(""); + var comment = this.createComment(''); this.appendChild(element, comment); return _htmlbarsRuntimeMorph.default.create(this, element, comment); } else { var morph = _htmlbarsRuntimeMorph.default.attach(this, element, firstChild, element.lastChild); morph.clear(); @@ -2857,25 +2835,25 @@ morph.parseTextAsHTML = true; return morph; }; prototype.insertMorphBefore = function (element, referenceChild, contextualElement) { - var insertion = this.document.createComment(""); + var insertion = this.document.createComment(''); element.insertBefore(insertion, referenceChild); return this.createMorph(element, insertion, insertion, contextualElement); }; prototype.appendMorph = function (element, contextualElement) { - var insertion = this.document.createComment(""); + var insertion = this.document.createComment(''); element.appendChild(insertion); return this.createMorph(element, insertion, insertion, contextualElement); }; prototype.insertBoundary = function (fragment, index) { // this will always be null or firstChild var child = index === null ? null : this.childAtIndex(fragment, index); - this.insertBefore(fragment, this.createTextNode(""), child); + this.insertBefore(fragment, this.createTextNode(''), child); }; prototype.setMorphHTML = function (morph, html) { morph.setHTML(html); }; @@ -2904,11 +2882,11 @@ if (childNodes && childNodes.length > 0) { var currentNode = childNodes[0]; // We prepend an <option> to <select> boxes to absorb any browser bugs // related to auto-select behavior. Skip past it. - if (contextualElement.tagName === "SELECT") { + if (contextualElement.tagName === 'SELECT') { currentNode = currentNode.nextSibling; } while (currentNode) { var tempNode = currentNode; @@ -2924,21 +2902,23 @@ var parsingNode; // Used to determine whether a URL needs to be sanitized. prototype.protocolForURL = function (url) { if (!parsingNode) { - parsingNode = this.document.createElement("a"); + parsingNode = this.document.createElement('a'); } parsingNode.href = url; return parsingNode.protocol; }; exports.default = DOMHelper; }); enifed('dom-helper/build-html-dom', ['exports'], function (exports) { /* global XMLSerializer:false */ + 'use strict'; + var svgHTMLIntegrationPoints = { foreignObject: 1, desc: 1, title: 1 }; exports.svgHTMLIntegrationPoints = svgHTMLIntegrationPoints; var svgNamespace = 'http://www.w3.org/2000/svg'; exports.svgNamespace = svgNamespace; @@ -2950,30 +2930,30 @@ if (document.createElementNS === undefined) { return; } // In FF title will not accept innerHTML. var testEl = document.createElementNS(svgNamespace, 'title'); - testEl.innerHTML = '<div></div>'; + testEl.innerHTML = "<div></div>"; return testEl.childNodes.length === 0 || testEl.childNodes[0].nodeType !== 1; })(doc); // Internet Explorer prior to 9 does not allow setting innerHTML if the first element // is a "zero-scope" element. This problem can be worked around by making // the first node an invisible text node. We, like Modernizr, use &shy; var needsShy = doc && (function (document) { var testEl = document.createElement('div'); - testEl.innerHTML = '<div></div>'; - testEl.firstChild.innerHTML = '<script></script>'; + testEl.innerHTML = "<div></div>"; + testEl.firstChild.innerHTML = "<script><\/script>"; return testEl.firstChild.innerHTML === ''; })(doc); // IE 8 (and likely earlier) likes to move whitespace preceeding // a script tag to appear after it. This means that we can // accidentally remove whitespace when updating a morph. var movesWhitespace = doc && (function (document) { var testEl = document.createElement('div'); - testEl.innerHTML = 'Test: <script type=\'text/x-placeholder\'></script>Value'; + testEl.innerHTML = "Test: <script type='text/x-placeholder'><\/script>Value"; return testEl.childNodes[0].nodeValue === 'Test:' && testEl.childNodes[2].nodeValue === ' Value'; })(doc); var tagNamesRequiringInnerHTMLFix = doc && (function (document) { var tagNamesRequiringInnerHTMLFix; @@ -3025,11 +3005,11 @@ var shyElement = nodes[0]; while (shyElement.nodeType === 1 && !shyElement.nodeName) { shyElement = shyElement.firstChild; } // At this point it's the actual unicode character. - if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === '­') { + if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === "\u00AD") { var newValue = shyElement.nodeValue.slice(1); if (newValue.length) { shyElement.nodeValue = shyElement.nodeValue.slice(1); } else { shyElement.parentNode.removeChild(shyElement); @@ -3043,18 +3023,18 @@ var tagName = contextualElement.tagName; // Firefox versions < 11 do not have support for element.outerHTML. var outerHTML = contextualElement.outerHTML || new XMLSerializer().serializeToString(contextualElement); if (!outerHTML) { - throw 'Can\'t set innerHTML on ' + tagName + ' in this browser'; + throw "Can't set innerHTML on " + tagName + " in this browser"; } html = fixSelect(html, contextualElement); var wrappingTags = tagNamesRequiringInnerHTMLFix[tagName.toLowerCase()]; - var startTag = outerHTML.match(new RegExp('<' + tagName + '([^>]*)>', 'i'))[0]; + var startTag = outerHTML.match(new RegExp("<" + tagName + "([^>]*)>", 'i'))[0]; var endTag = '</' + tagName + '>'; var wrappedHTML = [startTag, html, endTag]; var i = wrappingTags.length; @@ -3098,11 +3078,11 @@ }; } function fixSelect(html, contextualElement) { if (contextualElement.tagName === 'SELECT') { - html = '<option></option>' + html; + html = "<option></option>" + html; } return html; } @@ -3190,10 +3170,12 @@ } exports.buildHTMLDOM = buildHTMLDOM; }); enifed('dom-helper/classes', ['exports'], function (exports) { + 'use strict'; + var doc = typeof document === 'undefined' ? false : document; // PhantomJS has a broken classList. See https://github.com/ariya/phantomjs/issues/12782 var canClassList = doc && (function () { var d = document.createElement('div'); @@ -3305,10 +3287,12 @@ exports.addClasses = addClasses; exports.removeClasses = removeClasses; }); enifed('dom-helper/prop', ['exports'], function (exports) { + 'use strict'; + exports.isAttrRemovalValue = isAttrRemovalValue; exports.normalizeProperty = normalizeProperty; function isAttrRemovalValue(value) { return value === null || value === undefined; @@ -3337,11 +3321,11 @@ type = 'attr'; normalized = slotName; } } - if (type === 'prop' && preferAttr(element.tagName, normalized)) { + if (type === 'prop' && (normalized.toLowerCase() === 'style' || preferAttr(element.tagName, normalized))) { type = 'attr'; } return { normalized: normalized, type: type }; } @@ -3382,12 +3366,12 @@ function preferAttr(tagName, propName) { var tag = ATTR_OVERRIDES[tagName.toUpperCase()]; return tag && tag[propName.toLowerCase()] || false; } }); -enifed('ember-application', ['exports', 'ember-metal/core', 'ember-runtime/system/lazy_load', 'ember-application/system/resolver', 'ember-application/system/application', 'ember-application/ext/controller'], function (exports, _emberMetalCore, _emberRuntimeSystemLazy_load, _emberApplicationSystemResolver, _emberApplicationSystemApplication, _emberApplicationExtController) { - // side effect of extending ControllerMixin +enifed('ember-application', ['exports', 'ember-metal/core', 'ember-runtime/system/lazy_load', 'ember-application/system/resolver', 'ember-application/system/application'], function (exports, _emberMetalCore, _emberRuntimeSystemLazy_load, _emberApplicationSystemResolver, _emberApplicationSystemApplication) { + 'use strict'; _emberMetalCore.default.Application = _emberApplicationSystemApplication.default; _emberMetalCore.default.Resolver = _emberApplicationSystemResolver.Resolver; _emberMetalCore.default.DefaultResolver = _emberApplicationSystemResolver.default; @@ -3396,41 +3380,19 @@ /** @module ember @submodule ember-application */ -enifed('ember-application/ext/controller', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-runtime/mixins/controller', 'ember-routing/system/controller_for'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeMixinsController, _emberRoutingSystemController_for) { - +enifed('ember-application/system/application-instance', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-runtime/system/object', 'ember-metal/run_loop', 'ember-metal/computed', 'container/registry'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemObject, _emberMetalRun_loop, _emberMetalComputed, _containerRegistry) { /** - @class ControllerMixin - @namespace Ember - @public + @module ember + @submodule ember-application + @private */ - _emberRuntimeMixinsController.default.reopen({ - /** - @method controllerFor - @see {Ember.Route#controllerFor} - @deprecated Use `Ember.inject.controller()` instead. - @public - */ - controllerFor: function (controllerName) { - _emberMetalCore.default.deprecate('Controller#controllerFor is deprecated, please use Ember.inject.controller() instead'); - return _emberRoutingSystemController_for.default(_emberMetalProperty_get.get(this, 'container'), controllerName); - } - }); - exports.default = _emberRuntimeMixinsController.default; -}); -/** -@module ember -@submodule ember-application -@public -*/ + 'use strict'; -// Ember.assert -enifed('ember-application/system/application-instance', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-runtime/system/object', 'ember-metal/run_loop', 'ember-metal/computed', 'container/registry'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemObject, _emberMetalRun_loop, _emberMetalComputed, _containerRegistry) { - /** The `ApplicationInstance` encapsulates all of the stateful aspects of a running `Application`. At a high-level, we break application boot into two distinct phases: @@ -3620,16 +3582,16 @@ this._super.apply(this, arguments); _emberMetalRun_loop.default(this.container, 'destroy'); } }); }); -/** -@module ember -@submodule ember-application -@private -*/ enifed('ember-application/system/application', ['exports', 'dag-map', 'container/registry', 'ember-metal', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-runtime/system/lazy_load', 'ember-runtime/system/namespace', 'ember-application/system/resolver', 'ember-metal/run_loop', 'ember-metal/utils', '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/views/link', 'ember-routing/services/routing', 'ember-extension-support/container_debug_adapter', 'ember-metal/environment'], function (exports, _dagMap, _containerRegistry, _emberMetal, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemLazy_load, _emberRuntimeSystemNamespace, _emberApplicationSystemResolver, _emberMetalRun_loop, _emberMetalUtils, _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, _emberRoutingViewsViewsLink, _emberRoutingServicesRouting, _emberExtensionSupportContainer_debug_adapter, _emberMetalEnvironment) { + /** + @module ember + @submodule ember-application + */ + 'use strict'; function props(obj) { var properties = []; for (var key in obj) { @@ -4073,22 +4035,10 @@ (_registry2 = this.registry).injection.apply(_registry2, arguments); }, /** - Calling initialize manually is not supported. - Please see Ember.Application#advanceReadiness and - Ember.Application#deferReadiness. - @private - @deprecated - @method initialize - **/ - initialize: function () { - _emberMetal.default.deprecate('Calling initialize manually is not supported. Please see Ember.Application#advanceReadiness and Ember.Application#deferReadiness'); - }, - - /** Initialize the application. This happens automatically. Run any initializers and run the application load hook. These hooks may choose to defer readiness. For example, an authentication hook might want to defer readiness until the auth token has been retrieved. @private @@ -4190,17 +4140,24 @@ _emberMetalRun_loop.default.join(this, handleReset); }, /** @private + @method instanceInitializer + */ + instanceInitializer: function (options) { + this.constructor.instanceInitializer(options); + }, + + /** + @private @method runInitializers */ runInitializers: function (registry) { var App = this; this._runInitializer('initializers', function (name, initializer) { _emberMetal.default.assert('No application initializer named \'' + name + '\'', !!initializer); - initializer.initialize(registry, App); }); }, runInstanceInitializers: function (instance) { @@ -4280,26 +4237,24 @@ this._super.apply(this, arguments); _emberMetal.default.BOOTED = false; this._bootPromise = null; this._bootResolver = null; + if (_emberRuntimeSystemLazy_load._loaded.application === this) { + _emberRuntimeSystemLazy_load._loaded.application = undefined; + } + if (this.__deprecatedInstance__) { this.__deprecatedInstance__.destroy(); } }, initializer: function (options) { this.constructor.initializer(options); } }); - Application.reopen({ - instanceInitializer: function (options) { - this.constructor.instanceInitializer(options); - } - }); - Application.reopenClass({ instanceInitializer: buildInitializerMethod('instanceInitializers', 'instance initializer') }); Application.reopenClass({ @@ -4518,13 +4473,11 @@ @method resolverFor @param {Ember.Namespace} namespace the namespace to look for classes @return {*} the resolved value for a given lookup */ function resolverFor(namespace) { - _emberMetal.default.deprecate('Application.resolver is deprecated in favor of Application.Resolver', !namespace.get('resolver')); - - var ResolverClass = namespace.get('resolver') || namespace.get('Resolver') || _emberApplicationSystemResolver.default; + var ResolverClass = namespace.get('Resolver') || _emberApplicationSystemResolver.default; var resolver = ResolverClass.create({ namespace: namespace }); function resolve(fullName) { @@ -4540,13 +4493,10 @@ }; resolve.normalize = function (fullName) { if (resolver.normalize) { return resolver.normalize(fullName); - } else { - _emberMetal.default.deprecate('The Resolver should now provide a \'normalize\' function', false); - return fullName; } }; resolve.knownForType = function knownForType(type) { if (resolver.knownForType) { @@ -4613,14 +4563,10 @@ }; } exports.default = Application; }); -/** -@module ember -@submodule ember-application -*/ // Ember.deprecate, Ember.assert, Ember.libraries, LOG_VERSION, Namespace, BOOTED // Create subclass of Ember.Router for this Application instance. // This is to ensure that someone reopening `App.Router` does not // tamper with the default `Ember.Router`. @@ -4638,10 +4584,17 @@ ``` @method visit @private */ enifed('ember-application/system/resolver', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/logger', 'ember-runtime/system/string', 'ember-runtime/system/object', 'ember-runtime/system/namespace', 'ember-htmlbars/helpers', 'ember-application/utils/validate-type', 'ember-metal/dictionary'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalLogger, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberRuntimeSystemNamespace, _emberHtmlbarsHelpers, _emberApplicationUtilsValidateType, _emberMetalDictionary) { + /** + @module ember + @submodule ember-application + */ + + 'use strict'; + var Resolver = _emberRuntimeSystemObject.default.extend({ /* This will be set to the Application instance when it is created. @property namespace @@ -4762,10 +4715,16 @@ result = result.replace(/_(.)/g, function (m) { return m.charAt(1).toUpperCase(); }); } + if (name.indexOf('-') > -1) { + result = result.replace(/-(.)/g, function (m) { + return m.charAt(1).toUpperCase(); + }); + } + return type + ':' + result; } else { return fullName; } }, @@ -4905,16 +4864,16 @@ @public */ resolveTemplate: function (parsedName) { var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/'); - if (_emberMetalCore.default.TEMPLATES[templateName]) { + if (_emberMetalCore.default.TEMPLATES.hasOwnProperty(templateName)) { return _emberMetalCore.default.TEMPLATES[templateName]; } templateName = _emberRuntimeSystemString.decamelize(templateName); - if (_emberMetalCore.default.TEMPLATES[templateName]) { + if (_emberMetalCore.default.TEMPLATES.hasOwnProperty(templateName)) { return _emberMetalCore.default.TEMPLATES[templateName]; } }, /** @@ -5073,17 +5032,19 @@ return type + ':' + dasherizedName; } }); }); -/** -@module ember -@submodule ember-application -*/ - // Ember.TEMPLATES, Ember.assert enifed('ember-application/utils/validate-type', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) { + /** + @module ember + @submodule ember-application + */ + + 'use strict'; + exports.default = validateType; var VALIDATED_TYPES = { route: ['assert', 'isRouteFactory', 'Ember.Route'], component: ['deprecate', 'isComponentFactory', 'Ember.Component'], @@ -5101,23 +5062,23 @@ var action = validationAttributes[0]; var factoryFlag = validationAttributes[1]; var expectedType = validationAttributes[2]; if (action === 'deprecate') { - _emberMetalCore.default.deprecate('In Ember 2.0 ' + parsedName.type + ' factories must have an `' + factoryFlag + '` ' + ('property set to true. You registered ' + resolvedType + ' as a ' + parsedName.type + ' ') + ('factory. Either add the `' + factoryFlag + '` property to this factory or ') + ('extend from ' + expectedType + '.'), resolvedType[factoryFlag]); + _emberMetalCore.default.deprecate('In Ember 2.0 ' + parsedName.type + ' factories must have an `' + factoryFlag + '` ' + ('property set to true. You registered ' + resolvedType + ' as a ' + parsedName.type + ' ') + ('factory. Either add the `' + factoryFlag + '` property to this factory or ') + ('extend from ' + expectedType + '.'), resolvedType[factoryFlag], { id: 'ember-application.validate-type', until: '3.0.0' }); } else { _emberMetalCore.default.assert('Expected ' + parsedName.fullName + ' to resolve to an ' + expectedType + ' but ' + ('instead it was ' + resolvedType + '.'), function () { return resolvedType[factoryFlag]; }); } } }); -/** -@module ember -@submodule ember-application -*/ enifed('ember-debug', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/error', 'ember-metal/logger', 'ember-debug/deprecation-manager', 'ember-metal/environment'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalError, _emberMetalLogger, _emberDebugDeprecationManager, _emberMetalEnvironment) { + /*global __fail__*/ + + 'use strict'; + exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags; /** @module ember @submodule ember-debug @@ -5435,12 +5396,13 @@ exports.runningNonEmberDebugJS = runningNonEmberDebugJS; if (runningNonEmberDebugJS) { _emberMetalCore.default.warn('Please use `ember.debug.js` instead of `ember.js` for development and debugging.'); } }); -/*global __fail__*/ enifed('ember-debug/deprecation-manager', ['exports', 'ember-metal/dictionary', 'ember-metal/utils'], function (exports, _emberMetalDictionary, _emberMetalUtils) { + 'use strict'; + var deprecationLevels = { RAISE: _emberMetalUtils.symbol('RAISE'), LOG: _emberMetalUtils.symbol('LOG'), SILENCE: _emberMetalUtils.symbol('SILENCE') }; @@ -5463,19 +5425,22 @@ return level; } }; }); enifed('ember-extension-support', ['exports', 'ember-metal/core', 'ember-extension-support/data_adapter', 'ember-extension-support/container_debug_adapter'], function (exports, _emberMetalCore, _emberExtensionSupportData_adapter, _emberExtensionSupportContainer_debug_adapter) { + /** + @module ember + @submodule ember-extension-support + */ + 'use strict'; + _emberMetalCore.default.DataAdapter = _emberExtensionSupportData_adapter.default; _emberMetalCore.default.ContainerDebugAdapter = _emberExtensionSupportContainer_debug_adapter.default; }); -/** -@module ember -@submodule ember-extension-support -*/ enifed('ember-extension-support/container_debug_adapter', ['exports', 'ember-metal/core', 'ember-runtime/system/native_array', 'ember-runtime/utils', 'ember-runtime/system/string', 'ember-runtime/system/namespace', 'ember-runtime/system/object'], function (exports, _emberMetalCore, _emberRuntimeSystemNative_array, _emberRuntimeUtils, _emberRuntimeSystemString, _emberRuntimeSystemNamespace, _emberRuntimeSystemObject) { + 'use strict'; /** @module ember @submodule ember-extension-support */ @@ -5582,10 +5547,11 @@ return types; } }); }); enifed('ember-extension-support/data_adapter', ['exports', 'ember-metal/property_get', 'ember-metal/run_loop', 'ember-runtime/system/string', 'ember-runtime/system/namespace', 'ember-runtime/system/object', 'ember-runtime/system/native_array', 'ember-application/system/application'], function (exports, _emberMetalProperty_get, _emberMetalRun_loop, _emberRuntimeSystemString, _emberRuntimeSystemNamespace, _emberRuntimeSystemObject, _emberRuntimeSystemNative_array, _emberApplicationSystemApplication) { + 'use strict'; /** @module ember @submodule ember-extension-support */ @@ -6072,12 +6038,109 @@ observeRecord: function (record, recordUpdated) { return function () {}; } }); }); -enifed('ember-htmlbars', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-template-compiler', 'ember-htmlbars/system/make-view-helper', '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/system/dom-helper', 'ember-htmlbars/helper', 'ember-htmlbars/system/bootstrap', 'ember-htmlbars/compat'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberTemplateCompiler, _emberHtmlbarsSystemMakeViewHelper, _emberHtmlbarsSystemMake_bound_helper, _emberHtmlbarsHelpers, _emberHtmlbarsHelpersIf_unless, _emberHtmlbarsHelpersWith, _emberHtmlbarsHelpersLoc, _emberHtmlbarsHelpersLog, _emberHtmlbarsHelpersEach, _emberHtmlbarsHelpersEachIn, _emberHtmlbarsHelpersNormalizeClass, _emberHtmlbarsHelpersConcat, _emberHtmlbarsHelpersJoinClasses, _emberHtmlbarsHelpersLegacyEachWithController, _emberHtmlbarsHelpersLegacyEachWithKeyword, _emberHtmlbarsHelpersHtmlSafe, _emberHtmlbarsSystemDomHelper, _emberHtmlbarsHelper, _emberHtmlbarsSystemBootstrap, _emberHtmlbarsCompat) { +enifed('ember-htmlbars', ['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/system/dom-helper', 'ember-htmlbars/helper', '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, _emberHtmlbarsSystemDomHelper, _emberHtmlbarsHelper, _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 + + Templates manage the flow of an application's UI, and display state (through + the DOM) to a user. For example, given a component with the property "name", + that component's template can use the name in several ways: + + ```javascript + // app/components/person.js + export default Ember.Component.extend({ + name: 'Jill' + }); + ``` + + ```handlebars + {{! app/components/person.hbs }} + {{name}} + <div>{{name}}</div> + <span data-name={{name}}></span> + ``` + + Any time the "name" property on the component changes, the DOM will be + updated. + + Properties can be chained as well: + + ```handlebars + {{aUserModel.name}} + <div>{{listOfUsers.firstObject.name}}</div> + ``` + + ### Using Ember helpers + + When content is passed in mustaches `{{}}`, Ember will first try to find a helper + or component with that name. For example, the `if` helper: + + ```handlebars + {{if name "I have a name" "I have no name"}} + <span data-has-name={{if name true}}></span> + ``` + + The returned value is placed where the `{{}}` is called. The above style is + called "inline". A second style of helper usage is called "block". For example: + + ```handlebars + {{#if name}} + I have a name + {{else}} + I have no name + {{/if}} + ``` + + The block form of helpers allows you to control how the UI is created based + on the values of properties. + + A third form of helper is called "nested". For example here the concat + helper will add " Doe" to a displayed name if the person has no last name: + + ```handlebars + <span data-name={{concat firstName ( + if lastName (concat " " lastName) "Doe" + )}}></span> + ``` + + Ember's built-in helpers are described under the [Ember.Templates.helpers](/api/classes/Ember.Templates.helpers.html) + namespace. Documentation on creating custom helpers can be found under + [Ember.Helper](/api/classes/Ember.Helper.html). + + ### Invoking a Component + + Ember components represent state to the UI of an application. Further + reading on components can be found under [Ember.Component](/api/classes/Ember.Component.html). + + @module ember + @submodule ember-templates + @main ember-templates + @public + */ + /** + + [HTMLBars](https://github.com/tildeio/htmlbars) is a [Handlebars](http://handlebarsjs.com/) + compatible templating engine used by Ember.js. The classes and namespaces + covered by this documentation attempt to focus on APIs for interacting + with HTMLBars itself. For more general guidance on Ember.js templates and + helpers, please see the [ember-templates](/api/modules/ember-templates.html) + package. + + @module ember + @submodule ember-htmlbars + @main ember-htmlbars + @public + */ + 'use strict'; + _emberHtmlbarsHelpers.registerHelper('if', _emberHtmlbarsHelpersIf_unless.ifHelper); _emberHtmlbarsHelpers.registerHelper('unless', _emberHtmlbarsHelpersIf_unless.unlessHelper); _emberHtmlbarsHelpers.registerHelper('with', _emberHtmlbarsHelpersWith.default); _emberHtmlbarsHelpers.registerHelper('loc', _emberHtmlbarsHelpersLoc.default); _emberHtmlbarsHelpers.registerHelper('log', _emberHtmlbarsHelpersLog.default); @@ -6094,423 +6157,42 @@ _emberHtmlbarsHelpers.registerHelper('-legacy-each-with-controller', _emberHtmlbarsHelpersLegacyEachWithController.default); _emberHtmlbarsHelpers.registerHelper('-legacy-each-with-keyword', _emberHtmlbarsHelpersLegacyEachWithKeyword.default); } _emberMetalCore.default.HTMLBars = { - _registerHelper: _emberHtmlbarsHelpers.registerHelper, template: _emberTemplateCompiler.template, compile: _emberTemplateCompiler.compile, precompile: _emberTemplateCompiler.precompile, - makeViewHelper: _emberHtmlbarsSystemMakeViewHelper.default, makeBoundHelper: _emberHtmlbarsSystemMake_bound_helper.default, registerPlugin: _emberTemplateCompiler.registerPlugin, DOMHelper: _emberHtmlbarsSystemDomHelper.default }; _emberHtmlbarsHelper.default.helper = _emberHtmlbarsHelper.helper; _emberMetalCore.default.Helper = _emberHtmlbarsHelper.default; }); -/** - &nbsp; - - @module ember - @submodule ember-templates - @main ember-templates - @public -*/ - -/** - - [HTMLBars](https://github.com/tildeio/htmlbars) is a [Handlebars](http://handlebarsjs.com/) - compatible templating engine used by Ember.js. The classes and namespaces - covered by this documentation attempt to focus on APIs for interacting - with HTMLBars itself. For more general guidance on Ember.js templates and - helpers, please see the [ember-templates](/api/modules/ember-templates.html) - package. - - @module ember - @submodule ember-htmlbars - @main ember-htmlbars - @public -*/ - // importing adds template bootstrapping // initializer to enable embedded templates // importing ember-htmlbars/compat updates the // Ember.Handlebars global if htmlbars is enabled -enifed('ember-htmlbars/compat', ['exports', 'ember-metal/core', 'ember-htmlbars/helpers', 'ember-htmlbars/compat/helper', 'ember-htmlbars/compat/make-bound-helper', 'ember-htmlbars/compat/register-bound-helper', 'ember-htmlbars/system/make-view-helper', 'ember-htmlbars/utils/string'], function (exports, _emberMetalCore, _emberHtmlbarsHelpers, _emberHtmlbarsCompatHelper, _emberHtmlbarsCompatMakeBoundHelper, _emberHtmlbarsCompatRegisterBoundHelper, _emberHtmlbarsSystemMakeViewHelper, _emberHtmlbarsUtilsString) { +enifed('ember-htmlbars/compat', ['exports', 'ember-metal/core', 'ember-htmlbars/utils/string'], function (exports, _emberMetalCore, _emberHtmlbarsUtilsString) { + 'use strict'; var EmberHandlebars = _emberMetalCore.default.Handlebars = _emberMetalCore.default.Handlebars || {}; - EmberHandlebars.helpers = _emberHtmlbarsHelpers.default; - EmberHandlebars.helper = _emberHtmlbarsCompatHelper.handlebarsHelper; - EmberHandlebars.registerHelper = _emberHtmlbarsCompatHelper.registerHandlebarsCompatibleHelper; - EmberHandlebars.registerBoundHelper = _emberHtmlbarsCompatRegisterBoundHelper.default; - EmberHandlebars.makeBoundHelper = _emberHtmlbarsCompatMakeBoundHelper.default; - EmberHandlebars.makeViewHelper = _emberHtmlbarsSystemMakeViewHelper.default; EmberHandlebars.SafeString = _emberHtmlbarsUtilsString.SafeString; EmberHandlebars.Utils = { escapeExpression: _emberHtmlbarsUtilsString.escapeExpression }; exports.default = EmberHandlebars; }); -enifed('ember-htmlbars/compat/helper', ['exports', 'ember-metal/core', 'ember-htmlbars/helpers', 'ember-views/views/view', 'ember-views/views/component', 'ember-htmlbars/system/make-view-helper', 'ember-htmlbars/compat/make-bound-helper', 'ember-metal/streams/utils', 'ember-htmlbars/keywords'], function (exports, _emberMetalCore, _emberHtmlbarsHelpers, _emberViewsViewsView, _emberViewsViewsComponent, _emberHtmlbarsSystemMakeViewHelper, _emberHtmlbarsCompatMakeBoundHelper, _emberMetalStreamsUtils, _emberHtmlbarsKeywords) { - exports.registerHandlebarsCompatibleHelper = registerHandlebarsCompatibleHelper; - exports.handlebarsHelper = handlebarsHelper; +enifed('ember-htmlbars/env', ['exports', 'ember-metal', 'ember-metal/features', 'ember-metal/environment', 'htmlbars-runtime', 'ember-metal/merge', 'ember-htmlbars/hooks/subexpr', 'ember-htmlbars/hooks/concat', 'ember-htmlbars/hooks/link-render-node', 'ember-htmlbars/hooks/create-fresh-scope', 'ember-htmlbars/hooks/bind-shadow-scope', 'ember-htmlbars/hooks/bind-self', 'ember-htmlbars/hooks/bind-scope', 'ember-htmlbars/hooks/bind-local', 'ember-htmlbars/hooks/update-self', 'ember-htmlbars/hooks/get-root', 'ember-htmlbars/hooks/get-child', 'ember-htmlbars/hooks/get-value', 'ember-htmlbars/hooks/get-cell-or-value', 'ember-htmlbars/hooks/cleanup-render-node', 'ember-htmlbars/hooks/destroy-render-node', 'ember-htmlbars/hooks/did-render-node', 'ember-htmlbars/hooks/will-cleanup-tree', 'ember-htmlbars/hooks/did-cleanup-tree', 'ember-htmlbars/hooks/classify', 'ember-htmlbars/hooks/component', 'ember-htmlbars/hooks/lookup-helper', 'ember-htmlbars/hooks/has-helper', 'ember-htmlbars/hooks/invoke-helper', 'ember-htmlbars/hooks/element', 'ember-htmlbars/helpers', 'ember-htmlbars/keywords', 'ember-htmlbars/system/dom-helper', 'ember-htmlbars/keywords/debugger', 'ember-htmlbars/keywords/with', 'ember-htmlbars/keywords/outlet', 'ember-htmlbars/keywords/unbound', 'ember-htmlbars/keywords/view', 'ember-htmlbars/keywords/component', 'ember-htmlbars/keywords/partial', 'ember-htmlbars/keywords/input', 'ember-htmlbars/keywords/textarea', 'ember-htmlbars/keywords/collection', 'ember-htmlbars/keywords/legacy-yield', 'ember-htmlbars/keywords/mut', 'ember-htmlbars/keywords/each', 'ember-htmlbars/keywords/readonly', 'ember-htmlbars/keywords/get'], function (exports, _emberMetal, _emberMetalFeatures, _emberMetalEnvironment, _htmlbarsRuntime, _emberMetalMerge, _emberHtmlbarsHooksSubexpr, _emberHtmlbarsHooksConcat, _emberHtmlbarsHooksLinkRenderNode, _emberHtmlbarsHooksCreateFreshScope, _emberHtmlbarsHooksBindShadowScope, _emberHtmlbarsHooksBindSelf, _emberHtmlbarsHooksBindScope, _emberHtmlbarsHooksBindLocal, _emberHtmlbarsHooksUpdateSelf, _emberHtmlbarsHooksGetRoot, _emberHtmlbarsHooksGetChild, _emberHtmlbarsHooksGetValue, _emberHtmlbarsHooksGetCellOrValue, _emberHtmlbarsHooksCleanupRenderNode, _emberHtmlbarsHooksDestroyRenderNode, _emberHtmlbarsHooksDidRenderNode, _emberHtmlbarsHooksWillCleanupTree, _emberHtmlbarsHooksDidCleanupTree, _emberHtmlbarsHooksClassify, _emberHtmlbarsHooksComponent, _emberHtmlbarsHooksLookupHelper, _emberHtmlbarsHooksHasHelper, _emberHtmlbarsHooksInvokeHelper, _emberHtmlbarsHooksElement, _emberHtmlbarsHelpers, _emberHtmlbarsKeywords, _emberHtmlbarsSystemDomHelper, _emberHtmlbarsKeywordsDebugger, _emberHtmlbarsKeywordsWith, _emberHtmlbarsKeywordsOutlet, _emberHtmlbarsKeywordsUnbound, _emberHtmlbarsKeywordsView, _emberHtmlbarsKeywordsComponent, _emberHtmlbarsKeywordsPartial, _emberHtmlbarsKeywordsInput, _emberHtmlbarsKeywordsTextarea, _emberHtmlbarsKeywordsCollection, _emberHtmlbarsKeywordsLegacyYield, _emberHtmlbarsKeywordsMut, _emberHtmlbarsKeywordsEach, _emberHtmlbarsKeywordsReadonly, _emberHtmlbarsKeywordsGet) { + 'use strict'; - var slice = [].slice; - - function calculateCompatType(item) { - if (_emberMetalStreamsUtils.isStream(item)) { - return 'ID'; - } else { - var itemType = typeof item; - - return itemType.toUpperCase(); - } - } - - function pathFor(param) { - if (_emberMetalStreamsUtils.isStream(param)) { - // param arguments to helpers may have their path prefixes with self. For - // example {{box-thing foo}} may have a param path of `self.foo` depending - // on scope. - if (param.source && param.source.dependee && param.source.dependee.label === 'self') { - return param.path.slice(5); - } else { - return param.path; - } - } else { - return param; - } - } - - /** - Wraps an Handlebars helper with an HTMLBars helper for backwards compatibility. - - @class HandlebarsCompatibleHelper - @constructor - @private - */ - function HandlebarsCompatibleHelper(fn) { - this.helperFunction = function helperFunc(params, hash, options, env, scope) { - var param, fnResult; - var hasBlock = options.template && options.template.yield; - - var handlebarsOptions = { - hash: {}, - types: new Array(params.length), - hashTypes: {} - }; - - handlebarsOptions.hash = {}; - - if (hasBlock) { - handlebarsOptions.fn = function () { - options.template.yield(); - }; - - if (options.inverse.yield) { - handlebarsOptions.inverse = function () { - options.inverse.yield(); - }; - } - } - - for (var prop in hash) { - param = hash[prop]; - handlebarsOptions.hashTypes[prop] = calculateCompatType(param); - handlebarsOptions.hash[prop] = pathFor(param); - } - - var args = new Array(params.length); - for (var i = 0, l = params.length; i < l; i++) { - param = params[i]; - handlebarsOptions.types[i] = calculateCompatType(param); - args[i] = pathFor(param); - } - - handlebarsOptions.legacyGetPath = function (path) { - return env.hooks.get(env, scope, path).value(); - }; - - handlebarsOptions.data = { - view: scope.view - }; - - args.push(handlebarsOptions); - - fnResult = fn.apply(this, args); - - if (options.element) { - _emberMetalCore.default.deprecate('Returning a string of attributes from a helper inside an element is deprecated.'); - applyAttributes(env.dom, options.element, fnResult); - } else if (!options.template.yield) { - return fnResult; - } - }; - - this.isHTMLBars = true; - } - - HandlebarsCompatibleHelper.prototype = { - preprocessArguments: function () {} - }; - - function registerHandlebarsCompatibleHelper(name, value) { - if (value && value.isLegacyViewHelper) { - _emberHtmlbarsKeywords.registerKeyword(name, function (morph, env, scope, params, hash, template, inverse, visitor) { - _emberMetalCore.default.assert('You can only pass attributes (such as name=value) not bare ' + 'values to a helper for a View found in \'' + value.viewClass + '\'', params.length === 0); - - env.hooks.keyword('view', morph, env, scope, [value.viewClass], hash, template, inverse, visitor); - return true; - }); - return; - } - - var helper; - - if (value && value.isHTMLBars) { - helper = value; - } else { - helper = new HandlebarsCompatibleHelper(value); - } - - _emberHtmlbarsHelpers.default[name] = helper; - } - - function handlebarsHelper(name, value) { - _emberMetalCore.default.assert('You tried to register a component named \'' + name + '\', but component names must include a \'-\'', !_emberViewsViewsComponent.default.detect(value) || name.match(/-/)); - - if (_emberViewsViewsView.default.detect(value)) { - _emberHtmlbarsHelpers.default[name] = _emberHtmlbarsSystemMakeViewHelper.default(value); - } else { - var boundHelperArgs = slice.call(arguments, 1); - var boundFn = _emberHtmlbarsCompatMakeBoundHelper.default.apply(this, boundHelperArgs); - - _emberHtmlbarsHelpers.default[name] = boundFn; - } - } - - function applyAttributes(dom, element, innerString) { - var string = '<' + element.tagName + ' ' + innerString + '></div>'; - var fragment = dom.parseHTML(string, dom.createElement(element.tagName)); - - var attrs = fragment.firstChild.attributes; - - for (var i = 0, l = attrs.length; i < l; i++) { - element.setAttributeNode(attrs[i].cloneNode()); - } - } - - exports.default = HandlebarsCompatibleHelper; -}); -/** -@module ember -@submodule ember-htmlbars -*/ -enifed('ember-htmlbars/compat/make-bound-helper', ['exports', 'ember-metal/core', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberMetalStreamsUtils) { - exports.default = makeBoundHelper; - - /** - @module ember - @submodule ember-htmlbars - */ - - /** - A helper function used by `registerBoundHelper`. Takes the - provided Handlebars helper function fn and returns it in wrapped - bound helper form. - - The main use case for using this outside of `registerBoundHelper` - is for registering helpers on the container: - - ```js - var boundHelperFn = Ember.Handlebars.makeBoundHelper(function(word) { - return word.toUpperCase(); - }); - - container.register('helper:my-bound-helper', boundHelperFn); - ``` - - In the above example, if the helper function hadn't been wrapped in - `makeBoundHelper`, the registered helper would be unbound. - - @method makeBoundHelper - @for Ember.Handlebars - @param {Function} fn - @param {String} dependentKeys* - @since 1.2.0 - @deprecated - @private - */ - - function makeBoundHelper(fn) { - for (var _len = arguments.length, dependentKeys = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - dependentKeys[_key - 1] = arguments[_key]; - } - - return { - _dependentKeys: dependentKeys, - - isHandlebarsCompat: true, - isHTMLBars: true, - - helperFunction: function (params, hash, templates) { - _emberMetalCore.default.assert('registerBoundHelper-generated helpers do not support use with Handlebars blocks.', !templates.template.yield); - - var args = _emberMetalStreamsUtils.readArray(params); - var properties = new Array(params.length); - - for (var i = 0, l = params.length; i < l; i++) { - var param = params[i]; - - if (_emberMetalStreamsUtils.isStream(param)) { - properties[i] = param.label; - } else { - properties[i] = param; - } - } - - args.push({ hash: _emberMetalStreamsUtils.readHash(hash), templates: templates, data: { properties: properties } }); - return fn.apply(undefined, args); - } - }; - } -}); -enifed('ember-htmlbars/compat/register-bound-helper', ['exports', 'ember-htmlbars/helpers', 'ember-htmlbars/compat/make-bound-helper'], function (exports, _emberHtmlbarsHelpers, _emberHtmlbarsCompatMakeBoundHelper) { - exports.default = registerBoundHelper; - - var slice = [].slice; - - /** - Register a bound handlebars helper. Bound helpers behave similarly to regular - handlebars helpers, with the added ability to re-render when the underlying data - changes. - - ## Simple example - - ```javascript - Ember.Handlebars.registerBoundHelper('capitalize', function(value) { - return Ember.String.capitalize(value); - }); - ``` - - The above bound helper can be used inside of templates as follows: - - ```handlebars - {{capitalize name}} - ``` - - In this case, when the `name` property of the template's context changes, - the rendered value of the helper will update to reflect this change. - - ## Example with options - - Like normal handlebars helpers, bound helpers have access to the options - passed into the helper call. - - ```javascript - Ember.Handlebars.registerBoundHelper('repeat', function(value, options) { - var count = options.hash.count; - var a = []; - while(a.length < count) { - a.push(value); - } - return a.join(''); - }); - ``` - - This helper could be used in a template as follows: - - ```handlebars - {{repeat text count=3}} - ``` - - ## Example with bound options - - Bound hash options are also supported. Example: - - ```handlebars - {{repeat text count=numRepeats}} - ``` - - In this example, count will be bound to the value of - the `numRepeats` property on the context. If that property - changes, the helper will be re-rendered. - - ## Example with extra dependencies - - The `Ember.Handlebars.registerBoundHelper` method takes a variable length - third parameter which indicates extra dependencies on the passed in value. - This allows the handlebars helper to update when these dependencies change. - - ```javascript - Ember.Handlebars.registerBoundHelper('capitalizeName', function(value) { - return value.get('name').toUpperCase(); - }, 'name'); - ``` - - ## Example with multiple bound properties - - `Ember.Handlebars.registerBoundHelper` supports binding to - multiple properties, e.g.: - - ```javascript - Ember.Handlebars.registerBoundHelper('concatenate', function() { - var values = Array.prototype.slice.call(arguments, 0, -1); - return values.join('||'); - }); - ``` - - Which allows for template syntax such as `{{concatenate prop1 prop2}}` or - `{{concatenate prop1 prop2 prop3}}`. If any of the properties change, - the helper will re-render. Note that dependency keys cannot be - using in conjunction with multi-property helpers, since it is ambiguous - which property the dependent keys would belong to. - - ## Use with unbound helper - - The `{{unbound}}` helper can be used with bound helper invocations - to render them in their unbound form, e.g. - - ```handlebars - {{unbound capitalize name}} - ``` - - In this example, if the name property changes, the helper - will not re-render. - - ## Use with blocks not supported - - Bound helpers do not support use with Handlebars blocks or - the addition of child views of any kind. - - @method registerBoundHelper - @for Ember.Handlebars - @param {String} name - @param {Function} fn - @param {String} dependentKeys* - @private - */ - - function registerBoundHelper(name, fn) { - var boundHelperArgs = slice.call(arguments, 1); - var boundFn = _emberHtmlbarsCompatMakeBoundHelper.default.apply(this, boundHelperArgs); - - _emberHtmlbarsHelpers.default[name] = boundFn; - } -}); -/** -@module ember -@submodule ember-htmlbars -*/ -enifed('ember-htmlbars/env', ['exports', 'ember-metal', 'ember-metal/features', 'ember-metal/environment', 'htmlbars-runtime', 'ember-metal/merge', 'ember-htmlbars/hooks/subexpr', 'ember-htmlbars/hooks/concat', 'ember-htmlbars/hooks/link-render-node', 'ember-htmlbars/hooks/create-fresh-scope', 'ember-htmlbars/hooks/bind-shadow-scope', 'ember-htmlbars/hooks/bind-self', 'ember-htmlbars/hooks/bind-scope', 'ember-htmlbars/hooks/bind-local', 'ember-htmlbars/hooks/update-self', 'ember-htmlbars/hooks/get-root', 'ember-htmlbars/hooks/get-child', 'ember-htmlbars/hooks/get-value', 'ember-htmlbars/hooks/get-cell-or-value', 'ember-htmlbars/hooks/cleanup-render-node', 'ember-htmlbars/hooks/destroy-render-node', 'ember-htmlbars/hooks/did-render-node', 'ember-htmlbars/hooks/will-cleanup-tree', 'ember-htmlbars/hooks/did-cleanup-tree', 'ember-htmlbars/hooks/classify', 'ember-htmlbars/hooks/component', 'ember-htmlbars/hooks/lookup-helper', 'ember-htmlbars/hooks/has-helper', 'ember-htmlbars/hooks/invoke-helper', 'ember-htmlbars/hooks/element', 'ember-htmlbars/helpers', 'ember-htmlbars/keywords', 'ember-htmlbars/system/dom-helper', 'ember-htmlbars/keywords/debugger', 'ember-htmlbars/keywords/with', 'ember-htmlbars/keywords/outlet', 'ember-htmlbars/keywords/real_outlet', 'ember-htmlbars/keywords/customized_outlet', 'ember-htmlbars/keywords/unbound', 'ember-htmlbars/keywords/view', 'ember-htmlbars/keywords/component', 'ember-htmlbars/keywords/partial', 'ember-htmlbars/keywords/input', 'ember-htmlbars/keywords/textarea', 'ember-htmlbars/keywords/collection', 'ember-htmlbars/keywords/template', 'ember-htmlbars/keywords/legacy-yield', 'ember-htmlbars/keywords/mut', 'ember-htmlbars/keywords/each', 'ember-htmlbars/keywords/readonly', 'ember-htmlbars/keywords/get'], function (exports, _emberMetal, _emberMetalFeatures, _emberMetalEnvironment, _htmlbarsRuntime, _emberMetalMerge, _emberHtmlbarsHooksSubexpr, _emberHtmlbarsHooksConcat, _emberHtmlbarsHooksLinkRenderNode, _emberHtmlbarsHooksCreateFreshScope, _emberHtmlbarsHooksBindShadowScope, _emberHtmlbarsHooksBindSelf, _emberHtmlbarsHooksBindScope, _emberHtmlbarsHooksBindLocal, _emberHtmlbarsHooksUpdateSelf, _emberHtmlbarsHooksGetRoot, _emberHtmlbarsHooksGetChild, _emberHtmlbarsHooksGetValue, _emberHtmlbarsHooksGetCellOrValue, _emberHtmlbarsHooksCleanupRenderNode, _emberHtmlbarsHooksDestroyRenderNode, _emberHtmlbarsHooksDidRenderNode, _emberHtmlbarsHooksWillCleanupTree, _emberHtmlbarsHooksDidCleanupTree, _emberHtmlbarsHooksClassify, _emberHtmlbarsHooksComponent, _emberHtmlbarsHooksLookupHelper, _emberHtmlbarsHooksHasHelper, _emberHtmlbarsHooksInvokeHelper, _emberHtmlbarsHooksElement, _emberHtmlbarsHelpers, _emberHtmlbarsKeywords, _emberHtmlbarsSystemDomHelper, _emberHtmlbarsKeywordsDebugger, _emberHtmlbarsKeywordsWith, _emberHtmlbarsKeywordsOutlet, _emberHtmlbarsKeywordsReal_outlet, _emberHtmlbarsKeywordsCustomized_outlet, _emberHtmlbarsKeywordsUnbound, _emberHtmlbarsKeywordsView, _emberHtmlbarsKeywordsComponent, _emberHtmlbarsKeywordsPartial, _emberHtmlbarsKeywordsInput, _emberHtmlbarsKeywordsTextarea, _emberHtmlbarsKeywordsCollection, _emberHtmlbarsKeywordsTemplate, _emberHtmlbarsKeywordsLegacyYield, _emberHtmlbarsKeywordsMut, _emberHtmlbarsKeywordsEach, _emberHtmlbarsKeywordsReadonly, _emberHtmlbarsKeywordsGet) { - var emberHooks = _emberMetalMerge.default({}, _htmlbarsRuntime.hooks); emberHooks.keywords = _emberHtmlbarsKeywords.default; _emberMetalMerge.default(emberHooks, { linkRenderNode: _emberHtmlbarsHooksLinkRenderNode.default, @@ -6540,16 +6222,13 @@ }); _emberHtmlbarsKeywords.registerKeyword('debugger', _emberHtmlbarsKeywordsDebugger.default); _emberHtmlbarsKeywords.registerKeyword('with', _emberHtmlbarsKeywordsWith.default); _emberHtmlbarsKeywords.registerKeyword('outlet', _emberHtmlbarsKeywordsOutlet.default); - _emberHtmlbarsKeywords.registerKeyword('@real_outlet', _emberHtmlbarsKeywordsReal_outlet.default); - _emberHtmlbarsKeywords.registerKeyword('@customized_outlet', _emberHtmlbarsKeywordsCustomized_outlet.default); _emberHtmlbarsKeywords.registerKeyword('unbound', _emberHtmlbarsKeywordsUnbound.default); _emberHtmlbarsKeywords.registerKeyword('component', _emberHtmlbarsKeywordsComponent.default); _emberHtmlbarsKeywords.registerKeyword('partial', _emberHtmlbarsKeywordsPartial.default); - _emberHtmlbarsKeywords.registerKeyword('template', _emberHtmlbarsKeywordsTemplate.default); _emberHtmlbarsKeywords.registerKeyword('input', _emberHtmlbarsKeywordsInput.default); _emberHtmlbarsKeywords.registerKeyword('textarea', _emberHtmlbarsKeywordsTextarea.default); _emberHtmlbarsKeywords.registerKeyword('collection', _emberHtmlbarsKeywordsCollection.default); _emberHtmlbarsKeywords.registerKeyword('legacy-yield', _emberHtmlbarsKeywordsLegacyYield.default); _emberHtmlbarsKeywords.registerKeyword('mut', _emberHtmlbarsKeywordsMut.default); @@ -6571,10 +6250,17 @@ var domHelper = _emberMetalEnvironment.default.hasDOM ? new _emberHtmlbarsSystemDomHelper.default() : null; exports.domHelper = domHelper; }); enifed('ember-htmlbars/helper', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { + /** + @module ember + @submodule ember-templates + */ + + 'use strict'; + exports.helper = helper; /** Ember Helpers are functions that can compute values, and are used in templates. For example, this code calls a helper named `format-currency`: @@ -6613,11 +6299,11 @@ @class Ember.Helper @public */ var Helper = _emberRuntimeSystemObject.default.extend({ - isHelper: true, + isHelperInstance: true, /** On a class-based helper, it may be useful to force a recomputation of that helpers value. This is akin to `rerender` on a component. For example, this component will rerender when the `currentUser` on a @@ -6681,25 +6367,23 @@ }; } exports.default = Helper; }); -/** -@module ember -@submodule ember-templates -*/ enifed("ember-htmlbars/helpers", ["exports"], function (exports) { - exports.registerHelper = registerHelper; /** @module ember @submodule ember-htmlbars */ /** @private @property helpers */ + "use strict"; + + exports.registerHelper = registerHelper; var helpers = Object.create(null); /** @module ember @submodule ember-htmlbars @@ -6718,12 +6402,16 @@ } exports.default = helpers; }); enifed('ember-htmlbars/helpers/-concat', ['exports'], function (exports) { - exports.default = concat; /** + @module ember + @submodule ember-templates + */ + + /** Concatenates input params together. Example: ```handlebars @@ -6732,18 +6420,23 @@ {{! would pass name="<first name value> <last name value>" to the component}} ``` @public @method concat - @for Ember.HTMLBars + @for Ember.Templates.helpers */ + '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; /** This private helper is used internally to handle `isVisible: false` for Ember.View and Ember.Component. @@ -6756,17 +6449,20 @@ return new _htmlbarsUtilSafeString.default(value); } }); enifed('ember-htmlbars/helpers/-join-classes', ['exports'], function (exports) { - exports.default = joinClasses; /* this private helper is used to join and compact a list of class names @private */ + 'use strict'; + + exports.default = joinClasses; + function joinClasses(classNames) { var result = []; for (var i = 0, l = classNames.length; i < l; i++) { var className = classNames[i]; @@ -6777,10 +6473,12 @@ return result.join(' '); } }); enifed('ember-htmlbars/helpers/-legacy-each-with-controller', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-htmlbars/utils/normalize-self', 'ember-htmlbars/utils/decode-each-key'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberHtmlbarsUtilsNormalizeSelf, _emberHtmlbarsUtilsDecodeEachKey) { + 'use strict'; + exports.default = legacyEachWithControllerHelper; function legacyEachWithControllerHelper(params, hash, blocks) { var list = params[0]; var keyPath = hash.key; @@ -6795,11 +6493,11 @@ list.forEach(function (item, i) { var self; if (blocks.template.arity === 0) { - _emberMetalCore.default.deprecate(deprecation); + _emberMetalCore.default.deprecate(deprecation, false, { id: 'ember-htmlbars.each-with-controller-helper', until: '2.4.0' }); self = _emberHtmlbarsUtilsNormalizeSelf.default(item); self = bindController(self, true); } var key = _emberHtmlbarsUtilsDecodeEachKey.default(item, keyPath, i); @@ -6817,10 +6515,12 @@ var deprecation = 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each items as |item|}}`) instead.'; exports.deprecation = deprecation; }); enifed('ember-htmlbars/helpers/-legacy-each-with-keyword', ['exports', 'ember-views/streams/should_display', 'ember-htmlbars/utils/decode-each-key'], function (exports, _emberViewsStreamsShould_display, _emberHtmlbarsUtilsDecodeEachKey) { + 'use strict'; + exports.default = legacyEachWithKeywordHelper; function legacyEachWithKeywordHelper(params, hash, blocks) { var list = params[0]; var keyPath = hash.key; @@ -6851,10 +6551,12 @@ var deprecation = 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each items as |item|}}`) instead.'; exports.deprecation = deprecation; }); enifed('ember-htmlbars/helpers/-normalize-class', ['exports', 'ember-runtime/system/string', 'ember-metal/path_cache'], function (exports, _emberRuntimeSystemString, _emberMetalPath_cache) { + 'use strict'; + exports.default = normalizeClass; /* This private helper is used by ComponentNode to convert the classNameBindings microsyntax into a class name. @@ -6881,31 +6583,33 @@ } // If value is a Boolean and true, return the dasherized property // name. } else if (value === true) { - // Only apply to last segment in the path - if (propName && _emberMetalPath_cache.isPath(propName)) { - var segments = propName.split('.'); - propName = segments[segments.length - 1]; - } + // Only apply to last segment in the path + if (propName && _emberMetalPath_cache.isPath(propName)) { + var segments = propName.split('.'); + propName = segments[segments.length - 1]; + } - return _emberRuntimeSystemString.dasherize(propName); + return _emberRuntimeSystemString.dasherize(propName); - // If the value is not false, undefined, or null, return the current - // value of the property. - } else if (value !== false && value != null) { - return value; + // If the value is not false, undefined, or null, return the current + // value of the property. + } else if (value !== false && value != null) { + return value; - // Nothing to display. Return null so that the old class is removed - // but no new class is added. - } else { - return null; - } + // Nothing to display. Return null so that the old class is removed + // but no new class is added. + } else { + return null; + } } }); enifed('ember-htmlbars/helpers/each-in', ['exports', 'ember-metal/features', 'ember-views/streams/should_display'], function (exports, _emberMetalFeatures, _emberViewsStreamsShould_display) { + 'use strict'; + var eachInHelper = function (_ref, hash, blocks) { var object = _ref[0]; var objKeys, prop, i; objKeys = object ? Object.keys(object) : []; @@ -6918,11 +6622,13 @@ blocks.inverse.yield(); } }; exports.default = eachInHelper; }); -enifed('ember-htmlbars/helpers/each', ['exports', 'ember-metal/core', 'ember-metal/error', 'ember-htmlbars/utils/normalize-self', 'ember-views/streams/should_display', 'ember-htmlbars/utils/decode-each-key'], function (exports, _emberMetalCore, _emberMetalError, _emberHtmlbarsUtilsNormalizeSelf, _emberViewsStreamsShould_display, _emberHtmlbarsUtilsDecodeEachKey) { +enifed('ember-htmlbars/helpers/each', ['exports', 'ember-views/streams/should_display', 'ember-htmlbars/utils/decode-each-key'], function (exports, _emberViewsStreamsShould_display, _emberHtmlbarsUtilsDecodeEachKey) { + 'use strict'; + exports.default = eachHelper; /** The `{{#each}}` helper loops over elements in a collection. It is an extension of the base Handlebars `{{#each}}` helper. @@ -6993,46 +6699,33 @@ function eachHelper(params, hash, blocks) { var list = params[0]; var keyPath = hash.key; - if (blocks.template.arity === 0) { - _emberMetalCore.default.deprecate(deprecation); - } - if (_emberViewsStreamsShould_display.default(list)) { - (function () { - var seenKeys = {}; - forEach(list, function (item, i) { - var self; - if (blocks.template.arity === 0) { - self = _emberHtmlbarsUtilsNormalizeSelf.default(item); - } + forEach(list, function (item, i) { + var key = _emberHtmlbarsUtilsDecodeEachKey.default(item, keyPath, i); - var key = _emberHtmlbarsUtilsDecodeEachKey.default(item, keyPath, i); - if (seenKeys[key] === true) { - throw new _emberMetalError.default('Duplicate key found (\'' + key + '\') for \'{{each}}\' helper, please use a unique key or switch to \'{{#each model key="@index"}}{{/each}}\'.'); - } else { - seenKeys[key] = true; - } - blocks.template.yieldItem(key, [item, i], self); - }); - })(); + blocks.template.yieldItem(key, [item, i]); + }); } else if (blocks.inverse.yield) { blocks.inverse.yield(); } } function forEach(iterable, cb) { return iterable.forEach ? iterable.forEach(cb) : Array.prototype.forEach.call(iterable, cb); } - - var deprecation = 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each items as |item|}}`) instead.'; - exports.deprecation = deprecation; }); enifed('ember-htmlbars/helpers/if_unless', ['exports', 'ember-metal/core', 'ember-views/streams/should_display'], function (exports, _emberMetalCore, _emberViewsStreamsShould_display) { + /** + @module ember + @submodule ember-templates + */ + 'use strict'; + /** Use the `if` block helper to conditionally render a block depending on a property. If the property is "falsey", for example: `false`, `undefined `null`, `""`, `0` or an empty array, the block will not be rendered. @@ -7125,17 +6818,14 @@ } exports.ifHelper = ifHelper; exports.unlessHelper = unlessHelper; }); -/** -@module ember -@submodule ember-templates -*/ - // Ember.assert enifed('ember-htmlbars/helpers/loc', ['exports', 'ember-runtime/system/string'], function (exports, _emberRuntimeSystemString) { + 'use strict'; + exports.default = locHelper; /** @module ember @submodule ember-templates @@ -7177,10 +6867,17 @@ function locHelper(params) { return _emberRuntimeSystemString.loc.apply(null, params); } }); enifed('ember-htmlbars/helpers/log', ['exports', 'ember-metal/logger'], function (exports, _emberMetalLogger) { + /** + @module ember + @submodule ember-templates + */ + + 'use strict'; + exports.default = logHelper; /** `log` allows you to output the value of variables in the current rendering context. `log` also accepts primitive types such as strings or numbers. @@ -7197,15 +6894,18 @@ function logHelper(values) { _emberMetalLogger.default.log.apply(null, values); } }); -/** -@module ember -@submodule ember-templates -*/ enifed('ember-htmlbars/helpers/with', ['exports', 'ember-views/streams/should_display'], function (exports, _emberViewsStreamsShould_display) { + /** + @module ember + @submodule ember-templates + */ + + 'use strict'; + exports.default = withHelper; /** Use the `{{with}}` helper when you want to alias a property to a new name. This is helpful for semantic clarity as it allows you to retain default scope or to reference a property from another @@ -7239,21 +6939,24 @@ @public */ function withHelper(params, hash, options) { if (_emberViewsStreamsShould_display.default(params[0])) { - this.yield([params[0]]); + options.template.yield([params[0]]); } else if (options.inverse && options.inverse.yield) { options.inverse.yield([]); } } }); -/** -@module ember -@submodule ember-templates -*/ enifed('ember-htmlbars/hooks/bind-local', ['exports', 'ember-metal/streams/stream', 'ember-metal/streams/proxy-stream'], function (exports, _emberMetalStreamsStream, _emberMetalStreamsProxyStream) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.default = bindLocal; function bindLocal(env, scope, key, value) { var isExisting = scope.locals.hasOwnProperty(key); if (isExisting) { @@ -7266,27 +6969,33 @@ var newValue = _emberMetalStreamsStream.default.wrap(value, _emberMetalStreamsProxyStream.default, key); scope.locals[key] = newValue; } } }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed("ember-htmlbars/hooks/bind-scope", ["exports"], function (exports) { + "use strict"; + exports.default = bindScope; function bindScope(env, scope) {} }); enifed('ember-htmlbars/hooks/bind-self', ['exports', 'ember-metal/streams/proxy-stream', 'ember-htmlbars/utils/subscribe'], function (exports, _emberMetalStreamsProxyStream, _emberHtmlbarsUtilsSubscribe) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.default = bindSelf; function bindSelf(env, scope, _self) { var self = _self; if (self && self.hasBoundController) { - var controller = self.controller; + var _self2 = self; + var controller = _self2.controller; self = self.self; newStream(scope.locals, 'controller', controller || self); } @@ -7311,15 +7020,18 @@ _emberHtmlbarsUtilsSubscribe.default(renderNode, scope, stream); } scope[key] = stream; } }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed('ember-htmlbars/hooks/bind-shadow-scope', ['exports', 'ember-views/views/component', 'ember-metal/streams/proxy-stream', 'ember-htmlbars/utils/subscribe'], function (exports, _emberViewsViewsComponent, _emberMetalStreamsProxyStream, _emberHtmlbarsUtilsSubscribe) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.default = bindShadowScope; function bindShadowScope(env, parentScope, shadowScope, options) { if (!options) { return; @@ -7364,43 +7076,47 @@ _emberHtmlbarsUtilsSubscribe.default(renderNode, scope, stream); } scope[key] = stream; } }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed('ember-htmlbars/hooks/classify', ['exports', 'ember-htmlbars/utils/is-component'], function (exports, _emberHtmlbarsUtilsIsComponent) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.default = classify; function classify(env, scope, path) { if (_emberHtmlbarsUtilsIsComponent.default(env, scope, path)) { return 'component'; } return null; } }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed("ember-htmlbars/hooks/cleanup-render-node", ["exports"], function (exports) { - exports.default = cleanupRenderNode; /** @module ember @submodule ember-htmlbars */ + "use strict"; + + exports.default = cleanupRenderNode; + function cleanupRenderNode(renderNode) { if (renderNode.cleanup) { renderNode.cleanup(); } } }); enifed('ember-htmlbars/hooks/component', ['exports', 'ember-htmlbars/node-managers/component-node-manager'], function (exports, _emberHtmlbarsNodeManagersComponentNodeManager) { + 'use strict'; + exports.default = componentHook; function componentHook(renderNode, env, scope, _tagName, params, attrs, templates, visitor) { var state = renderNode.state; @@ -7434,22 +7150,24 @@ manager.render(env, visitor); } }); enifed('ember-htmlbars/hooks/concat', ['exports', 'ember-metal/streams/utils'], function (exports, _emberMetalStreamsUtils) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.default = concat; function concat(env, parts) { return _emberMetalStreamsUtils.concat(parts, ''); } }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed("ember-htmlbars/hooks/create-fresh-scope", ["exports"], function (exports) { - exports.default = createFreshScope; /* Ember's implementation of HTMLBars creates an enriched scope. * self: same as HTMLBars, this field represents the dynamic lookup of root keys that are not special keywords or block arguments. @@ -7494,10 +7212,14 @@ view-less templates and the legacy `controller=foo` semantics, the controller hierarchy is managed dynamically by looking at the current view's `controller`. */ + "use strict"; + + exports.default = createFreshScope; + function createFreshScope() { return { self: null, blocks: {}, component: null, @@ -7506,16 +7228,19 @@ localPresent: {} }; } }); enifed("ember-htmlbars/hooks/destroy-render-node", ["exports"], function (exports) { - exports.default = destroyRenderNode; /** @module ember @submodule ember-htmlbars */ + "use strict"; + + exports.default = destroyRenderNode; + function destroyRenderNode(renderNode) { if (renderNode.emberView) { renderNode.emberView.destroy(); } @@ -7526,72 +7251,59 @@ } } } }); enifed("ember-htmlbars/hooks/did-cleanup-tree", ["exports"], function (exports) { + "use strict"; + exports.default = didCleanupTree; function didCleanupTree(env) { // Once we have finsihed cleaning up the render node and sub-nodes, reset // state tracking which view those render nodes belonged to. env.view.ownerView._destroyingSubtreeForView = null; } }); enifed("ember-htmlbars/hooks/did-render-node", ["exports"], function (exports) { + "use strict"; + exports.default = didRenderNode; function didRenderNode(morph, env) { env.renderedNodes[morph.guid] = true; } }); -enifed('ember-htmlbars/hooks/element', ['exports', 'ember-metal/core', 'ember-htmlbars/system/lookup-helper', 'htmlbars-runtime/hooks', 'ember-htmlbars/system/invoke-helper'], function (exports, _emberMetalCore, _emberHtmlbarsSystemLookupHelper, _htmlbarsRuntimeHooks, _emberHtmlbarsSystemInvokeHelper) { - exports.default = emberElement; +enifed('ember-htmlbars/hooks/element', ['exports', 'ember-htmlbars/system/lookup-helper', 'htmlbars-runtime/hooks', 'ember-htmlbars/system/invoke-helper'], function (exports, _emberHtmlbarsSystemLookupHelper, _htmlbarsRuntimeHooks, _emberHtmlbarsSystemInvokeHelper) { + /** + @module ember + @submodule ember-htmlbars + */ - var fakeElement; + 'use strict'; - function updateElementAttributesFromString(element, string) { - if (!fakeElement) { - fakeElement = document.createElement('div'); - } + exports.default = emberElement; - fakeElement.innerHTML = '<' + element.tagName + ' ' + string + '><' + '/' + element.tagName + '>'; - - var attrs = fakeElement.firstChild.attributes; - for (var i = 0, l = attrs.length; i < l; i++) { - var attr = attrs[i]; - if (attr.specified) { - element.setAttribute(attr.name, attr.value); - } - } - } - function emberElement(morph, env, scope, path, params, hash, visitor) { if (_htmlbarsRuntimeHooks.handleRedirect(morph, env, scope, path, params, hash, null, null, visitor)) { return; } var result; var helper = _emberHtmlbarsSystemLookupHelper.findHelper(path, scope.self, env); if (helper) { - var helperStream = _emberHtmlbarsSystemInvokeHelper.buildHelperStream(helper, params, hash, { element: morph.element }, env, scope, null, path); + var helperStream = _emberHtmlbarsSystemInvokeHelper.buildHelperStream(helper, params, hash, { element: morph.element }, env, scope, path); result = helperStream.value(); } else { result = env.hooks.get(env, scope, path); } - var value = env.hooks.getValue(result); - if (value) { - _emberMetalCore.default.deprecate('Returning a string of attributes from a helper inside an element is deprecated.'); - updateElementAttributesFromString(morph.element, value); - } + env.hooks.getValue(result); } }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed('ember-htmlbars/hooks/get-cell-or-value', ['exports', 'ember-metal/streams/utils', 'ember-htmlbars/keywords/mut'], function (exports, _emberMetalStreamsUtils, _emberHtmlbarsKeywordsMut) { + 'use strict'; + exports.default = getCellOrValue; function getCellOrValue(ref) { if (ref && ref[_emberHtmlbarsKeywordsMut.MUTABLE_REFERENCE]) { // reify the mutable reference into a mutable cell @@ -7601,10 +7313,17 @@ // 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) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.default = getChild; function getChild(parent, key) { if (_emberMetalStreamsUtils.isStream(parent)) { return parent.getKey(key); @@ -7614,26 +7333,27 @@ // That might change if it is possible to pass object literals // through the templating system. return parent[key]; } }); -/** -@module ember -@submodule ember-htmlbars -*/ -enifed('ember-htmlbars/hooks/get-root', ['exports', 'ember-metal/core', 'ember-metal/path_cache', 'ember-metal/streams/proxy-stream'], function (exports, _emberMetalCore, _emberMetalPath_cache, _emberMetalStreamsProxyStream) { +enifed('ember-htmlbars/hooks/get-root', ['exports'], function (exports) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.default = getRoot; function getRoot(scope, key) { if (key === 'this') { return [scope.self]; } else if (key === 'hasBlock') { return [!!scope.blocks.default]; } else if (key === 'hasBlockParams') { return [!!(scope.blocks.default && scope.blocks.default.arity)]; - } else if (_emberMetalPath_cache.isGlobal(key) && _emberMetalCore.default.lookup[key]) { - return [getGlobal(key)]; } else if (key in scope.locals) { return [scope.locals[key]]; } else { return [getKey(scope, key)]; } @@ -7652,24 +7372,19 @@ // TODO: attrs // Ember.deprecate("You accessed the `" + key + "` attribute directly. Please use `attrs." + key + "` instead."); return scope.attrs[key]; } } - - function getGlobal(name) { - _emberMetalCore.default.deprecate('Global lookup of ' + name + ' from a Handlebars template is deprecated.'); - - // This stream should be memoized, but this path is deprecated and - // will be removed soon so it's not worth the trouble. - return new _emberMetalStreamsProxyStream.default(_emberMetalCore.default.lookup[name], name); - } }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed('ember-htmlbars/hooks/get-value', ['exports', 'ember-metal/streams/utils', 'ember-views/compat/attrs-proxy'], function (exports, _emberMetalStreamsUtils, _emberViewsCompatAttrsProxy) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.default = getValue; function getValue(ref) { var value = _emberMetalStreamsUtils.read(ref); @@ -7678,15 +7393,13 @@ } return value; } }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed('ember-htmlbars/hooks/has-helper', ['exports', 'ember-htmlbars/system/lookup-helper'], function (exports, _emberHtmlbarsSystemLookupHelper) { + 'use strict'; + exports.default = hasHelperHook; function hasHelperHook(env, scope, helperName) { if (env.helpers[helperName]) { return true; @@ -7702,10 +7415,12 @@ return false; } }); enifed('ember-htmlbars/hooks/invoke-helper', ['exports', 'ember-metal/core', 'ember-htmlbars/system/invoke-helper', 'ember-htmlbars/utils/subscribe'], function (exports, _emberMetalCore, _emberHtmlbarsSystemInvokeHelper, _emberHtmlbarsUtilsSubscribe) { + 'use strict'; + exports.default = invokeHelper; function invokeHelper(morph, env, scope, visitor, params, hash, helper, templates, context) { if (helper.isLegacyViewHelper) { @@ -7714,11 +7429,11 @@ env.hooks.keyword('view', morph, env, scope, [helper.viewClass], hash, templates.template.raw, null, visitor); // Opts into a special mode for view helpers return { handled: true }; } - var helperStream = _emberHtmlbarsSystemInvokeHelper.buildHelperStream(helper, params, hash, templates, env, scope, context); + var helperStream = _emberHtmlbarsSystemInvokeHelper.buildHelperStream(helper, params, hash, templates, env, scope); // Ember.Helper helpers are pure values, thus linkable if (helperStream.linkable) { if (morph) { @@ -7741,25 +7456,31 @@ } return { link: true, value: helperStream }; } - // Legacy helpers are not linkable, they must run every rerender + // Built-in helpers are not linkable, they must run every rerender return { value: helperStream.value() }; } }); // Ember.assert -enifed('ember-htmlbars/hooks/link-render-node', ['exports', 'ember-htmlbars/utils/subscribe', 'ember-runtime/utils', 'ember-metal/streams/utils', 'ember-htmlbars/system/lookup-helper'], function (exports, _emberHtmlbarsUtilsSubscribe, _emberRuntimeUtils, _emberMetalStreamsUtils, _emberHtmlbarsSystemLookupHelper) { +enifed('ember-htmlbars/hooks/link-render-node', ['exports', 'ember-htmlbars/utils/subscribe', 'ember-runtime/utils', 'ember-metal/streams/utils'], function (exports, _emberHtmlbarsUtilsSubscribe, _emberRuntimeUtils, _emberMetalStreamsUtils) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.default = linkRenderNode; function linkRenderNode(renderNode, env, scope, path, params, hash) { if (renderNode.streamUnsubscribers) { return true; } var keyword = env.hooks.keywords[path]; - var helper; if (keyword && keyword.link) { keyword.link(renderNode.state, params, hash); } else { switch (path) { case 'unbound': @@ -7767,16 +7488,10 @@ case 'unless': case 'if': params[0] = shouldDisplay(params[0]);break; case 'each': params[0] = eachParam(params[0]);break; - default: - helper = _emberHtmlbarsSystemLookupHelper.findHelper(path, env.view, env); - - if (helper && helper.isHandlebarsCompat && params[0]) { - params[0] = processHandlebarsCompatDepKeys(params[0], helper._dependentKeys); - } } } if (params && params.length) { for (var i = 0; i < params.length; i++) { @@ -7839,46 +7554,28 @@ return obj.getKey(key); } else { return obj && obj[key]; } } - - function processHandlebarsCompatDepKeys(base, additionalKeys) { - if (!_emberMetalStreamsUtils.isStream(base) || additionalKeys.length === 0) { - return base; - } - - var depKeyStreams = []; - - var stream = _emberMetalStreamsUtils.chain(base, function () { - _emberMetalStreamsUtils.readArray(depKeyStreams); - - return _emberMetalStreamsUtils.read(base); - }, 'HandlebarsCompatHelper'); - - for (var i = 0, l = additionalKeys.length; i < l; i++) { - var depKeyStream = base.get(additionalKeys[i]); - - depKeyStreams.push(depKeyStream); - stream.addDependency(depKeyStream); - } - - return stream; - } }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed('ember-htmlbars/hooks/lookup-helper', ['exports', 'ember-htmlbars/system/lookup-helper'], function (exports, _emberHtmlbarsSystemLookupHelper) { + 'use strict'; + exports.default = lookupHelperHook; function lookupHelperHook(env, scope, helperName) { return _emberHtmlbarsSystemLookupHelper.default(helperName, scope.self, env); } }); enifed('ember-htmlbars/hooks/subexpr', ['exports', 'ember-htmlbars/system/lookup-helper', 'ember-htmlbars/system/invoke-helper', 'ember-metal/streams/utils'], function (exports, _emberHtmlbarsSystemLookupHelper, _emberHtmlbarsSystemInvokeHelper, _emberMetalStreamsUtils) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.default = subexpr; function subexpr(env, scope, helperName, params, hash) { // TODO: Keywords and helper invocation should be integrated into // the subexpr hook upstream in HTMLBars. @@ -7888,11 +7585,11 @@ } var label = labelForSubexpr(params, hash, helperName); var helper = _emberHtmlbarsSystemLookupHelper.default(helperName, scope.self, env); - var helperStream = _emberHtmlbarsSystemInvokeHelper.buildHelperStream(helper, params, hash, { template: {}, inverse: {} }, env, scope, null, label); + var helperStream = _emberHtmlbarsSystemInvokeHelper.buildHelperStream(helper, params, hash, null, env, scope, label); for (var i = 0, l = params.length; i < l; i++) { helperStream.addDependency(params[i]); } @@ -7930,22 +7627,26 @@ } return out.join(' '); } }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed('ember-htmlbars/hooks/update-self', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-htmlbars/utils/update-scope'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberHtmlbarsUtilsUpdateScope) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.default = updateSelf; function updateSelf(env, scope, _self) { var self = _self; if (self && self.hasBoundController) { - var controller = self.controller; + var _self2 = self; + var controller = _self2.controller; self = self.self; _emberHtmlbarsUtilsUpdateScope.default(scope.locals, 'controller', controller || self); } @@ -7959,15 +7660,13 @@ } _emberHtmlbarsUtilsUpdateScope.default(scope, 'self', self, null); } }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed("ember-htmlbars/hooks/will-cleanup-tree", ["exports"], function (exports) { + "use strict"; + exports.default = willCleanupTree; function willCleanupTree(env) { var view = env.view; @@ -8000,10 +7699,17 @@ // `didCleanupTree`. view.ownerView._destroyingSubtreeForView = view; } }); enifed('ember-htmlbars/keywords', ['exports', 'htmlbars-runtime'], function (exports, _htmlbarsRuntime) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.registerKeyword = registerKeyword; /** @private @property helpers @@ -8027,15 +7733,18 @@ keywords[name] = keyword; } exports.default = keywords; }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed('ember-htmlbars/keywords/collection', ['exports', 'ember-views/streams/utils', 'ember-views/views/collection_view', 'ember-htmlbars/node-managers/view-node-manager', 'ember-metal/merge'], function (exports, _emberViewsStreamsUtils, _emberViewsViewsCollection_view, _emberHtmlbarsNodeManagersViewNodeManager, _emberMetalMerge) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.default = { setupState: function (state, env, scope, params, hash) { var read = env.hooks.getValue; return _emberMetalMerge.assign({}, state, { @@ -8090,15 +7799,17 @@ } return viewClassOrInstance; } }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed('ember-htmlbars/keywords/component', ['exports', 'ember-metal/merge'], function (exports, _emberMetalMerge) { + /** + @module ember + @submodule ember-templates + @public + */ + 'use strict'; /** The `{{component}}` helper lets you add instances of `Ember.Component` to a template. See [Ember.Component](/api/classes/Ember.Component.html) for additional information on how a `Component` functions. @@ -8181,41 +7892,19 @@ } env.hooks.component(morph, env, scope, componentPath, params, hash, { default: template, inverse: inverse }, visitor); } }); -/** +enifed('ember-htmlbars/keywords/debugger', ['exports', 'ember-metal/logger'], function (exports, _emberMetalLogger) { + /*jshint debug:true*/ + + /** @module ember - @submodule ember-templates - @public -*/ -enifed('ember-htmlbars/keywords/customized_outlet', ['exports', 'ember-metal/core', 'ember-htmlbars/node-managers/view-node-manager', 'ember-views/streams/utils', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberHtmlbarsNodeManagersViewNodeManager, _emberViewsStreamsUtils, _emberMetalStreamsUtils) { - exports.default = { - setupState: function (state, env, scope, params, hash) { - _emberMetalCore.default.assert('Using a quoteless view parameter with {{outlet}} is not supported', !hash.view || !_emberMetalStreamsUtils.isStream(hash.view)); - var read = env.hooks.getValue; - var viewClass = read(hash.viewClass) || _emberViewsStreamsUtils.readViewFactory(read(hash.view), env.container); - return { viewClass: viewClass }; - }, - render: function (renderNode, env, scope, params, hash, template, inverse, visitor) { - var state = renderNode.state; - var parentView = env.view; + @submodule ember-htmlbars + */ + 'use strict'; - var options = { - component: state.viewClass - }; - var nodeManager = _emberHtmlbarsNodeManagersViewNodeManager.default.create(renderNode, env, hash, options, parentView, null, null, null); - state.manager = nodeManager; - nodeManager.render(env, hash, visitor); - } - }; -}); -/** -@module ember -@submodule ember-htmlbars -*/ -enifed('ember-htmlbars/keywords/debugger', ['exports', 'ember-metal/logger'], function (exports, _emberMetalLogger) { exports.default = debuggerKeyword; /** Execute the `debugger` statement in the current template's context. @@ -8274,23 +7963,20 @@ debugger; return true; } }); -/*jshint debug:true*/ - -/** -@module ember -@submodule ember-htmlbars -*/ enifed('ember-htmlbars/keywords/each', ['exports'], function (exports) { - exports.default = each; /** @module ember @submodule ember-htmlbars */ + 'use strict'; + + exports.default = each; + function each(morph, env, scope, params, hash, template, inverse, visitor) { var getValue = env.hooks.getValue; var keyword = hash['-legacy-keyword'] && getValue(hash['-legacy-keyword']); /* START: Support of legacy ArrayController. TODO: Remove after 1st 2.0 TLS release */ @@ -8308,11 +7994,17 @@ return false; } }); enifed('ember-htmlbars/keywords/get', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/streams/stream', 'ember-metal/streams/key-stream', 'ember-metal/streams/utils', 'ember-metal/merge', 'ember-htmlbars/utils/subscribe', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/observer'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalStreamsStream, _emberMetalStreamsKeyStream, _emberMetalStreamsUtils, _emberMetalMerge, _emberHtmlbarsUtilsSubscribe, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalObserver) { + /** + @module ember + @submodule ember-templates + */ + 'use strict'; + function labelFor(source, key) { var sourceLabel = source.label ? source.label : ''; var keyLabel = key.label ? key.label : ''; return '(get ' + sourceLabel + ' ' + keyLabel + ')'; } @@ -8327,12 +8019,44 @@ var stream = new DynamicKeyStream(objRef, pathRef); return stream; }; + /** + Dynamically look up a property on an object. The second argument to `{{get}}` + should have a string value, although it can be bound. + For example, these two usages are equivilent: + ```handlebars + {{person.height}} + {{get person "height"}} + ``` + If there were several facts about a person, the `{{get}}` helper can dynamically + pick one: + ```handlebars + {{get person factName}} + ``` + For a more complex example, this template would allow the user to switch + between showing the user's height and weight with a click: + ```handlebars + {{get person factName}} + <button {{action (mut factName) "height"}}>Show height</button> + <button {{action (mut factName) "weight"}}>Show weight</button> + ``` + The `{{get}}` helper can also respect mutable values itself. For example: + ```handlebars + {{input value=(mut (get person factName)) type="text"}} + <button {{action (mut factName) "height"}}>Show height</button> + <button {{action (mut factName) "weight"}}>Show weight</button> + ``` + Would allow the user to swap what fact is being displayed, and also edit + that fact via a two-way mutable binding. + @public + @method get + @for Ember.Templates.helpers + */ var getKeyword = function getKeyword(morph, env, scope, params, hash, template, inverse, visitor) { - if (!morph) { + if (morph === null) { return buildStream(params); } else { var stream = undefined; if (morph.linkedResult) { stream = morph.linkedResult; @@ -8422,10 +8146,12 @@ }); exports.default = getKeyword; }); enifed('ember-htmlbars/keywords/input', ['exports', 'ember-metal/core', 'ember-metal/merge'], function (exports, _emberMetalCore, _emberMetalMerge) { + 'use strict'; + exports.default = { setupState: function (lastState, env, scope, params, hash) { var type = env.hooks.getValue(hash.type); var componentName = componentNameMap[type] || defaultComponentName; @@ -8448,10 +8174,12 @@ var componentNameMap = { 'checkbox': '-checkbox' }; }); enifed('ember-htmlbars/keywords/legacy-yield', ['exports', 'ember-metal/streams/proxy-stream'], function (exports, _emberMetalStreamsProxyStream) { + 'use strict'; + exports.default = legacyYield; function legacyYield(morph, env, _scope, params, hash, template, inverse, visitor) { var scope = _scope; @@ -8473,17 +8201,57 @@ return true; } }); enifed('ember-htmlbars/keywords/mut', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/utils', 'ember-metal/streams/proxy-stream', 'ember-metal/streams/utils', 'ember-metal/streams/stream', 'ember-views/compat/attrs-proxy', 'ember-routing-htmlbars/keywords/closure-action'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalUtils, _emberMetalStreamsProxyStream, _emberMetalStreamsUtils, _emberMetalStreamsStream, _emberViewsCompatAttrsProxy, _emberRoutingHtmlbarsKeywordsClosureAction) { + /** + @module ember + @submodule ember-templates + */ + + 'use strict'; + var _merge; exports.default = mut; exports.privateMut = privateMut; var MUTABLE_REFERENCE = _emberMetalUtils.symbol('MUTABLE_REFERENCE'); exports.MUTABLE_REFERENCE = MUTABLE_REFERENCE; + /** + The `mut` helper lets you __clearly specify__ that a child `Component` can update the + (mutable) value passed to it, which will __change the value of the parent compnent__. + + This is very helpful for passing mutable values to a `Component` of any size, but + 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 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: function() { + this.attrs.childClickCount.update(this.attrs.childClickCount.value + 1); + } + }); + ``` + + 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 + @param {Object} [attr] the "two-way" attribute that can be modified. + @for Ember.Templates.helpers + @public + */ function mut(morph, env, scope, originalParams, hash, template, inverse) { // If `morph` is `null` the keyword is being invoked as a subexpression. if (morph === null) { var valueStream = originalParams[0]; @@ -8558,78 +8326,76 @@ } }, _merge[_emberRoutingHtmlbarsKeywordsClosureAction.INVOKE] = function (val) { this.setValue(val); }, _merge)); }); -enifed('ember-htmlbars/keywords/outlet', ['exports', 'ember-metal/core', 'htmlbars-runtime/hooks'], function (exports, _emberMetalCore, _htmlbarsRuntimeHooks) { - - /* - This level of delegation handles backward-compatibility with the - `view` parameter to {{outlet}}. When we drop support for the `view` - parameter in 2.0, this keyword should just get replaced directly - with @real_outlet. +enifed('ember-htmlbars/keywords/outlet', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-htmlbars/node-managers/view-node-manager', 'ember-htmlbars/templates/top-level-view'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberHtmlbarsNodeManagersViewNodeManager, _emberHtmlbarsTemplatesTopLevelView) { + /** + @module ember + @submodule ember-templates */ - exports.default = function (morph, env, scope, params, hash, template, inverse, visitor) { - if (hash.hasOwnProperty('view') || hash.hasOwnProperty('viewClass')) { - _emberMetalCore.default.deprecate('Passing `view` or `viewClass` to {{outlet}} is deprecated.'); - _htmlbarsRuntimeHooks.keyword('@customized_outlet', morph, env, scope, params, hash, template, inverse, visitor); - } else { - _htmlbarsRuntimeHooks.keyword('@real_outlet', morph, env, scope, params, hash, template, inverse, visitor); - } - return true; - }; -}); -/** -@module ember -@submodule ember-htmlbars -*/ -enifed('ember-htmlbars/keywords/partial', ['exports', 'ember-views/system/lookup_partial', 'htmlbars-runtime'], function (exports, _emberViewsSystemLookup_partial, _htmlbarsRuntime) { - exports.default = { - setupState: function (state, env, scope, params, hash) { - return { partialName: env.hooks.getValue(params[0]) }; - }, + 'use strict'; - render: function (renderNode, env, scope, params, hash, template, inverse, visitor) { - var state = renderNode.state; - if (!state.partialName) { - return true; - } - var found = _emberViewsSystemLookup_partial.default(env, state.partialName); - if (!found) { - return true; - } + _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.0.0-beta.5'; - _htmlbarsRuntime.internal.hostBlock(renderNode, env, scope, found.raw, null, null, visitor, function (options) { - options.templates.template.yield(); - }); - } - }; -}); -/** -@module ember -@submodule ember-htmlbars -*/ -enifed('ember-htmlbars/keywords/readonly', ['exports', 'ember-htmlbars/keywords/mut'], function (exports, _emberHtmlbarsKeywordsMut) { - exports.default = readonly; - - function readonly(morph, env, scope, originalParams, hash, template, inverse) { - // If `morph` is `null` the keyword is being invoked as a subexpression. - if (morph === null) { - var stream = originalParams[0]; - if (stream && stream[_emberHtmlbarsKeywordsMut.MUTABLE_REFERENCE]) { - return stream.sourceDep.dependee; + /** + 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: + + ```handlebars + {{! app/templates/application.hbs }} + + <!-- header content goes here, and will always display --> + {{my-header}} + + <div class="my-dynamic-content"> + <!-- this content will change based on the current route, which depends on the current URL --> + {{outlet}} + </div> + + <!-- footer content goes here, and will always display --> + {{my-footer}} + ``` + + See [templates guide](http://emberjs.com/guides/templates/the-application-template/) for + additional information on using `{{outlet}}` in `application.hbs`. + + You may also specify a name for the `{{outlet}}`, which is useful when using more than one + `{{outlet}}` in a template: + + ```handlebars + {{outlet "menu"}} + {{outlet "sidebar"}} + {{outlet "main"}} + ``` + + Your routes can then render into a specific one of these `outlet`s by specifying the `outlet` + attribute in your `renderTemplate` function: + + ```javascript + // app/routes/menu.js + + export default Ember.Route.extend({ + renderTemplate() { + this.render({ outlet: 'menu' }); } - return stream; - } - - return true; - } -}); -enifed('ember-htmlbars/keywords/real_outlet', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-htmlbars/node-managers/view-node-manager', 'ember-htmlbars/templates/top-level-view'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberHtmlbarsNodeManagersViewNodeManager, _emberHtmlbarsTemplatesTopLevelView) { - _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.0.0-beta.3'; - + }); + ``` + + See the [routing guide](http://emberjs.com/guides/routing/rendering-a-template/) for more + information on how your `route` interacts with the `{{outlet}}` helper. + + Note: Your content __will not render__ if there isn't an `{{outlet}}` for it. + + @public + @method outlet + @param {String} [name] + @for Ember.Templates.helpers + @public + */ exports.default = { willRender: function (renderNode, env) { env.view.ownerView._outlets.push(renderNode); }, @@ -8727,69 +8493,127 @@ } } return true; } }); -/** -@module ember -@submodule ember-htmlbars -*/ -enifed('ember-htmlbars/keywords/template', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) { - exports.default = templateKeyword; - var deprecation = 'The `template` helper has been deprecated in favor of the `partial` helper.'; +enifed('ember-htmlbars/keywords/partial', ['exports', 'ember-views/system/lookup_partial', 'htmlbars-runtime'], function (exports, _emberViewsSystemLookup_partial, _htmlbarsRuntime) { + /** + @module ember + @submodule ember-htmlbars + */ - exports.deprecation = deprecation; + 'use strict'; - function templateKeyword(morph, env, scope, params, hash, template, inverse, visitor) { - _emberMetalCore.default.deprecate(deprecation); - env.hooks.keyword('partial', morph, env, scope, params, hash, template, inverse, visitor); + exports.default = { + setupState: function (state, env, scope, params, hash) { + return { partialName: env.hooks.getValue(params[0]) }; + }, + + render: function (renderNode, env, scope, params, hash, template, inverse, visitor) { + var state = renderNode.state; + if (!state.partialName) { + return true; + } + var found = _emberViewsSystemLookup_partial.default(env, state.partialName); + if (!found) { + return true; + } + + _htmlbarsRuntime.internal.hostBlock(renderNode, env, scope, found.raw, null, null, visitor, function (options) { + options.templates.template.yield(); + }); + } + }; +}); +enifed('ember-htmlbars/keywords/readonly', ['exports', 'ember-htmlbars/keywords/mut'], function (exports, _emberHtmlbarsKeywordsMut) { + 'use strict'; + + exports.default = readonly; + + function readonly(morph, env, scope, originalParams, hash, template, inverse) { + // If `morph` is `null` the keyword is being invoked as a subexpression. + if (morph === null) { + var stream = originalParams[0]; + if (stream && stream[_emberHtmlbarsKeywordsMut.MUTABLE_REFERENCE]) { + return stream.sourceDep.dependee; + } + return stream; + } + return true; } }); enifed('ember-htmlbars/keywords/textarea', ['exports'], function (exports) { - exports.default = textarea; /** @module ember @submodule ember-htmlbars */ + 'use strict'; + + exports.default = textarea; + function textarea(morph, env, scope, originalParams, hash, template, inverse, visitor) { env.hooks.component(morph, env, scope, '-text-area', originalParams, hash, { default: template, inverse: inverse }, visitor); return true; } }); -enifed('ember-htmlbars/keywords/unbound', ['exports', 'ember-metal/merge', 'ember-metal/streams/stream', 'ember-metal/streams/utils'], function (exports, _emberMetalMerge, _emberMetalStreamsStream, _emberMetalStreamsUtils) { - exports.default = unbound; +enifed('ember-htmlbars/keywords/unbound', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/streams/stream', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalStreamsStream, _emberMetalStreamsUtils) { /** @module ember - @submodule ember-htmlbars + @submodule ember-templates */ - function unbound(morph, env, scope, originalParams, hash, template, inverse) { - // Since we already got the params as a set of streams, we need to extract the key from - // the first param instead of (incorrectly) trying to read from it. If this was a call - // to `{{unbound foo.bar}}`, then we pass along the original stream to `hooks.range`. - var params = originalParams.slice(); - var valueStream = params.shift(); + 'use strict'; - // If `morph` is `null` the keyword is being invoked as a subexpression. - if (morph === null) { - if (originalParams.length > 1) { - valueStream = env.hooks.subexpr(env, scope, valueStream.key, params, hash); - } + exports.default = unbound; + // assert - return new VolatileStream(valueStream); + /** + The `{{unbound}}` helper disconnects the one-way binding of a property, + essentially freezing its value at the moment of rendering. For example, + in this example the display of the variable `name` will not change even + if it is set with a new value: + + ```handlebars + {{unbound name}} + ``` + + Like any helper, the `unbound` helper can accept a nested helper expression. + This allows for custom helpers to be rendered unbound: + + ```handlebars + {{unbound (some-custom-helper)}} + {{unbound (capitalize name)}} + {{! You can use any helper, including unbound, in a nested expression }} + {{capitalize (unbound name)}} + ``` + + The `unbound` helper only accepts a single argument, and it return an + unbound value. + + @method unbound + @for Ember.Templates.helpers + @public + */ + + function unbound(morph, env, scope, params, hash, template, inverse, visitor) { + _emberMetalCore.default.assert('unbound helper cannot be called with multiple params or hash params', params.length === 1 && Object.keys(hash).length === 0); + _emberMetalCore.default.assert('unbound helper cannot be called as a block', !template); + + if (morph === null) { + return new VolatileStream(params[0]); } - if (params.length === 0) { - env.hooks.range(morph, env, scope, null, valueStream); - } else if (template === null) { - env.hooks.inline(morph, env, scope, valueStream.key, params, hash); + var stream = undefined; + if (morph.linkedResult) { + stream = morph.linkedResult; } else { - env.hooks.block(morph, env, scope, valueStream.key, params, hash, template, inverse); + stream = new VolatileStream(params[0]); + morph.linkedResult = stream; } - + env.hooks.range(morph, env, scope, null, stream, visitor); return true; } function VolatileStream(source) { this.init('(volatile ' + source.label + ')'); @@ -8807,10 +8631,17 @@ notify: function () {} }); }); enifed('ember-htmlbars/keywords/view', ['exports', 'ember-views/streams/utils', 'ember-views/views/view', 'ember-htmlbars/node-managers/view-node-manager'], function (exports, _emberViewsStreamsUtils, _emberViewsViewsView, _emberHtmlbarsNodeManagersViewNodeManager) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.default = { setupState: function (state, env, scope, params, hash) { var read = env.hooks.getValue; var targetObject = read(scope.self); var viewClassOrInstance = state.viewClassOrInstance; @@ -8910,61 +8741,23 @@ } return newHash; } }); -/** -@module ember -@submodule ember-htmlbars -*/ -enifed('ember-htmlbars/keywords/with', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'htmlbars-runtime', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberMetalProperty_get, _htmlbarsRuntime, _emberMetalStreamsUtils) { - exports.default = { - setupState: function (state, env, scope, params, hash) { - var controller = hash.controller; +enifed('ember-htmlbars/keywords/with', ['exports', 'ember-metal/core', 'htmlbars-runtime'], function (exports, _emberMetalCore, _htmlbarsRuntime) { + 'use strict'; - if (controller) { - if (!state.controller) { - var context = params[0]; - var controllerFactory = env.container.lookupFactory('controller:' + controller); - var parentController = null; - - if (scope.locals.controller) { - parentController = _emberMetalStreamsUtils.read(scope.locals.controller); - } else if (scope.locals.view) { - parentController = _emberMetalProperty_get.get(_emberMetalStreamsUtils.read(scope.locals.view), 'context'); - } - - var controllerInstance = controllerFactory.create({ - model: env.hooks.getValue(context), - parentController: parentController, - target: parentController - }); - - params[0] = controllerInstance; - return { controller: controllerInstance }; - } - - return state; - } - - return { controller: null }; - }, - + exports.default = { isStable: function () { return true; }, isEmpty: function (state) { return false; }, render: function (morph, env, scope, params, hash, template, inverse, visitor) { - if (morph.state.controller) { - morph.addDestruction(morph.state.controller); - hash.controller = morph.state.controller; - } - _emberMetalCore.default.assert('{{#with foo}} must be called with a single argument or the use the ' + '{{#with foo as |bar|}} syntax', params.length === 1); _emberMetalCore.default.assert('The {{#with}} helper must be called with a block', !!template); _htmlbarsRuntime.internal.continueBlock(morph, env, scope, 'with', params, hash, template, inverse, visitor); @@ -8974,10 +8767,11 @@ _htmlbarsRuntime.internal.continueBlock(morph, env, scope, 'with', params, hash, template, inverse, visitor); } }; }); enifed('ember-htmlbars/morphs/attr-morph', ['exports', 'ember-metal/core', 'dom-helper'], function (exports, _emberMetalCore, _domHelper) { + 'use strict'; var HTMLBarsAttrMorph = _domHelper.default.prototype.AttrMorphClass; var styleWarning = '' + 'Binding style attributes may introduce cross-site scripting vulnerabilities; ' + 'please ensure that values being bound are properly escaped. For more information, ' + 'including how to disable this warning, see ' + 'http://emberjs.com/deprecations/v1.x/#toc_binding-style-attributes.'; @@ -9001,21 +8795,22 @@ if (name !== 'style') { return true; } return !escaped; - })(this.attrName, value, this.escaped)); + })(this.attrName, value, this.escaped), { id: 'ember-htmlbars.style-xss-warning' }); }; proto.setContent = function EmberAttrMorph_setContent(value) { this._deprecateEscapedStyle(value); this.HTMLBarsAttrMorph$setContent(value); }; exports.default = EmberAttrMorph; }); enifed('ember-htmlbars/morphs/morph', ['exports', 'dom-helper'], function (exports, _domHelper) { + 'use strict'; var HTMLBarsMorph = _domHelper.default.prototype.MorphClass; var guid = 1; function EmberMorph(DOMHelper, contextualElement) { @@ -9070,12 +8865,13 @@ env.renderedNodes[this.guid] = true; }; exports.default = EmberMorph; }); -enifed('ember-htmlbars/node-managers/component-node-manager', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-views/system/build-component-template', 'ember-htmlbars/utils/lookup-component', 'ember-htmlbars/hooks/get-cell-or-value', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/set_properties', 'ember-views/compat/attrs-proxy', 'htmlbars-util/safe-string', 'ember-htmlbars/system/instrumentation-support', 'ember-views/views/component', 'ember-metal/streams/stream', 'ember-metal/streams/utils', 'ember-htmlbars/hooks/get-value'], function (exports, _emberMetalCore, _emberMetalMerge, _emberViewsSystemBuildComponentTemplate, _emberHtmlbarsUtilsLookupComponent, _emberHtmlbarsHooksGetCellOrValue, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalSet_properties, _emberViewsCompatAttrsProxy, _htmlbarsUtilSafeString, _emberHtmlbarsSystemInstrumentationSupport, _emberViewsViewsComponent, _emberMetalStreamsStream, _emberMetalStreamsUtils, _emberHtmlbarsHooksGetValue) { - exports.handleLegacyRender = handleLegacyRender; +enifed('ember-htmlbars/node-managers/component-node-manager', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-views/system/build-component-template', 'ember-htmlbars/utils/lookup-component', 'ember-htmlbars/hooks/get-cell-or-value', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/set_properties', 'ember-views/compat/attrs-proxy', 'ember-htmlbars/system/instrumentation-support', 'ember-views/views/component', 'ember-metal/streams/stream', 'ember-metal/streams/utils', 'ember-htmlbars/hooks/get-value'], function (exports, _emberMetalCore, _emberMetalMerge, _emberViewsSystemBuildComponentTemplate, _emberHtmlbarsUtilsLookupComponent, _emberHtmlbarsHooksGetCellOrValue, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalSet_properties, _emberViewsCompatAttrsProxy, _emberHtmlbarsSystemInstrumentationSupport, _emberViewsViewsComponent, _emberMetalStreamsStream, _emberMetalStreamsUtils, _emberHtmlbarsHooksGetValue) { + 'use strict'; + exports.createComponent = createComponent; function ComponentNodeManager(component, isAngleBracket, scope, renderNode, attrs, block, expectElement) { this.component = component; this.isAngleBracket = isAngleBracket; @@ -9126,112 +8922,60 @@ // `sendAction` correctly. if (parentScope.locals.controller) { createOptions._controller = _emberHtmlbarsHooksGetValue.default(parentScope.locals.controller); } - // this flag is set when a block was provided so that components can see if - // `this.get('template')` is truthy. this is added for backwards compat only - // and accessing `template` prop on a component will trigger a deprecation - // 2.0TODO: remove - if (templates.default) { - createOptions._deprecatedFlagForBlockProvided = true; - } + extractPositionalParams(renderNode, component, params, attrs); // Instantiate the component component = createComponent(component, isAngleBracket, createOptions, renderNode, env, attrs); - // If the component specifies its template via the `layout` or `template` + // If the component specifies its template via the `layout` // properties instead of using the template looked up in the container, get // them now that we have the component instance. - var result = extractComponentTemplates(component, templates); - layout = result.layout || layout; - templates = result.templates || templates; + layout = _emberMetalProperty_get.get(component, 'layout') || layout; - extractPositionalParams(renderNode, component, params, attrs); - var results = _emberViewsSystemBuildComponentTemplate.default({ layout: layout, component: component, isAngleBracket: isAngleBracket }, attrs, { templates: templates, scope: parentScope }); return new ComponentNodeManager(component, isAngleBracket, parentScope, renderNode, attrs, results.block, results.createdElement); }; function extractPositionalParams(renderNode, component, params, attrs) { - if (component.positionalParams) { - (function () { - // if the component is rendered via {{component}} helper, the first - // element of `params` is the name of the component, so we need to - // skip that when the positional parameters are constructed - var paramsStartIndex = renderNode.state.isComponentHelper ? 1 : 0; - var positionalParams = component.positionalParams; - var isNamed = typeof positionalParams === 'string'; - var paramsStream = undefined; + var positionalParams = component.positionalParams; - if (isNamed) { - paramsStream = new _emberMetalStreamsStream.default(function () { - return _emberMetalStreamsUtils.readArray(params.slice(paramsStartIndex)); - }, 'params'); - - attrs[positionalParams] = paramsStream; - } - - for (var i = 0; i < positionalParams.length; i++) { - var param = params[paramsStartIndex + i]; - if (isNamed) { - paramsStream.addDependency(param); - } else { - attrs[positionalParams[i]] = param; - } - } - })(); + if (positionalParams) { + processPositionalParams(renderNode, positionalParams, params, attrs); } } - function extractComponentTemplates(component, _templates) { - // Even though we looked up a layout from the container earlier, the - // component may specify a `layout` property that overrides that. - // The component may also provide a `template` property we should - // respect (though this behavior is deprecated). - var componentLayout = _emberMetalProperty_get.get(component, 'layout'); - var hasBlock = _templates && _templates.default; - var layout = undefined, - templates = undefined, - componentTemplate = undefined; - if (hasBlock) { - componentTemplate = null; - } else if (component.isComponent) { - componentTemplate = _emberMetalProperty_get.get(component, '_template'); - } else { - componentTemplate = _emberMetalProperty_get.get(component, 'template'); - } + function processPositionalParams(renderNode, positionalParams, params, attrs) { + // if the component is rendered via {{component}} helper, the first + // element of `params` is the name of the component, so we need to + // skip that when the positional parameters are constructed + var paramsStartIndex = renderNode.state.isComponentHelper ? 1 : 0; + var isNamed = typeof positionalParams === 'string'; + var paramsStream = undefined; - if (componentLayout) { - layout = componentLayout; - templates = extractLegacyTemplate(_templates, componentTemplate); - } else if (componentTemplate) { - // If the component has a `template` but no `layout`, use the template - // as the layout. - layout = componentTemplate; - templates = _templates; - _emberMetalCore.default.deprecate('Using deprecated `template` property on a Component.'); + if (isNamed) { + paramsStream = new _emberMetalStreamsStream.default(function () { + return _emberMetalStreamsUtils.readArray(params.slice(paramsStartIndex)); + }, 'params'); + + attrs[positionalParams] = paramsStream; } - return { layout: layout, templates: templates }; - } - - // 2.0TODO: Remove legacy behavior - function extractLegacyTemplate(_templates, componentTemplate) { - var templates = undefined; - - // There is no block template provided but the component has a - // `template` property. - if ((!_templates || !_templates.default) && componentTemplate) { - _emberMetalCore.default.deprecate('Using deprecated `template` property on a Component.'); - templates = { default: componentTemplate.raw }; + if (isNamed) { + for (var i = paramsStartIndex; i < params.length; i++) { + var param = params[i]; + paramsStream.addDependency(param); + } } else { - templates = _templates; + for (var i = 0; i < positionalParams.length; i++) { + var param = params[paramsStartIndex + i]; + attrs[positionalParams[i]] = param; + } } - - return templates; } function configureTagName(attrs, tagName, component, isAngleBracket, createOptions) { if (isAngleBracket) { createOptions.tagName = tagName; @@ -9255,55 +8999,30 @@ } } ComponentNodeManager.prototype.render = function (_env, visitor) { var component = this.component; - var attrs = this.attrs; return _emberHtmlbarsSystemInstrumentationSupport.instrument(component, function () { var env = _env.childWithView(component); - var snapshot = takeSnapshot(attrs); - env.renderer.componentInitAttrs(this.component, snapshot); env.renderer.componentWillRender(component); env.renderedViews.push(component.elementId); if (this.block) { this.block(env, [], undefined, this.renderNode, this.scope, visitor); } var element = this.expectElement && this.renderNode.firstNode; - handleLegacyRender(component, element); env.renderer.didCreateElement(component, element); env.renderer.willInsertElement(component, element); // 2.0TODO remove legacy hook env.lifecycleHooks.push({ type: 'didInsertElement', view: component }); }, this); }; - function handleLegacyRender(component, element) { - if (!component.render) { - return; - } - - _emberMetalCore.default.assert('Legacy render functions are not supported with angle-bracket components', !component._isAngleBracket); - - var content, node, lastChildIndex; - var buffer = []; - var renderNode = component._renderNode; - component.render(buffer); - content = buffer.join(''); - if (element) { - lastChildIndex = renderNode.childNodes.length - 1; - node = renderNode.childNodes[lastChildIndex]; - } else { - node = renderNode; - } - node.setContent(new _htmlbarsUtilSafeString.default(content)); - } - ComponentNodeManager.prototype.rerender = function (_env, attrs, visitor) { var component = this.component; return _emberHtmlbarsSystemInstrumentationSupport.instrument(component, function () { var env = _env.childWithView(component); @@ -9350,17 +9069,17 @@ var attrs = arguments.length <= 5 || arguments[5] === undefined ? {} : arguments[5]; var props = _emberMetalMerge.assign({}, _props); if (!isAngleBracket) { - var hasSuppliedController = ('controller' in attrs); // 2.0TODO remove - _emberMetalCore.default.deprecate('controller= is deprecated', !hasSuppliedController); + var proto = _component.proto(); + _emberMetalCore.default.assert('controller= is no longer supported', !('controller' in attrs)); + var snapshot = takeSnapshot(attrs); props.attrs = snapshot; - var proto = _component.proto(); mergeBindings(props, shadowedAttrs(proto, snapshot)); } else { props._isAngleBracket = true; } @@ -9421,11 +9140,11 @@ // when `attrs` is an actual value being set in the // attrs hash (`{{foo-bar attrs="blah"}}`) we cannot // set `"blah"` to the root of the target because // that would replace all attrs with `attrs.attrs` if (prop === 'attrs') { - _emberMetalCore.default.warn('Invoking a component with a hash attribute named `attrs` is not supported. Please refactor usage of ' + target + ' to avoid passing `attrs` as a hash parameter.'); + _emberMetalCore.default.warn('Invoking a component with a hash attribute named `attrs` is not supported. Please refactor usage of ' + target + ' to avoid passing `attrs` as a hash parameter.', false, { id: 'ember-htmlbars.component-unsupported-attrs' }); continue; } var value = attrs[prop]; if (value && value[_emberViewsCompatAttrsProxy.MUTABLE_CELL]) { @@ -9445,11 +9164,13 @@ // In theory this should come through the env, but it should // be safe to import this until we make the hook system public // and it gets actively used in addons or other downstream // libraries. -enifed('ember-htmlbars/node-managers/view-node-manager', ['exports', 'ember-metal/merge', 'ember-metal/core', 'ember-views/system/build-component-template', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/set_properties', 'ember-views/views/view', 'ember-views/compat/attrs-proxy', 'ember-htmlbars/hooks/get-cell-or-value', 'ember-htmlbars/system/instrumentation-support', 'ember-htmlbars/node-managers/component-node-manager', 'ember-htmlbars/hooks/get-value'], function (exports, _emberMetalMerge, _emberMetalCore, _emberViewsSystemBuildComponentTemplate, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalSet_properties, _emberViewsViewsView, _emberViewsCompatAttrsProxy, _emberHtmlbarsHooksGetCellOrValue, _emberHtmlbarsSystemInstrumentationSupport, _emberHtmlbarsNodeManagersComponentNodeManager, _emberHtmlbarsHooksGetValue) { +enifed('ember-htmlbars/node-managers/view-node-manager', ['exports', 'ember-metal/merge', 'ember-metal/core', 'ember-views/system/build-component-template', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/set_properties', 'ember-views/views/view', 'ember-views/compat/attrs-proxy', 'ember-htmlbars/hooks/get-cell-or-value', 'ember-htmlbars/system/instrumentation-support', 'ember-htmlbars/hooks/get-value'], function (exports, _emberMetalMerge, _emberMetalCore, _emberViewsSystemBuildComponentTemplate, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalSet_properties, _emberViewsViewsView, _emberViewsCompatAttrsProxy, _emberHtmlbarsHooksGetCellOrValue, _emberHtmlbarsSystemInstrumentationSupport, _emberHtmlbarsHooksGetValue) { + 'use strict'; + exports.createOrUpdateComponent = createOrUpdateComponent; function ViewNodeManager(component, scope, renderNode, block, expectElement) { this.component = component; this.scope = scope; @@ -9499,18 +9220,10 @@ component = componentInfo.component = createOrUpdateComponent(found.component, options, found.createOptions, renderNode, env, attrs); var layout = _emberMetalProperty_get.get(component, 'layout'); if (layout) { componentInfo.layout = layout; - if (!contentTemplate) { - var template = getTemplate(component); - - if (template) { - _emberMetalCore.default.deprecate('Using deprecated `template` property on a ' + (component.isView ? 'View' : 'Component') + '.'); - contentTemplate = template.raw; - } - } } else { componentInfo.layout = getTemplate(component) || componentInfo.layout; } renderNode.emberView = component; @@ -9536,23 +9249,20 @@ if (component) { newEnv = env.childWithView(component); } if (component) { - var snapshot = takeSnapshot(attrs); - env.renderer.setAttrs(this.component, snapshot); env.renderer.willRender(component); env.renderedViews.push(component.elementId); } if (this.block) { this.block(newEnv, [], undefined, this.renderNode, this.scope, visitor); } if (component) { var element = this.expectElement && this.renderNode.firstNode; - _emberHtmlbarsNodeManagersComponentNodeManager.handleLegacyRender(component, element); env.renderer.didCreateElement(component, element); // 2.0TODO: Remove legacy hooks. env.renderer.willInsertElement(component, element); env.lifecycleHooks.push({ type: 'didInsertElement', view: component }); } @@ -9571,11 +9281,11 @@ // Notify component that it has become dirty and is about to change. env.renderer.willUpdate(component, snapshot); if (component._renderNode.shouldReceiveAttrs) { - env.renderer.updateAttrs(component, snapshot); + env.renderer.componentUpdateAttrs(component, snapshot); _emberMetalSet_properties.default(component, mergeBindings({}, shadowedAttrs(component, snapshot))); component._renderNode.shouldReceiveAttrs = false; } env.renderer.willRender(component); @@ -9596,11 +9306,15 @@ this.component = null; } }; function getTemplate(componentOrView) { - return componentOrView.isComponent ? _emberMetalProperty_get.get(componentOrView, '_template') : _emberMetalProperty_get.get(componentOrView, 'template'); + if (!componentOrView.isComponent) { + return _emberMetalProperty_get.get(componentOrView, 'template'); + } + + return null; } function createOrUpdateComponent(component, options, createOptions, renderNode, env) { var attrs = arguments.length <= 5 || arguments[5] === undefined ? {} : arguments[5]; @@ -9630,10 +9344,11 @@ delete props._context; } component = component.create(props); } else { + env.renderer.componentUpdateAttrs(component, snapshot); mergeBindings(props, shadowedAttrs(component, snapshot)); _emberMetalSet_properties.default(component, props); } if (options.parentView) { @@ -9685,11 +9400,11 @@ // when `attrs` is an actual value being set in the // attrs hash (`{{foo-bar attrs="blah"}}`) we cannot // set `"blah"` to the root of the target because // that would replace all attrs with `attrs.attrs` if (prop === 'attrs') { - _emberMetalCore.default.warn('Invoking a component with a hash attribute named `attrs` is not supported. Please refactor usage of ' + target + ' to avoid passing `attrs` as a hash parameter.'); + _emberMetalCore.default.warn('Invoking a component with a hash attribute named `attrs` is not supported. Please refactor usage of ' + target + ' to avoid passing `attrs` as a hash parameter.', false, { id: 'ember-htmlbars.view-unsupported-attrs' }); continue; } var value = attrs[prop]; if (value && value[_emberViewsCompatAttrsProxy.MUTABLE_CELL]) { @@ -9706,55 +9421,35 @@ // In theory this should come through the env, but it should // be safe to import this until we make the hook system public // and it gets actively used in addons or other downstream // libraries. enifed('ember-htmlbars/streams/built-in-helper', ['exports', 'ember-metal/streams/stream', 'ember-metal/merge', 'ember-htmlbars/streams/utils'], function (exports, _emberMetalStreamsStream, _emberMetalMerge, _emberHtmlbarsStreamsUtils) { + 'use strict'; + exports.default = BuiltInHelperStream; - function BuiltInHelperStream(helper, params, hash, templates, env, scope, context, label) { + function BuiltInHelperStream(helper, params, hash, templates, env, scope, label) { this.init(label); this.helper = helper; this.params = params; this.templates = templates; this.env = env; this.scope = scope; this.hash = hash; - this.context = context; } BuiltInHelperStream.prototype = Object.create(_emberMetalStreamsStream.default.prototype); _emberMetalMerge.default(BuiltInHelperStream.prototype, { compute: function () { - // Using call and undefined is probably not needed, these are only internal - return this.helper.call(this.context, _emberHtmlbarsStreamsUtils.getArrayValues(this.params), _emberHtmlbarsStreamsUtils.getHashValues(this.hash), this.templates, this.env, this.scope); + return this.helper(_emberHtmlbarsStreamsUtils.getArrayValues(this.params), _emberHtmlbarsStreamsUtils.getHashValues(this.hash), this.templates, this.env, this.scope); } }); }); -enifed('ember-htmlbars/streams/compat-helper', ['exports', 'ember-metal/streams/stream', 'ember-metal/merge'], function (exports, _emberMetalStreamsStream, _emberMetalMerge) { - exports.default = CompatHelperStream; - - function CompatHelperStream(helper, params, hash, templates, env, scope, label) { - this.init(label); - this.helper = helper.helperFunction; - this.params = params; - this.templates = templates; - this.env = env; - this.scope = scope; - this.hash = hash; - } - - CompatHelperStream.prototype = Object.create(_emberMetalStreamsStream.default.prototype); - - _emberMetalMerge.default(CompatHelperStream.prototype, { - compute: function () { - // Using call and undefined is probably not needed, these are only internal - return this.helper.call(undefined, this.params, this.hash, this.templates, this.env, this.scope); - } - }); -}); enifed('ember-htmlbars/streams/helper-factory', ['exports', 'ember-metal/streams/stream', 'ember-metal/merge', 'ember-htmlbars/streams/utils'], function (exports, _emberMetalStreamsStream, _emberMetalMerge, _emberHtmlbarsStreamsUtils) { + 'use strict'; + exports.default = HelperFactoryStream; function HelperFactoryStream(helperFactory, params, hash, label) { this.init(label); this.helperFactory = helperFactory; @@ -9782,10 +9477,12 @@ }, super$deactivate: HelperFactoryStream.prototype.deactivate }); }); enifed('ember-htmlbars/streams/helper-instance', ['exports', 'ember-metal/streams/stream', 'ember-metal/merge', 'ember-htmlbars/streams/utils'], function (exports, _emberMetalStreamsStream, _emberMetalMerge, _emberHtmlbarsStreamsUtils) { + 'use strict'; + exports.default = HelperInstanceStream; function HelperInstanceStream(helper, params, hash, label) { this.init(label); this.helper = helper; @@ -9801,10 +9498,12 @@ return this.helper.compute(_emberHtmlbarsStreamsUtils.getArrayValues(this.params), _emberHtmlbarsStreamsUtils.getHashValues(this.hash)); } }); }); enifed('ember-htmlbars/streams/utils', ['exports', 'ember-htmlbars/hooks/get-value'], function (exports, _emberHtmlbarsHooksGetValue) { + 'use strict'; + exports.getArrayValues = getArrayValues; exports.getHashValues = getHashValues; // We don't want to leak mutable cells into helpers, which // are pure functions that can only work with values. @@ -9827,10 +9526,17 @@ return out; } }); enifed('ember-htmlbars/system/append-templated-view', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-views/views/view'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberViewsViewsView) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.default = appendTemplatedView; function appendTemplatedView(parentView, morph, viewClassOrInstance, props) { var viewProto; if (_emberViewsViewsView.default.detectInstance(viewClassOrInstance)) { @@ -9855,24 +9561,27 @@ props._morph = morph; return parentView.appendChild(viewClassOrInstance, props); } }); -/** -@module ember -@submodule ember-htmlbars -*/ - // Ember.assert enifed('ember-htmlbars/system/bootstrap', ['exports', 'ember-metal/core', 'ember-views/component_lookup', 'ember-views/system/jquery', 'ember-metal/error', 'ember-runtime/system/lazy_load', 'ember-template-compiler/system/compile', 'ember-metal/environment'], function (exports, _emberMetalCore, _emberViewsComponent_lookup, _emberViewsSystemJquery, _emberMetalError, _emberRuntimeSystemLazy_load, _emberTemplateCompilerSystemCompile, _emberMetalEnvironment) { + /*globals Handlebars */ /** @module ember @submodule ember-htmlbars */ + 'use strict'; + /** + @module ember + @submodule ember-htmlbars + */ + + /** Find templates stored in the head tag as script tags and make them available to `Ember.CoreView` in the global `Ember.TEMPLATES` object. This will be run as as jQuery DOM-ready callback. Script tags with `text/x-handlebars` will be compiled @@ -9952,17 +9661,13 @@ }); }); exports.default = bootstrap; }); -/*globals Handlebars */ - -/** -@module ember -@submodule ember-htmlbars -*/ enifed('ember-htmlbars/system/discover-known-helpers', ['exports', 'ember-metal/features', 'ember-metal/dictionary'], function (exports, _emberMetalFeatures, _emberMetalDictionary) { + 'use strict'; + exports.default = discoverKnownHelpers; function discoverKnownHelpers(container) { var registry = container && container._registry; var helpers = _emberMetalDictionary.default(null); @@ -9983,10 +9688,11 @@ return helpers; } }); enifed('ember-htmlbars/system/dom-helper', ['exports', 'dom-helper', 'ember-htmlbars/morphs/morph', 'ember-htmlbars/morphs/attr-morph'], function (exports, _domHelper, _emberHtmlbarsMorphsMorph, _emberHtmlbarsMorphsAttrMorph) { + 'use strict'; function EmberDOMHelper(_document) { _domHelper.default.call(this, _document); } @@ -9994,26 +9700,13 @@ proto.MorphClass = _emberHtmlbarsMorphsMorph.default; proto.AttrMorphClass = _emberHtmlbarsMorphsAttrMorph.default; exports.default = EmberDOMHelper; }); -enifed("ember-htmlbars/system/helper", ["exports"], function (exports) { - /** - @module ember - @submodule ember-templates - */ - - function Helper(helper) { - this.helperFunction = helper; - - this.isHelper = true; - this.isHTMLBars = true; - } - - exports.default = Helper; -}); enifed('ember-htmlbars/system/instrumentation-support', ['exports', 'ember-metal/instrumentation'], function (exports, _emberMetalInstrumentation) { + 'use strict'; + exports.instrument = instrument; /** Provides instrumentation for node managers. @@ -10051,27 +9744,36 @@ } else { return callback.call(context); } } }); -enifed('ember-htmlbars/system/invoke-helper', ['exports', 'ember-metal/core', 'ember-htmlbars/streams/helper-instance', 'ember-htmlbars/streams/helper-factory', 'ember-htmlbars/streams/built-in-helper', 'ember-htmlbars/streams/compat-helper'], function (exports, _emberMetalCore, _emberHtmlbarsStreamsHelperInstance, _emberHtmlbarsStreamsHelperFactory, _emberHtmlbarsStreamsBuiltInHelper, _emberHtmlbarsStreamsCompatHelper) { +enifed('ember-htmlbars/system/invoke-helper', ['exports', 'ember-metal/core', 'ember-htmlbars/streams/helper-instance', 'ember-htmlbars/streams/helper-factory', 'ember-htmlbars/streams/built-in-helper'], function (exports, _emberMetalCore, _emberHtmlbarsStreamsHelperInstance, _emberHtmlbarsStreamsHelperFactory, _emberHtmlbarsStreamsBuiltInHelper) { + 'use strict'; + exports.buildHelperStream = buildHelperStream; - function buildHelperStream(helper, params, hash, templates, env, scope, context, label) { - _emberMetalCore.default.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.template.meta); + function buildHelperStream(helper, params, hash, templates, env, scope, label) { + _emberMetalCore.default.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)); + _emberMetalCore.default.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 if (helper.helperFunction) { - return new _emberHtmlbarsStreamsCompatHelper.default(helper, params, hash, templates, env, scope, label); } else { - return new _emberHtmlbarsStreamsBuiltInHelper.default(helper, params, hash, templates, env, scope, context, label); + templates = templates || { template: {}, inverse: {} }; + return new _emberHtmlbarsStreamsBuiltInHelper.default(helper, params, hash, templates, env, scope, label); } } }); -enifed('ember-htmlbars/system/lookup-helper', ['exports', 'ember-metal/core', 'ember-metal/cache', 'ember-htmlbars/compat/helper'], function (exports, _emberMetalCore, _emberMetalCache, _emberHtmlbarsCompatHelper) { +enifed('ember-htmlbars/system/lookup-helper', ['exports', 'ember-metal/core', 'ember-metal/cache'], function (exports, _emberMetalCore, _emberMetalCache) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.validateLazyHelperName = validateLazyHelperName; exports.findHelper = findHelper; exports.default = lookupHelper; var CONTAINS_DASH_CACHE = new _emberMetalCache.default(1000, function (key) { return key.indexOf('-') !== -1; @@ -10087,14 +9789,10 @@ if (knownHelpers[helperName] || CONTAINS_DASH_CACHE.get(helperName)) { return true; } } - function isLegacyBareHelper(helper) { - return helper && (!helper.isHelperFactory && !helper.isHelperInstance && !helper.isHTMLBars); - } - /** Used to lookup/resolve handlebars helpers. The lookup order is: * Look for a registered helper * If a dash exists in the name: @@ -10115,14 +9813,11 @@ var container = env.container; if (validateLazyHelperName(name, container, env.hooks.keywords, env.knownHelpers)) { var helperName = 'helper:' + name; if (container._registry.has(helperName)) { helper = container.lookupFactory(helperName); - if (isLegacyBareHelper(helper)) { - _emberMetalCore.default.deprecate('The helper "' + name + '" is a deprecated bare function helper. Please use Ember.Helper.build to wrap helper functions.'); - helper = new _emberHtmlbarsCompatHelper.default(helper); - } + _emberMetalCore.default.assert('Expected to find an Ember.Helper with the name ' + helperName + ', but found an object of type ' + typeof helper + ' instead.', helper.isHelperFactory || helper.isHelperInstance); } } } return helper; @@ -10134,42 +9829,17 @@ _emberMetalCore.default.assert('A helper named \'' + name + '\' could not be found', !!helper); return helper; } }); -/** -@module ember -@submodule ember-htmlbars -*/ -enifed("ember-htmlbars/system/make-view-helper", ["exports"], function (exports) { - exports.default = makeViewHelper; +enifed('ember-htmlbars/system/make_bound_helper', ['exports', 'ember-metal/core', 'ember-htmlbars/helper'], function (exports, _emberMetalCore, _emberHtmlbarsHelper) { /** @module ember @submodule ember-htmlbars */ + 'use strict'; - /** - Returns a helper function that renders the provided ViewClass. - - Used internally by Ember.Handlebars.helper and other methods - involving helper/component registration. - - @private - @method makeViewHelper - @param {Function} ViewClass view class constructor - @since 1.2.0 - */ - - function makeViewHelper(ViewClass) { - return { - isLegacyViewHelper: true, - isHTMLBars: true, - viewClass: ViewClass - }; - } -}); -enifed('ember-htmlbars/system/make_bound_helper', ['exports', 'ember-htmlbars/helper'], function (exports, _emberHtmlbarsHelper) { 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 @@ -10213,18 +9883,17 @@ @param {Function} fn @since 1.10.0 */ function makeBoundHelper(fn) { + _emberMetalCore.default.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' }); return _emberHtmlbarsHelper.helper(fn); } }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed('ember-htmlbars/system/render-env', ['exports', 'ember-htmlbars/env', 'ember-htmlbars/system/discover-known-helpers'], function (exports, _emberHtmlbarsEnv, _emberHtmlbarsSystemDiscoverKnownHelpers) { + 'use strict'; + exports.default = RenderEnv; function RenderEnv(options) { this.lifecycleHooks = options.lifecycleHooks || []; this.renderedViews = options.renderedViews || []; @@ -10284,10 +9953,12 @@ knownHelpers: this.knownHelpers }); }; }); enifed('ember-htmlbars/system/render-view', ['exports', 'ember-htmlbars/node-managers/view-node-manager', 'ember-htmlbars/system/render-env'], function (exports, _emberHtmlbarsNodeManagersViewNodeManager, _emberHtmlbarsSystemRenderEnv) { + 'use strict'; + exports.renderHTMLBarsBlock = renderHTMLBarsBlock; // This function only gets called once per render of a "root view" (`appendTo`). Otherwise, // HTMLBars propagates the existing env and renders templates for a given render node. @@ -10300,10 +9971,12 @@ nodeManager.render(env, {}); } }); enifed("ember-htmlbars/templates/component", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { + "use strict"; + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { return { meta: {}, arity: 0, cachedFragment: null, @@ -10326,10 +9999,12 @@ templates: [] }; })()); }); enifed("ember-htmlbars/templates/container-view", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { + "use strict"; + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { var child0 = (function () { return { meta: {}, arity: 1, @@ -10424,10 +10099,12 @@ templates: [child0, child1] }; })()); }); enifed("ember-htmlbars/templates/empty", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { + "use strict"; + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { return { meta: {}, arity: 0, cachedFragment: null, @@ -10444,10 +10121,12 @@ templates: [] }; })()); }); enifed("ember-htmlbars/templates/legacy-each", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { + "use strict"; + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { var child0 = (function () { var child0 = (function () { var child0 = (function () { var child0 = (function () { @@ -10734,10 +10413,12 @@ templates: [child0, child1] }; })()); }); enifed("ember-htmlbars/templates/link-to-escaped", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { + "use strict"; + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { return { meta: {}, arity: 0, cachedFragment: null, @@ -10760,10 +10441,12 @@ templates: [] }; })()); }); enifed("ember-htmlbars/templates/link-to-unescaped", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { + "use strict"; + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { return { meta: {}, arity: 0, cachedFragment: null, @@ -10786,10 +10469,12 @@ templates: [] }; })()); }); enifed("ember-htmlbars/templates/link-to", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { + "use strict"; + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { var child0 = (function () { var child0 = (function () { return { meta: {}, @@ -10908,10 +10593,12 @@ templates: [child0, child1] }; })()); }); enifed("ember-htmlbars/templates/select-optgroup", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { + "use strict"; + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { var child0 = (function () { return { meta: {}, arity: 1, @@ -10958,10 +10645,12 @@ templates: [child0] }; })()); }); enifed("ember-htmlbars/templates/select-option", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { + "use strict"; + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { return { meta: {}, arity: 0, cachedFragment: null, @@ -10984,10 +10673,12 @@ templates: [] }; })()); }); enifed("ember-htmlbars/templates/select", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { + "use strict"; + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { var child0 = (function () { return { meta: {}, arity: 0, @@ -11135,10 +10826,12 @@ templates: [child0, child1, child2] }; })()); }); enifed("ember-htmlbars/templates/top-level-view", ["exports", "ember-template-compiler/system/template"], function (exports, _emberTemplateCompilerSystemTemplate) { + "use strict"; + exports.default = _emberTemplateCompilerSystemTemplate.default((function () { return { meta: {}, arity: 0, cachedFragment: null, @@ -11160,11 +10853,13 @@ locals: [], templates: [] }; })()); }); -enifed('ember-htmlbars/utils/decode-each-key', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/utils'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalUtils) { +enifed('ember-htmlbars/utils/decode-each-key', ['exports', 'ember-metal/property_get', 'ember-metal/utils'], function (exports, _emberMetalProperty_get, _emberMetalUtils) { + 'use strict'; + exports.default = decodeEachKey; function identity(item) { var key = undefined; var type = typeof item; @@ -11177,24 +10872,16 @@ return key; } function decodeEachKey(item, keyPath, index) { - var key, deprecatedSpecialKey; + var key; switch (keyPath) { case '@index': key = index; break; - case '@guid': - deprecatedSpecialKey = '@guid'; - key = _emberMetalUtils.guidFor(item); - break; - case '@item': - deprecatedSpecialKey = '@item'; - key = item; - break; case '@identity': key = identity(item); break; default: if (keyPath) { @@ -11206,16 +10893,21 @@ if (typeof key === 'number') { key = String(key); } - _emberMetalCore.default.deprecate('Using \'' + deprecatedSpecialKey + '\' with the {{each}} helper, is deprecated. Switch to \'@identity\' or remove \'key=\' from your template.', !deprecatedSpecialKey); - return key; } }); enifed('ember-htmlbars/utils/is-component', ['exports', 'ember-htmlbars/system/lookup-helper'], function (exports, _emberHtmlbarsSystemLookupHelper) { + /** + @module ember + @submodule ember-htmlbars + */ + + 'use strict'; + exports.default = isComponent; /* Given a path name, returns whether or not a component with that name was found in the container. @@ -11230,15 +10922,13 @@ return false; } return container._registry.has('component:' + path) || container._registry.has('template:components/' + path); } }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed('ember-htmlbars/utils/lookup-component', ['exports'], function (exports) { + 'use strict'; + exports.default = lookupComponent; function lookupComponent(container, tagName) { var componentLookup = container.lookup('component-lookup:main'); @@ -11247,10 +10937,12 @@ layout: componentLookup.layoutFor(tagName, container) }; } }); enifed("ember-htmlbars/utils/normalize-self", ["exports"], function (exports) { + "use strict"; + exports.default = normalizeSelf; function normalizeSelf(self) { if (self === undefined) { return null; @@ -11258,11 +10950,17 @@ return self; } } }); enifed('ember-htmlbars/utils/string', ['exports', 'ember-metal/core', 'ember-runtime/system/string', 'htmlbars-util'], function (exports, _emberMetalCore, _emberRuntimeSystemString, _htmlbarsUtil) { + /** + @module ember + @submodule ember-htmlbars + */ + 'use strict'; + /** Mark a string as safe for unescaped output with Ember templates. If you return HTML from a helper, use this function to ensure Ember's rendering layer does not escape the HTML. @@ -11296,15 +10994,13 @@ exports.SafeString = _htmlbarsUtil.SafeString; exports.htmlSafe = htmlSafe; exports.escapeExpression = _htmlbarsUtil.escapeExpression; }); -/** -@module ember -@submodule ember-htmlbars -*/ enifed('ember-htmlbars/utils/subscribe', ['exports', 'ember-metal/streams/utils'], function (exports, _emberMetalStreamsUtils) { + 'use strict'; + exports.default = subscribe; function subscribe(node, env, scope, stream) { if (!_emberMetalStreamsUtils.isStream(stream)) { return; @@ -11331,10 +11027,12 @@ node.ownerNode.emberView.scheduleRevalidate(node, _emberMetalStreamsUtils.labelFor(stream)); })); } }); enifed('ember-htmlbars/utils/update-scope', ['exports', 'ember-metal/streams/proxy-stream', 'ember-htmlbars/utils/subscribe'], function (exports, _emberMetalStreamsProxyStream, _emberHtmlbarsUtilsSubscribe) { + 'use strict'; + exports.default = updateScope; function updateScope(scope, key, newValue, renderNode, isSelf) { var existing = scope[key]; @@ -11348,13 +11046,16 @@ scope[key] = stream; } } }); enifed('ember-metal-views', ['exports', 'ember-metal-views/renderer'], function (exports, _emberMetalViewsRenderer) { + '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/merge', 'ember-metal/set_properties', 'ember-views/system/build-component-template'], function (exports, _emberMetalRun_loop, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMerge, _emberMetalSet_properties, _emberViewsSystemBuildComponentTemplate) { + 'use strict'; function Renderer(_helper) { this._dom = _helper; } @@ -11364,11 +11065,11 @@ } view.ownerView = renderNode.emberView = view; view._renderNode = renderNode; var layout = _emberMetalProperty_get.get(view, 'layout'); - var template = view.isComponent ? _emberMetalProperty_get.get(view, '_template') : _emberMetalProperty_get.get(view, 'template'); + var template = _emberMetalProperty_get.get(view, 'template'); var componentInfo = { component: view, layout: layout }; var block = _emberViewsSystemBuildComponentTemplate.default(componentInfo, {}, { self: view, @@ -11478,11 +11179,10 @@ Renderer.prototype.setAttrs = function (view, attrs) { _emberMetalProperty_set.set(view, 'attrs', attrs); }; // set attrs the first time Renderer.prototype.componentInitAttrs = function (component, attrs) { - _emberMetalProperty_set.set(component, 'attrs', attrs); component.trigger('didInitAttrs', { attrs: attrs }); component.trigger('didReceiveAttrs', { newAttrs: attrs }); }; // set attrs the first time Renderer.prototype.didInsertElement = function (view) { @@ -11564,11 +11264,11 @@ } this.didDestroyElement(view); } }; - Renderer.prototype.willRemoveElement = function () {}; + Renderer.prototype.willRemoveElement = function () /*view*/{}; Renderer.prototype.willDestroyElement = function (view) { if (view._willDestroyElement) { view._willDestroyElement(); } @@ -11598,13 +11298,19 @@ } }; // element destroyed so view.destroy shouldn't try to remove it removedFromDOM exports.default = Renderer; }); -/*view*/ enifed('ember-metal', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/merge', 'ember-metal/instrumentation', 'ember-metal/utils', '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', 'ember-metal/streams/utils', 'ember-metal/streams/stream'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalMerge, _emberMetalInstrumentation, _emberMetalUtils, _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, _emberMetalStreamsUtils, _emberMetalStreamsStream) { + /** + @module ember + @submodule ember-metal + */ + // BEGIN IMPORTS + 'use strict'; + _emberMetalComputed.computed.empty = _emberMetalComputed_macros.empty; _emberMetalComputed.computed.notEmpty = _emberMetalComputed_macros.notEmpty; _emberMetalComputed.computed.none = _emberMetalComputed_macros.none; _emberMetalComputed.computed.not = _emberMetalComputed_macros.not; _emberMetalComputed.computed.bool = _emberMetalComputed_macros.bool; @@ -11649,13 +11355,10 @@ _emberMetalCore.default.Error = _emberMetalError.default; _emberMetalCore.default.guidFor = _emberMetalUtils.guidFor; _emberMetalCore.default.META_DESC = _emberMetalUtils.META_DESC; _emberMetalCore.default.EMPTY_META = _emberMetalUtils.EMPTY_META; _emberMetalCore.default.meta = _emberMetalUtils.meta; - _emberMetalCore.default.getMeta = _emberMetalUtils.getMeta; - _emberMetalCore.default.setMeta = _emberMetalUtils.setMeta; - _emberMetalCore.default.metaPath = _emberMetalUtils.metaPath; _emberMetalCore.default.inspect = _emberMetalUtils.inspect; _emberMetalCore.default.tryCatchFinally = _emberMetalUtils.deprecatedTryCatchFinally; _emberMetalCore.default.makeArray = _emberMetalUtils.makeArray; _emberMetalCore.default.canInvoke = _emberMetalUtils.canInvoke; _emberMetalCore.default.tryInvoke = _emberMetalUtils.tryInvoke; @@ -11738,11 +11441,10 @@ _emberMetalCore.default.observer = _emberMetalMixin.observer; _emberMetalCore.default.immediateObserver = _emberMetalMixin._immediateObserver; _emberMetalCore.default.mixin = _emberMetalMixin.mixin; _emberMetalCore.default.Mixin = _emberMetalMixin.Mixin; - _emberMetalCore.default.oneWay = _emberMetalBinding.oneWay; _emberMetalCore.default.bind = _emberMetalBinding.bind; _emberMetalCore.default.Binding = _emberMetalBinding.Binding; _emberMetalCore.default.isGlobalPath = _emberMetalBinding.isGlobalPath; _emberMetalCore.default.run = _emberMetalRun_loop.default; @@ -11799,22 +11501,18 @@ // This needs to be called before any deprecateFunc if (_emberMetalCore.default.__loader.registry['ember-debug']) { requireModule('ember-debug'); } - _emberMetalCore.default.create = _emberMetalCore.default.deprecateFunc('Ember.create is deprecated in favor of Object.create', Object.create); - _emberMetalCore.default.keys = _emberMetalCore.default.deprecateFunc('Ember.keys is deprecated in favor of Object.keys', Object.keys); + _emberMetalCore.default.create = _emberMetalCore.default.deprecateFunc('Ember.create is deprecated in favor of Object.create', { id: 'ember-metal.ember-create', until: '3.0.0' }, Object.create); + _emberMetalCore.default.keys = _emberMetalCore.default.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; }); -/** -@module ember -@submodule ember-metal -*/ - -// BEGIN IMPORTS enifed('ember-metal/alias', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/core', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/utils', 'ember-metal/dependent_keys'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalCore, _emberMetalError, _emberMetalProperties, _emberMetalComputed, _emberMetalUtils, _emberMetalDependent_keys) { + 'use strict'; + exports.default = alias; exports.AliasedProperty = AliasedProperty; function alias(altKey) { return new AliasedProperty(altKey); @@ -11882,12 +11580,13 @@ AliasedProperty.prototype._meta = undefined; AliasedProperty.prototype.meta = _emberMetalComputed.ComputedProperty.prototype.meta; }); // Ember.assert enifed('ember-metal/binding', ['exports', 'ember-metal/core', '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, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalObserver, _emberMetalRun_loop, _emberMetalPath_cache) { + 'use strict'; + exports.bind = bind; - exports.oneWay = oneWay; // ES6TODO: where is Ember.lookup defined? /** @module ember @submodule ember-metal @@ -12139,18 +11838,18 @@ _emberMetalProperty_set.trySet(obj, toPath, fromValue); }); } // if we're synchronizing *to* the remote object } else if (direction === 'back') { - var toValue = _emberMetalProperty_get.get(obj, this._to); - if (log) { - _emberMetalCore.default.Logger.log(' ', this.toString(), '<-', toValue, obj); + var toValue = _emberMetalProperty_get.get(obj, this._to); + if (log) { + _emberMetalCore.default.Logger.log(' ', this.toString(), '<-', toValue, obj); + } + _emberMetalObserver._suspendObserver(obj, fromPath, this, this.fromDidChange, function () { + _emberMetalProperty_set.trySet(_emberMetalPath_cache.isGlobal(fromPath) ? _emberMetalCore.default.lookup : obj, fromPath, toValue); + }); } - _emberMetalObserver._suspendObserver(obj, fromPath, this, this.fromDidChange, function () { - _emberMetalProperty_set.trySet(_emberMetalPath_cache.isGlobal(fromPath) ? _emberMetalCore.default.lookup : obj, fromPath, toValue); - }); - } } }; function mixinProperties(to, from) { @@ -12332,31 +12031,17 @@ function bind(obj, to, from) { return new Binding(to, from).connect(obj); } - /** - @method oneWay - @for Ember - @param {Object} obj The root object of the transform. - @param {String} to The path to the 'to' side of the binding. - Must be relative to obj. - @param {String} from The path to the 'from' side of the binding. - Must be relative to obj or a global path. - @return {Ember.Binding} binding instance - @public - */ - - function oneWay(obj, to, from) { - return new Binding(to, from).oneWay().connect(obj); - } - exports.Binding = Binding; exports.isGlobalPath = _emberMetalPath_cache.isGlobal; }); // Ember.Logger, Ember.LOG_BINDINGS, assert enifed('ember-metal/cache', ['exports', 'ember-metal/dictionary'], function (exports, _emberMetalDictionary) { + 'use strict'; + exports.default = Cache; function Cache(limit, func) { this.store = _emberMetalDictionary.default(null); this.size = 0; @@ -12406,14 +12091,15 @@ this.misses = 0; } }; }); enifed('ember-metal/chains', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/utils', 'ember-metal/watch_key'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalUtils, _emberMetalWatch_key) { + 'use strict'; + exports.flushPendingChains = flushPendingChains; exports.finishChains = finishChains; - var warn = _emberMetalCore.default.warn; var FIRST_KEY = /^([^\.]+)/; function firstKey(path) { return path.match(FIRST_KEY)[0]; } @@ -12428,10 +12114,97 @@ function Chains() {} Chains.prototype = Object.create(null); + function ChainWatchers(obj) { + // this obj would be the referencing chain node's parent node's value + this.obj = obj; + // 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 Chains(); + } + + ChainWatchers.prototype = { + add: function (key, node) { + var nodes = this.chains[key]; + if (nodes === undefined) { + this.chains[key] = [node]; + } else { + nodes.push(node); + } + }, + + remove: function (key, node) { + var nodes = this.chains[key]; + if (nodes) { + for (var i = 0, l = nodes.length; i < l; i++) { + if (nodes[i] === node) { + nodes.splice(i, 1); + break; + } + } + } + }, + + has: function (key, node) { + var nodes = this.chains[key]; + if (nodes) { + for (var i = 0, l = nodes.length; i < l; i++) { + if (nodes[i] === node) { + return true; + } + } + } + return false; + }, + + revalidateAll: function () { + for (var key in this.chains) { + this.notify(key, true, undefined); + } + }, + + revalidate: function (key) { + this.notify(key, true, undefined); + }, + + // key: the string key that is part of a path changed + // revalidate: boolean the chains that are watching this value should revalidate + // callback: function that will be called with the the object and path that + // will be/are invalidated by this key change depending on the + // whether the revalidate flag is passed + notify: function (key, revalidate, callback) { + var nodes = this.chains[key]; + if (nodes === undefined || nodes.length === 0) { + return; + } + + var affected = undefined; + + if (callback) { + affected = []; + } + + for (var i = 0, l = nodes.length; i < l; i++) { + nodes[i].notify(revalidate, affected); + } + + if (callback === undefined) { + return; + } + + // we gather callbacks so we don't notify them during revalidation + for (var i = 0, l = affected.length; i < l; i += 2) { + var obj = affected[i]; + var path = affected[i + 1]; + 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. @@ -12446,56 +12219,45 @@ queue.forEach(function (q) { return q[0].add(q[1]); }); - 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); + _emberMetalCore.default.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 addChainWatcher(obj, keyName, node) { if (!isObject(obj)) { return; } var m = _emberMetalUtils.meta(obj); - var nodes = m.chainWatchers; - if (!m.hasOwnProperty('chainWatchers')) { - // FIXME?! - nodes = m.chainWatchers = new Chains(); + if (m.chainWatchers === undefined || m.chainWatchers.obj !== obj) { + m.chainWatchers = new ChainWatchers(obj); } - if (!nodes[keyName]) { - nodes[keyName] = [node]; - } else { - nodes[keyName].push(node); - } + m.chainWatchers.add(keyName, node); _emberMetalWatch_key.watchKey(obj, keyName, m); } function removeChainWatcher(obj, keyName, node) { if (!isObject(obj)) { return; } - var m = obj['__ember_meta__']; - if (m && !m.hasOwnProperty('chainWatchers')) { + var m = obj.__ember_meta__; + + if (!m || m.chainWatchers === undefined || m.chainWatchers.obj !== obj) { return; - } // nothing to do + } - var nodes = m && m.chainWatchers; + // make meta writable + m = _emberMetalUtils.meta(obj); - if (nodes && nodes[keyName]) { - nodes = nodes[keyName]; - for (var i = 0, l = nodes.length; i < l; i++) { - if (nodes[i] === node) { - nodes.splice(i, 1); - break; - } - } - } + m.chainWatchers.remove(keyName, node); + _emberMetalWatch_key.unwatchKey(obj, keyName, m); } // A ChainNode watches a single key on an object. If you provide a starting // value for the key then the node won't actually watch it. For a root node @@ -12522,19 +12284,10 @@ this._object = parent.value(); if (this._object) { addChainWatcher(this._object, this._key, this); } } - - // Special-case: the EachProxy relies on immediate evaluation to - // establish its observers. - // - // TODO: Replace this with an efficient callback that the EachProxy - // can implement. - if (this._parent && this._parent._key === '@each') { - this.value(); - } } function lazyGet(obj, key) { if (!obj) { return; @@ -12546,18 +12299,18 @@ if (meta && meta.proto === obj) { return; } // Use `get` if the return value is an EachProxy or an uncacheable value. - if (key === '@each' || isVolatile(obj[key])) { + if (isVolatile(obj[key])) { return _emberMetalProperty_get.get(obj, key); // Otherwise attempt to get the cached value of the computed property } else { - if (meta.cache && key in meta.cache) { - return meta.cache[key]; + if (meta.cache && key in meta.cache) { + return meta.cache[key]; + } } - } } ChainNode.prototype = { value: function () { if (this._value === undefined && this._watching) { @@ -12611,20 +12364,20 @@ 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; + 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]; - } + // 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); }, @@ -12694,139 +12447,82 @@ chains[node._key] = undefined; node.destroy(); } }, - willChange: function (events) { + notify: function (revalidate, affected) { + if (revalidate && this._watching) { + var obj = this._parent.value(); + if (obj !== this._object) { + removeChainWatcher(this._object, this._key, this); + this._object = obj; + addChainWatcher(obj, this._key, this); + } + this._value = undefined; + } + + // then notify chains... var chains = this._chains; var node; if (chains) { for (var key in chains) { node = chains[key]; if (node !== undefined) { - node.willChange(events); + node.notify(revalidate, affected); } } } - if (this._parent) { - this._parent.chainWillChange(this, this._key, 1, events); + if (affected && this._parent) { + this._parent.populateAffected(this, this._key, 1, affected); } }, - chainWillChange: function (chain, path, depth, events) { + populateAffected: function (chain, path, depth, affected) { if (this._key) { path = this._key + '.' + path; } if (this._parent) { - this._parent.chainWillChange(this, path, depth + 1, events); + this._parent.populateAffected(this, path, depth + 1, affected); } else { if (depth > 1) { - events.push(this.value(), path); + affected.push(this.value(), path); } path = 'this.' + path; if (this._paths[path] > 0) { - events.push(this.value(), path); + affected.push(this.value(), path); } } - }, - - chainDidChange: function (chain, path, depth, events) { - if (this._key) { - path = this._key + '.' + path; - } - - if (this._parent) { - this._parent.chainDidChange(this, path, depth + 1, events); - } else { - if (depth > 1) { - events.push(this.value(), path); - } - path = 'this.' + path; - if (this._paths[path] > 0) { - events.push(this.value(), path); - } - } - }, - - didChange: function (events) { - // invalidate my own value first. - if (this._watching) { - var obj = this._parent.value(); - if (obj !== this._object) { - removeChainWatcher(this._object, this._key, this); - this._object = obj; - addChainWatcher(obj, this._key, this); - } - this._value = undefined; - - // Special-case: the EachProxy relies on immediate evaluation to - // establish its observers. - if (this._parent && this._parent._key === '@each') { - this.value(); - } - } - - // then notify chains... - var chains = this._chains; - var node; - if (chains) { - for (var key in chains) { - node = chains[key]; - if (node !== undefined) { - node.didChange(events); - } - } - } - - // if no events are passed in then we only care about the above wiring update - if (events === null) { - return; - } - - // and finally tell parent about my path changing... - if (this._parent) { - this._parent.chainDidChange(this, this._key, 1, events); - } } }; function finishChains(obj) { // We only create meta if we really have to - var m = obj['__ember_meta__']; - var chains, chainWatchers, chainNodes; - + var m = obj.__ember_meta__; if (m) { // finish any current chains node watchers that reference obj - chainWatchers = m.chainWatchers; + var chainWatchers = m.chainWatchers; if (chainWatchers) { - for (var key in chainWatchers) { - chainNodes = chainWatchers[key]; - if (chainNodes) { - for (var i = 0, l = chainNodes.length; i < l; i++) { - var node = chainNodes[i]; - if (node) { - node.didChange(null); - } - } - } - } + chainWatchers.revalidateAll(); } // copy chains from prototype - chains = m.chains; + var chains = m.chains; if (chains && chains.value() !== obj) { - _emberMetalUtils.meta(obj).chains = chains = chains.copy(obj); + // need to check if meta is writable + _emberMetalUtils.meta(obj).chains = chains.copy(obj); } } } exports.removeChainWatcher = removeChainWatcher; exports.ChainNode = ChainNode; }); // warn, assert, etc; 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'; + exports.default = computed; /** @module ember @submodule ember-metal @@ -13020,10 +12716,11 @@ */ ComputedPropertyPrototype.property = function () { var args; var addArg = function (property) { + _emberMetalCore.default.assert('Depending on arrays using a dependent key ending with `@each` is no longer supported. ' + ('Please refactor from `Ember.computed(\'' + property + '\', function() {});` to `Ember.computed(\'' + property.slice(0, -6) + '.[]\', function() {})`.'), property.slice(-5) !== '@each'); args.push(property); }; args = []; for (var i = 0, l = arguments.length; i < l; i++) { @@ -13080,16 +12777,10 @@ _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); } } }; - function finishChains(chainNodes) { - for (var i = 0, l = chainNodes.length; i < l; i++) { - chainNodes[i].didChange(null); - } - } - /** 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. @@ -13114,11 +12805,11 @@ @param {String} keyName The key being accessed. @return {Object} The return value of the function backing the CP. @public */ ComputedPropertyPrototype.get = function (obj, keyName) { - var ret, cache, meta, chainNodes; + var ret, cache, meta; if (this._cacheable) { meta = metaFor(obj); cache = meta.cache; var result = cache && cache[keyName]; @@ -13138,13 +12829,12 @@ cache[keyName] = UNDEFINED; } else { cache[keyName] = ret; } - chainNodes = meta.chainWatchers && meta.chainWatchers[keyName]; - if (chainNodes) { - finishChains(chainNodes); + if (meta.chainWatchers) { + meta.chainWatchers.revalidate(keyName); } _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); } else { ret = this._getter.call(obj, keyName); } @@ -13411,10 +13101,12 @@ exports.ComputedProperty = ComputedProperty; exports.computed = computed; exports.cacheFor = cacheFor; }); enifed('ember-metal/computed_macros', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/computed', 'ember-metal/is_empty', 'ember-metal/is_none', 'ember-metal/alias'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberMetalIs_empty, _emberMetalIs_none, _emberMetalAlias) { + 'use strict'; + exports.empty = empty; exports.notEmpty = notEmpty; exports.none = none; exports.not = not; exports.bool = bool; @@ -13903,16 +13595,18 @@ @return {Ember.ComputedProperty} computed property which performs a logical `or` on the values of all the original values for properties. @public */ var or = generateComputedWithProperties(function (properties) { + var value; for (var key in properties) { - if (properties.hasOwnProperty(key) && properties[key]) { - return properties[key]; + value = properties[key]; + if (properties.hasOwnProperty(key) && value) { + return value; } } - return false; + return value; }); exports.or = or; /** A computed property that returns the array of values @@ -14086,18 +13780,18 @@ alias with a deprecation to the original value for property. @since 1.7.0 @public */ - function deprecatingAlias(dependentKey) { + function deprecatingAlias(dependentKey, options) { return _emberMetalComputed.computed(dependentKey, { get: function (key) { - _emberMetalCore.default.deprecate('Usage of `' + key + '` is deprecated, use `' + dependentKey + '` instead.'); + _emberMetalCore.default.deprecate('Usage of `' + key + '` is deprecated, use `' + dependentKey + '` instead.', false, options); return _emberMetalProperty_get.get(this, dependentKey); }, set: function (key, value) { - _emberMetalCore.default.deprecate('Usage of `' + key + '` is deprecated, use `' + dependentKey + '` instead.'); + _emberMetalCore.default.deprecate('Usage of `' + key + '` is deprecated, use `' + dependentKey + '` instead.', false, options); _emberMetalProperty_set.set(this, dependentKey, value); return value; } }); } @@ -14123,14 +13817,16 @@ 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.0.0-beta.3 + @version 2.0.0-beta.5 @public */ + 'use strict'; + if ('undefined' === typeof Ember) { // Create core object. Make it act like an instance of Ember.Namespace so that // objects assigned to it are given a sane string representation. Ember = {}; } @@ -14155,15 +13851,15 @@ /** The semantic version. @property VERSION @type String - @default '2.0.0-beta.3' + @default '2.0.0-beta.5' @static @public */ - Ember.VERSION = '2.0.0-beta.3'; + Ember.VERSION = '2.0.0-beta.5'; /** 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 @@ -14257,11 +13953,10 @@ /** An empty function useful for some operations. Always returns `this`. @method K - @private @return {Object} @public */ function K() { return this; @@ -14299,15 +13994,16 @@ } exports.default = Ember; }); enifed('ember-metal/dependent_keys', ['exports', 'ember-metal/watching'], function (exports, _emberMetalWatching) { - exports.addDependentKeys = addDependentKeys; - exports.removeDependentKeys = removeDependentKeys; // Remove "use strict"; from transpiled module until // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed // + + exports.addDependentKeys = addDependentKeys; + exports.removeDependentKeys = removeDependentKeys; 'REMOVE_USE_STRICT: true'; /** @module ember @submodule ember-metal @@ -14389,10 +14085,17 @@ _emberMetalWatching.unwatch(obj, depKey, meta); } } }); enifed('ember-metal/deprecate_property', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set) { + /** + @module ember + @submodule ember-metal + */ + + 'use strict'; + exports.deprecateProperty = deprecateProperty; /** Used internally to allow changing properties in a backwards compatible way, and print a helpful deprecation warning. @@ -14403,13 +14106,13 @@ @param {String} newKey The property that will be aliased. @private @since 1.7.0 */ - function deprecateProperty(object, deprecatedKey, newKey) { + function deprecateProperty(object, deprecatedKey, newKey, options) { function deprecate() { - _emberMetalCore.default.deprecate('Usage of `' + deprecatedKey + '` is deprecated, use `' + newKey + '` instead.'); + _emberMetalCore.default.deprecate('Usage of `' + deprecatedKey + '` is deprecated, use `' + newKey + '` instead.', false, options); } Object.defineProperty(object, deprecatedKey, { configurable: true, enumerable: false, @@ -14422,31 +14125,29 @@ return _emberMetalProperty_get.get(this, newKey); } }); } }); -/** -@module ember -@submodule ember-metal -*/ enifed('ember-metal/dictionary', ['exports'], function (exports) { - exports.default = makeDictionary; - // the delete is meant to hint at runtimes that this object should remain in // dictionary mode. This is clearly a runtime specific hack, but currently it // appears worthwhile in some usecases. Please note, these deletes do increase // the cost of creation dramatically over a plain Object.create. And as this // only makes sense for long-lived dictionaries that aren't instantiated often. + 'use strict'; + exports.default = makeDictionary; + function makeDictionary(parent) { var dict = Object.create(parent); dict['_dict'] = null; delete dict['_dict']; return dict; } }); enifed('ember-metal/environment', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) { + 'use strict'; /* Ember can run in many different environments, including environments like Node.js where the DOM is unavailable. This object serves as an abstraction over the browser features that Ember relies on, so that code does not @@ -14487,10 +14188,12 @@ } exports.default = environment; }); enifed('ember-metal/error', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) { + 'use strict'; + exports.default = EmberError; var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; /** @@ -14523,24 +14226,30 @@ } EmberError.prototype = Object.create(Error.prototype); }); enifed('ember-metal/events', ['exports', 'ember-metal/core', 'ember-metal/utils'], function (exports, _emberMetalCore, _emberMetalUtils) { + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed + // + exports.accumulateListeners = accumulateListeners; exports.addListener = addListener; exports.suspendListener = suspendListener; exports.suspendListeners = suspendListeners; exports.watchedEvents = watchedEvents; exports.sendEvent = sendEvent; exports.hasListeners = hasListeners; exports.listenersFor = listenersFor; exports.on = on; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - // 'REMOVE_USE_STRICT: true'; + /** + @module ember + @submodule ember-metal + */ + /* listener flags */ var ONCE = 1; var SUSPENDED = 2; /* @@ -14844,15 +14553,10 @@ @return true @public */ function sendEvent(obj, eventName, params, actions) { - // first give object a chance to handle it - if (obj !== _emberMetalCore.default && 'function' === typeof obj.sendEvent) { - obj.sendEvent(eventName, params); - } - if (!actions) { var meta = obj['__ember_meta__']; actions = meta && meta.listeners && meta.listeners[eventName]; } @@ -14972,15 +14676,13 @@ return func; } exports.removeListener = removeListener; }); -/** -@module ember -@submodule ember-metal -*/ enifed('ember-metal/expand_properties', ['exports', 'ember-metal/error'], function (exports, _emberMetalError) { + 'use strict'; + exports.default = expandProperties; /** @module ember @submodule ember-metal @@ -15001,16 +14703,17 @@ Ember.expandProperties('foo.bar', echo); //=> 'foo.bar' Ember.expandProperties('{foo,bar}', echo); //=> 'foo', 'bar' Ember.expandProperties('foo.{bar,baz}', echo); //=> 'foo.bar', 'foo.baz' Ember.expandProperties('{foo,bar}.baz', echo); //=> 'foo.baz', 'bar.baz' - Ember.expandProperties('foo.{bar,baz}.@each', echo) //=> 'foo.bar.@each', 'foo.baz.@each' + Ember.expandProperties('foo.{bar,baz}.[]', echo) //=> 'foo.bar.[]', 'foo.baz.[]' 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. */ @@ -15051,10 +14754,12 @@ return all; } }); enifed('ember-metal/features', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) { + 'use strict'; + exports.default = isEnabled; /** The hash of enabled Canary features. Add to this, any canary features before creating your application. @@ -15102,10 +14807,12 @@ return false; } } }); enifed('ember-metal/get_properties', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) { + 'use strict'; + exports.default = getProperties; /** To get multiple properties at once, call `Ember.getProperties` with an object followed by a list of strings or an array: @@ -15144,10 +14851,11 @@ } return ret; } }); enifed('ember-metal/injected_property', ['exports', 'ember-metal/core', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/properties'], function (exports, _emberMetalCore, _emberMetalComputed, _emberMetalAlias, _emberMetalProperties) { + 'use strict'; /** Read-only property that returns the result of a container lookup. @class InjectedProperty @@ -15190,10 +14898,12 @@ exports.default = InjectedProperty; }); // Ember.assert enifed('ember-metal/instrumentation', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) { + 'use strict'; + exports.instrument = instrument; exports._instrumentStart = _instrumentStart; exports.subscribe = subscribe; exports.unsubscribe = unsubscribe; exports.reset = reset; @@ -15440,10 +15150,12 @@ subscribers.length = 0; cache = {}; } }); enifed('ember-metal/is_blank', ['exports', 'ember-metal/is_empty'], function (exports, _emberMetalIs_empty) { + 'use strict'; + exports.default = isBlank; /** A value is blank if it is empty or a whitespace string. @@ -15472,10 +15184,11 @@ function isBlank(obj) { return _emberMetalIs_empty.default(obj) || typeof obj === 'string' && obj.match(/\S/) === null; } }); enifed('ember-metal/is_empty', ['exports', 'ember-metal/property_get', 'ember-metal/is_none'], function (exports, _emberMetalProperty_get, _emberMetalIs_none) { + 'use strict'; /** Verifies that a value is `null` or an empty string, empty array, or empty function. @@ -15533,11 +15246,10 @@ } exports.default = isEmpty; }); enifed("ember-metal/is_none", ["exports"], function (exports) { - exports.default = isNone; /** Returns true if the passed value is null or undefined. This avoids errors from JSLint complaining about use of ==, which can be technically confusing. @@ -15554,16 +15266,21 @@ @for Ember @param {Object} obj Value to test @return {Boolean} @public */ + "use strict"; + exports.default = isNone; + function isNone(obj) { return obj === null || obj === undefined; } }); enifed('ember-metal/is_present', ['exports', 'ember-metal/is_blank'], function (exports, _emberMetalIs_blank) { + 'use strict'; + exports.default = isPresent; /** A value is present if it not `isBlank`. @@ -15604,10 +15321,12 @@ @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 @@ -15644,10 +15363,11 @@ } exports.default = keys; }); enifed('ember-metal/libraries', ['exports', 'ember-metal/core', 'ember-metal/features'], function (exports, _emberMetalCore, _emberMetalFeatures) { + 'use strict'; /** Helper class that allows you to register your library with Ember. Singleton created at `Ember.libraries`. @@ -15682,11 +15402,11 @@ if (isCoreLibrary) { index = this._coreLibIndex++; } this._registry.splice(index, 0, { name: name, version: version }); } else { - _emberMetalCore.default.warn('Library "' + name + '" is already registered with Ember.'); + _emberMetalCore.default.warn('Library "' + name + '" is already registered with Ember.', false, { id: 'ember-metal.libraries-register' }); } }, registerCoreLibrary: function (name, version) { this.register(name, version, true); @@ -15698,23 +15418,17 @@ if (lib) { index = this._registry.indexOf(lib); this._registry.splice(index, 1); } - }, - - each: function (callback) { - _emberMetalCore.default.deprecate('Using Ember.libraries.each() is deprecated. Access to a list of registered libraries is currently a private API. If you are not knowingly accessing this method, your out-of-date Ember Inspector may be doing so.'); - this._registry.forEach(function (lib) { - callback(lib.name, lib.version); - }); } }; exports.default = Libraries; }); enifed('ember-metal/logger', ['exports', 'ember-metal/core', 'ember-metal/error'], function (exports, _emberMetalCore, _emberMetalError) { + 'use strict'; function K() { return this; } @@ -15766,11 +15480,11 @@ Inside Ember-Metal, simply uses the methods from `imports.console`. Override this to provide more robust logging functionality. @class Logger @namespace Ember - @private + @public */ exports.default = { /** Logs the arguments to the console. You can pass as many arguments as you want and they will be joined together with a space. @@ -15780,11 +15494,11 @@ // "log value of foo: 1" will be printed to the console ``` @method log @for Ember.Logger @param {*} arguments - @private + @public */ log: consoleMethod('log') || K, /** Prints the arguments to the console with a warning icon. @@ -15794,11 +15508,11 @@ // "Something happened!" will be printed to the console with a warning icon. ``` @method warn @for Ember.Logger @param {*} arguments - @private + @public */ warn: consoleMethod('warn') || K, /** Prints the arguments to the console with an error icon, red text and a stack trace. @@ -15808,11 +15522,11 @@ // "Danger! Danger!" will be printed to the console in red text. ``` @method error @for Ember.Logger @param {*} arguments - @private + @public */ error: consoleMethod('error') || K, /** Logs the arguments to the console. @@ -15823,11 +15537,11 @@ // "log value of foo: 1" will be printed to the console ``` @method info @for Ember.Logger @param {*} arguments - @private + @public */ info: consoleMethod('info') || K, /** Logs the arguments to the console in blue text. @@ -15838,11 +15552,11 @@ // "log value of foo: 1" will be printed to the console ``` @method debug @for Ember.Logger @param {*} arguments - @private + @public */ debug: consoleMethod('debug') || consoleMethod('info') || K, /** If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace. @@ -15851,18 +15565,42 @@ Ember.Logger.assert(true === false); // Throws an Assertion failed error. ``` @method assert @for Ember.Logger @param {Boolean} bool Value to test - @private + @public */ assert: consoleMethod('assert') || assertPolyfill }; }); // Ember.imports -enifed('ember-metal/map', ['exports', 'ember-metal/core', 'ember-metal/utils', 'ember-metal/deprecate_property'], function (exports, _emberMetalCore, _emberMetalUtils, _emberMetalDeprecate_property) { +enifed('ember-metal/map', ['exports', 'ember-metal/core', 'ember-metal/utils'], function (exports, _emberMetalCore, _emberMetalUtils) { + /** + @module ember + @submodule ember-metal + */ + /* + JavaScript (before ES6) does not have a Map implementation. Objects, + which are often used as dictionaries, may only have Strings as keys. + + Because Ember has a way to get a unique identifier for every object + via `Ember.guidFor`, we can implement a performant Map with arbitrary + keys. Because it is commonly used in low-level bookkeeping, Map is + implemented as a pure JavaScript object for performance. + + This implementation follows the current iteration of the ES6 proposal for + maps (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets), + with one exception: as we do not have the luxury of in-VM iteration, we implement a + forEach method for iteration. + + Map is mocked out to look like an Ember object, so you can do + `Ember.Map.create()` for symmetry with other Ember classes. + */ + + 'use strict'; + function missingFunction(fn) { throw new TypeError(Object.prototype.toString.call(fn) + ' is not a function'); } function missingNew(name) { @@ -16062,12 +15800,10 @@ return set; } }; - _emberMetalDeprecate_property.deprecateProperty(OrderedSet.prototype, 'length', 'size'); - /** A Map stores values indexed by keys. Unlike JavaScript's default Objects, the keys of a Map can be any JavaScript object. @@ -16260,12 +15996,10 @@ copy: function () { return copyMap(this, new Map()); } }; - _emberMetalDeprecate_property.deprecateProperty(Map.prototype, 'length', 'size'); - /** @class MapWithDefault @namespace Ember @extends Ember.Map @private @@ -16335,35 +16069,11 @@ exports.default = Map; exports.OrderedSet = OrderedSet; exports.Map = Map; exports.MapWithDefault = MapWithDefault; }); -/** -@module ember -@submodule ember-metal -*/ - -/* - JavaScript (before ES6) does not have a Map implementation. Objects, - which are often used as dictionaries, may only have Strings as keys. - - Because Ember has a way to get a unique identifier for every object - via `Ember.guidFor`, we can implement a performant Map with arbitrary - keys. Because it is commonly used in low-level bookkeeping, Map is - implemented as a pure JavaScript object for performance. - - This implementation follows the current iteration of the ES6 proposal for - maps (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets), - with one exception: as we do not have the luxury of in-VM iteration, we implement a - forEach method for iteration. - - Map is mocked out to look like an Ember object, so you can do - `Ember.Map.create()` for symmetry with other Ember classes. -*/ enifed('ember-metal/merge', ['exports'], function (exports) { - exports.default = merge; - exports.assign = assign; /** Merge the contents of two objects together into the first object. ```javascript Ember.merge({first: 'Tom'}, {last: 'Dale'}); // {first: 'Tom', last: 'Dale'} @@ -16375,13 +16085,17 @@ @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 */ + 'use strict'; + exports.default = merge; + exports.assign = assign; + function merge(original, updates) { if (!updates || typeof updates !== 'object') { return original; } @@ -16418,22 +16132,28 @@ return original; } }); enifed('ember-metal/mixin', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/expand_properties', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/binding', 'ember-metal/observer', 'ember-metal/events', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalExpand_properties, _emberMetalProperties, _emberMetalComputed, _emberMetalBinding, _emberMetalObserver, _emberMetalEvents, _emberMetalStreamsUtils) { + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed + // + exports.mixin = mixin; exports.default = Mixin; exports.required = required; exports.aliasMethod = aliasMethod; exports.observer = observer; exports._immediateObserver = _immediateObserver; exports._beforeObserver = _beforeObserver; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - // 'REMOVE_USE_STRICT: true'; + /** + @module ember + @submodule ember-metal + */ + var REQUIRED; var a_slice = [].slice; function superFunction() { var func = this.__nextSuper; @@ -17183,11 +16903,11 @@ @for Ember @private */ function required() { - _emberMetalCore.default.deprecate('Ember.required is deprecated as its behavior is inconsistent and unreliable.', false); + _emberMetalCore.default.deprecate('Ember.required is deprecated as its behavior is inconsistent and unreliable.', false, { id: 'ember-metal.required', until: '3.0.0' }); return REQUIRED; } function Alias(methodName) { this.isDescriptor = true; @@ -17248,29 +16968,43 @@ @return func @private */ function observer() { - for (var _len4 = arguments.length, paths = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - paths[_key4] = arguments[_key4]; + for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; } - var func = paths.pop(); - var expandedPaths = []; + var func = args.slice(-1)[0]; + var paths; + var addWatchedProperty = function (path) { - expandedPaths.push(path); + _emberMetalCore.default.assert('Depending on arrays using a dependent key ending with `@each` is no longer supported. ' + ('Please refactor from `Ember.observer(\'' + path + '\', function() {});` to `Ember.observer(\'' + path.slice(0, -6) + '.[]\', function() {})`.'), path.slice(-5) !== '@each'); + + paths.push(path); }; + var _paths = args.slice(0, -1); - for (var i = 0; i < paths.length; ++i) { - _emberMetalExpand_properties.default(paths[i], addWatchedProperty); + if (typeof func !== 'function') { + // revert to old, soft-deprecated argument ordering + _emberMetalCore.default.deprecate('Passing the dependentKeys after the callback function in Ember.observer is deprecated. Ensure the callback function is the last argument.', false, { id: 'ember-metal.observer-argument-order', until: '3.0.0' }); + + func = args[0]; + _paths = args.slice(1); } + paths = []; + + for (var i = 0; i < _paths.length; ++i) { + _emberMetalExpand_properties.default(_paths[i], addWatchedProperty); + } + if (typeof func !== 'function') { throw new _emberMetalCore.default.Error('Ember.observer called without a function'); } - func.__ember_observes__ = expandedPaths; + func.__ember_observes__ = paths; return func; } /** Specify a method that observes property changes. @@ -17297,11 +17031,11 @@ @return func @private */ function _immediateObserver() { - _emberMetalCore.default.deprecate('Usage of `Ember.immediateObserver` is deprecated, use `Ember.observer` instead.'); + _emberMetalCore.default.deprecate('Usage of `Ember.immediateObserver` is deprecated, use `Ember.observer` instead.', false, { id: 'ember-metal.immediate-observer', until: '3.0.0' }); for (var i = 0, l = arguments.length; i < l; i++) { var arg = arguments[i]; _emberMetalCore.default.assert('Immediate observers must observe internal properties only, not properties on other objects.', typeof arg !== 'string' || arg.indexOf('.') === -1); } @@ -17388,17 +17122,14 @@ exports.IS_BINDING = IS_BINDING; exports.Mixin = Mixin; exports.required = required; exports.REQUIRED = REQUIRED; }); -/** -@module ember -@submodule ember-metal -*/ - // warn, assert, wrap, et; enifed('ember-metal/observer', ['exports', 'ember-metal/watching', 'ember-metal/events'], function (exports, _emberMetalWatching, _emberMetalEvents) { + 'use strict'; + exports.addObserver = addObserver; exports.observersFor = observersFor; exports.removeObserver = removeObserver; exports._addBeforeObserver = _addBeforeObserver; exports._suspendObserver = _suspendObserver; @@ -17507,10 +17238,11 @@ return this; } }); enifed('ember-metal/observer_set', ['exports', 'ember-metal/utils', 'ember-metal/events'], function (exports, _emberMetalUtils, _emberMetalEvents) { + 'use strict'; /* this.observerSet = { [senderGuid]: { // variable name: `keySet` [keyName]: listIndex @@ -17575,10 +17307,12 @@ this.observerSet = {}; this.observers = []; }; }); enifed('ember-metal/path_cache', ['exports', 'ember-metal/cache'], function (exports, _emberMetalCache) { + 'use strict'; + exports.isGlobal = isGlobal; exports.isGlobalPath = isGlobalPath; exports.hasThis = hasThis; exports.isPath = isPath; exports.getFirstKey = getFirstKey; @@ -17654,10 +17388,16 @@ function getTailPath(path) { return tailPathCache.get(path); } }); enifed('ember-metal/properties', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/utils', 'ember-metal/property_events'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalUtils, _emberMetalProperty_events) { + /** + @module ember-metal + */ + + 'use strict'; + exports.Descriptor = Descriptor; exports.MANDATORY_SETTER_FUNCTION = MANDATORY_SETTER_FUNCTION; exports.DEFAULT_GETTER_FUNCTION = DEFAULT_GETTER_FUNCTION; exports.defineProperty = defineProperty; @@ -17809,14 +17549,13 @@ } return this; } }); -/** -@module ember-metal -*/ enifed('ember-metal/property_events', ['exports', 'ember-metal/utils', 'ember-metal/events', 'ember-metal/observer_set'], function (exports, _emberMetalUtils, _emberMetalEvents, _emberMetalObserver_set) { + 'use strict'; + var PROPERTY_DID_CHANGE = _emberMetalUtils.symbol('PROPERTY_DID_CHANGE'); exports.PROPERTY_DID_CHANGE = PROPERTY_DID_CHANGE; var beforeObserverSet = new _emberMetalObserver_set.default(); var observerSet = new _emberMetalObserver_set.default(); @@ -17988,10 +17727,15 @@ if (deps) { keys = keysOf(deps); for (i = 0; i < keys.length; i++) { key = keys[i]; + + if (!deps[key]) { + continue; + } + possibleDesc = obj[key]; desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; if (desc && desc._suspended === obj) { continue; @@ -18001,53 +17745,32 @@ } } } function chainsWillChange(obj, keyName, m) { - if (!(m.hasOwnProperty('chainWatchers') && m.chainWatchers[keyName])) { + if (m.chainWatchers === undefined || m.chainWatchers.obj !== obj) { return; } - var nodes = m.chainWatchers[keyName]; - var events = []; - var i, l; - - for (i = 0, l = nodes.length; i < l; i++) { - nodes[i].willChange(events); - } - - for (i = 0, l = events.length; i < l; i += 2) { - propertyWillChange(events[i], events[i + 1]); - } + m.chainWatchers.notify(keyName, false, propertyWillChange); } - function chainsDidChange(obj, keyName, m, suppressEvents) { - if (!(m && m.hasOwnProperty('chainWatchers') && m.chainWatchers[keyName])) { + function chainsDidChange(obj, keyName, m) { + if (m.chainWatchers === undefined || m.chainWatchers.obj !== obj) { return; } - var nodes = m.chainWatchers[keyName]; - var events = suppressEvents ? null : []; - var i, l; + m.chainWatchers.notify(keyName, true, propertyDidChange); + } - for (i = 0, l = nodes.length; i < l; i++) { - nodes[i].didChange(events); - } - - if (suppressEvents) { + function overrideChains(obj, keyName, m) { + if (m.chainWatchers === undefined || m.chainWatchers.obj !== obj) { return; } - - for (i = 0, l = events.length; i < l; i += 2) { - propertyDidChange(events[i], events[i + 1]); - } + m.chainWatchers.revalidate(keyName); } - function overrideChains(obj, keyName, m) { - chainsDidChange(obj, keyName, m, true); - } - /** @method beginPropertyChanges @chainable @private */ @@ -18128,23 +17851,24 @@ exports.overrideChains = overrideChains; exports.beginPropertyChanges = beginPropertyChanges; exports.endPropertyChanges = endPropertyChanges; exports.changeProperties = changeProperties; }); -enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/utils'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalError, _emberMetalPath_cache, _emberMetalUtils) { +enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/error', 'ember-metal/path_cache'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalError, _emberMetalPath_cache) { + /** + @module ember-metal + */ + + 'use strict'; + exports.get = get; exports.normalizeTuple = normalizeTuple; 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'); - - exports.UNHANDLED_GET = 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 @@ -18185,17 +17909,10 @@ // Helpers that operate with 'this' within an #each if (keyName === '') { return obj; } - if (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; @@ -18302,21 +18019,16 @@ return value; } exports.default = get; }); -/** -@module ember-metal -*/ -enifed('ember-metal/property_set', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/utils'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalProperties, _emberMetalError, _emberMetalPath_cache, _emberMetalUtils) { +enifed('ember-metal/property_set', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/error', 'ember-metal/path_cache'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalProperties, _emberMetalError, _emberMetalPath_cache) { + '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'); - exports.UNHANDLED_SET = 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` method then that will be invoked as well. @@ -18329,25 +18041,15 @@ @return {Object} the passed value. @public */ function set(obj, keyName, value, tolerant) { - _emberMetalCore.default.assert('Set must be called with tree or four arguments; an object, a property key, a value and tolerant true/false', arguments.length === 3 || arguments.length === 4); + _emberMetalCore.default.assert('Set must be called with three or four arguments; an object, a property key, a value and tolerant true/false', arguments.length === 3 || arguments.length === 4); _emberMetalCore.default.assert('Cannot call set with \'' + keyName + '\' on an undefined object.', obj !== undefined && obj !== null); _emberMetalCore.default.assert('The key provided to set must be a string, you passed ' + keyName, typeof keyName === 'string'); _emberMetalCore.default.assert('\'this\' in paths is not supported', !_emberMetalPath_cache.hasThis(keyName)); - // 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; @@ -18383,12 +18085,12 @@ _emberMetalProperty_events.propertyWillChange(obj, keyName); if (currentValue === undefined && !(keyName in obj) || !Object.prototype.propertyIsEnumerable.call(obj, keyName)) { _emberMetalProperties.defineProperty(obj, keyName, null, value); // setup mandatory setter } else { - meta.values[keyName] = value; - } + meta.values[keyName] = value; + } _emberMetalProperty_events.propertyDidChange(obj, keyName); } } else { obj[keyName] = value; @@ -18448,10 +18150,12 @@ function trySet(root, path, value) { return set(root, path, value, true); } }); enifed("ember-metal/replace", ["exports"], function (exports) { + "use strict"; + exports._replace = _replace; exports.default = replace; var splice = Array.prototype.splice; function _replace(array, idx, amt, objects) { @@ -18515,10 +18219,12 @@ return _replace(array, idx, amt, objects); } } }); enifed('ember-metal/run_loop', ['exports', 'ember-metal/core', 'ember-metal/utils', 'ember-metal/property_events', 'backburner'], function (exports, _emberMetalCore, _emberMetalUtils, _emberMetalProperty_events, _backburner) { + 'use strict'; + exports.default = run; function onBegin(current) { run.currentRunLoop = current; } @@ -18774,11 +18480,11 @@ invoked allowing you to change the target function. @param {Object} [arguments*] Optional arguments to be passed to the queued method. @return {void} @public */ - run.schedule = function () { + run.schedule = function () /* queue, target, method */{ checkAutoRun(); backburner.schedule.apply(backburner, arguments); }; // Used by global test teardown @@ -18838,11 +18544,11 @@ @param {Object} [args*] Optional arguments to pass to the timeout. @param {Number} wait Number of milliseconds to wait. @return {*} Timer information for use in cancelling, see `run.cancel`. @public */ - run.later = function () { + run.later = function () /*target, method*/{ return backburner.later.apply(backburner, arguments); }; /** Schedule a function to run one time during the current RunLoop. This is equivalent @@ -18918,11 +18624,11 @@ target at the time the method is invoked. @param {Object} [args*] Optional arguments to pass to the timeout. @return {Object} Timer information for use in cancelling, see `run.cancel`. @public */ - run.scheduleOnce = function () { + run.scheduleOnce = function () /*queue, target, method*/{ checkAutoRun(); return backburner.scheduleOnce.apply(backburner, arguments); }; /** @@ -19183,12 +18889,13 @@ if (run.queues.indexOf(name) === -1) { run.queues.splice(run.queues.indexOf(after) + 1, 0, name); } }; }); -/* queue, target, method */ /*target, method*/ /*queue, target, method*/ enifed('ember-metal/set_properties', ['exports', 'ember-metal/property_events', 'ember-metal/property_set'], function (exports, _emberMetalProperty_events, _emberMetalProperty_set) { + 'use strict'; + exports.default = setProperties; /** Set a list of properties on an object. These properties are set inside a single `beginPropertyChanges` and `endPropertyChanges` batch, so @@ -19227,10 +18934,12 @@ }); return properties; } }); enifed('ember-metal/streams/conditional', ['exports', 'ember-metal/streams/stream', 'ember-metal/streams/utils'], function (exports, _emberMetalStreamsStream, _emberMetalStreamsUtils) { + 'use strict'; + exports.default = conditional; function conditional(test, consequent, alternate) { if (_emberMetalStreamsUtils.isStream(test)) { return new ConditionalStream(test, consequent, alternate); @@ -19280,10 +18989,11 @@ return newTestResult ? _emberMetalStreamsUtils.read(this.consequent) : _emberMetalStreamsUtils.read(this.alternate); }; }); enifed('ember-metal/streams/dependency', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalStreamsUtils) { + 'use strict'; /** @module ember-metal */ @@ -19357,10 +19067,11 @@ }); exports.default = Dependency; }); enifed('ember-metal/streams/key-stream', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/observer', 'ember-metal/streams/stream', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalObserver, _emberMetalStreamsStream, _emberMetalStreamsUtils) { + 'use strict'; function KeyStream(source, key) { _emberMetalCore.default.assert('KeyStream error: source must be a stream', _emberMetalStreamsUtils.isStream(source)); // TODO: This isn't necessary. _emberMetalCore.default.assert('KeyStream error: key must be a non-empty string', typeof key === 'string' && key.length > 0); _emberMetalCore.default.assert('KeyStream error: key must not have a \'.\'', key.indexOf('.') === -1); @@ -19433,10 +19144,11 @@ }); exports.default = KeyStream; }); enifed('ember-metal/streams/proxy-stream', ['exports', 'ember-metal/merge', 'ember-metal/streams/stream'], function (exports, _emberMetalMerge, _emberMetalStreamsStream) { + 'use strict'; function ProxyStream(source, label) { this.init(label); this.sourceDep = this.addMutableDependency(source); } @@ -19459,10 +19171,11 @@ }); exports.default = ProxyStream; }); enifed('ember-metal/streams/stream', ['exports', 'ember-metal/core', 'ember-metal/path_cache', 'ember-metal/observer', 'ember-metal/streams/utils', 'ember-metal/streams/subscriber', 'ember-metal/streams/dependency'], function (exports, _emberMetalCore, _emberMetalPath_cache, _emberMetalObserver, _emberMetalStreamsUtils, _emberMetalStreamsSubscriber, _emberMetalStreamsDependency) { + 'use strict'; /** @module ember-metal */ @@ -19778,10 +19491,11 @@ } exports.default = Stream; }); enifed('ember-metal/streams/subscriber', ['exports', 'ember-metal/merge'], function (exports, _emberMetalMerge) { + 'use strict'; /** @module ember-metal */ @@ -19820,10 +19534,12 @@ }); exports.default = Subscriber; }); enifed('ember-metal/streams/utils', ['exports', 'ember-metal/core', './stream'], function (exports, _emberMetalCore, _stream) { + 'use strict'; + exports.isStream = isStream; exports.subscribe = subscribe; exports.unsubscribe = unsubscribe; exports.read = read; exports.readArray = readArray; @@ -20191,28 +19907,28 @@ if (object && object.isStream) { object.setValue(value); } } }); -enifed("ember-metal/symbol", ["exports"], function (exports) {}); -enifed('ember-metal/utils', ['exports', 'ember-metal/core', 'ember-metal/features'], function (exports, _emberMetalCore, _emberMetalFeatures) { +enifed("ember-metal/symbol", ["exports"], function (exports) { + "use strict"; +}); +enifed('ember-metal/utils', ['exports', 'ember-metal/features'], function (exports, _emberMetalFeatures) { + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed + // + exports.uuid = uuid; exports.symbol = symbol; exports.generateGuid = generateGuid; exports.guidFor = guidFor; - exports.getMeta = getMeta; - exports.setMeta = setMeta; - exports.metaPath = metaPath; exports.wrap = wrap; exports.tryInvoke = tryInvoke; exports.makeArray = makeArray; exports.inspect = inspect; exports.apply = apply; exports.applyStr = applyStr; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - // 'REMOVE_USE_STRICT: true'; /** @module ember-metal */ @@ -20499,25 +20215,21 @@ // META // function Meta(obj) { this.watching = {}; this.cache = undefined; - this.cacheMeta = undefined; this.source = obj; this.deps = undefined; this.listeners = undefined; this.mixins = undefined; this.bindings = undefined; this.chains = undefined; + this.chainWatchers = undefined; this.values = undefined; this.proto = undefined; } - Meta.prototype = { - chainWatchers: null // FIXME - }; - // Placeholder for non-writable metas. var EMPTY_META = new Meta(null); EMPTY_META.values = {}; @@ -20565,94 +20277,20 @@ } ret = Object.create(ret); ret.watching = Object.create(ret.watching); ret.cache = undefined; - ret.cacheMeta = undefined; ret.source = obj; ret.values = Object.create(ret.values); obj['__ember_meta__'] = ret; } return ret; } - function getMeta(obj, property) { - var _meta = meta(obj, false); - return _meta[property]; - } - - function setMeta(obj, property, value) { - var _meta = meta(obj, true); - _meta[property] = value; - return value; - } - /** - @deprecated - @private - - In order to store defaults for a class, a prototype may need to create - a default meta object, which will be inherited by any objects instantiated - from the class's constructor. - - However, the properties of that meta object are only shallow-cloned, - so if a property is a hash (like the event system's `listeners` hash), - it will by default be shared across all instances of that class. - - This method allows extensions to deeply clone a series of nested hashes or - other complex objects. For instance, the event system might pass - `['listeners', 'foo:change', 'ember157']` to `prepareMetaPath`, which will - walk down the keys provided. - - For each key, if the key does not exist, it is created. If it already - exists and it was inherited from its constructor, the constructor's - key is cloned. - - You can also pass false for `writable`, which will simply return - undefined if `prepareMetaPath` discovers any part of the path that - shared or undefined. - - @method metaPath - @for Ember - @param {Object} obj The object whose meta we are examining - @param {Array} path An array of keys to walk down - @param {Boolean} writable whether or not to create a new meta - (or meta property) if one does not already exist or if it's - shared with its constructor - */ - - function metaPath(obj, path, writable) { - _emberMetalCore.default.deprecate('Ember.metaPath is deprecated and will be removed from future releases.'); - var _meta = meta(obj, writable); - var keyName, value; - - for (var i = 0, l = path.length; i < l; i++) { - keyName = path[i]; - value = _meta[keyName]; - - if (!value) { - if (!writable) { - return undefined; - } - value = _meta[keyName] = { __ember_source__: obj }; - } else if (value.__ember_source__ !== obj) { - if (!writable) { - return undefined; - } - value = _meta[keyName] = Object.create(value); - value.__ember_source__ = obj; - } - - _meta = value; - } - - return value; - } - - /** Wraps the passed function so that `this._super` will point to the superFunc when the function is invoked. This is the primitive we use to implement calls to super. @private @@ -20910,10 +20548,12 @@ exports.meta = meta; exports.makeArray = makeArray; exports.canInvoke = canInvoke; }); enifed('ember-metal/watch_key', ['exports', 'ember-metal/features', 'ember-metal/utils', 'ember-metal/properties'], function (exports, _emberMetalFeatures, _emberMetalUtils, _emberMetalProperties) { + 'use strict'; + exports.watchKey = watchKey; exports.unwatchKey = unwatchKey; function watchKey(obj, keyName, meta) { // can't watch length on Array - it is special... @@ -21010,10 +20650,12 @@ watching[keyName]--; } } }); enifed('ember-metal/watch_path', ['exports', 'ember-metal/utils', 'ember-metal/chains'], function (exports, _emberMetalUtils, _emberMetalChains) { + 'use strict'; + exports.watchPath = watchPath; exports.unwatchPath = unwatchPath; // get the chains for the current object. If the current object has // chains inherited from the proto they will be cloned and reconfigured for @@ -21058,10 +20700,16 @@ watching[keyPath]--; } } }); enifed('ember-metal/watching', ['exports', 'ember-metal/chains', 'ember-metal/watch_key', 'ember-metal/watch_path', 'ember-metal/path_cache'], function (exports, _emberMetalChains, _emberMetalWatch_key, _emberMetalWatch_path, _emberMetalPath_cache) { + /** + @module ember-metal + */ + + 'use strict'; + exports.isWatching = isWatching; exports.unwatch = unwatch; exports.destroy = destroy; /** @@ -21157,29 +20805,35 @@ } } } } }); -/** -@module ember-metal -*/ enifed('ember-routing-htmlbars', ['exports', 'ember-metal/core', 'ember-htmlbars/helpers', 'ember-htmlbars/keywords', 'ember-routing-htmlbars/helpers/query-params', 'ember-routing-htmlbars/keywords/action', 'ember-routing-htmlbars/keywords/element-action', 'ember-routing-htmlbars/keywords/link-to', 'ember-routing-htmlbars/keywords/render'], function (exports, _emberMetalCore, _emberHtmlbarsHelpers, _emberHtmlbarsKeywords, _emberRoutingHtmlbarsHelpersQueryParams, _emberRoutingHtmlbarsKeywordsAction, _emberRoutingHtmlbarsKeywordsElementAction, _emberRoutingHtmlbarsKeywordsLinkTo, _emberRoutingHtmlbarsKeywordsRender) { + /** + @module ember + @submodule ember-routing-htmlbars + */ + 'use strict'; + _emberHtmlbarsHelpers.registerHelper('query-params', _emberRoutingHtmlbarsHelpersQueryParams.queryParamsHelper); _emberHtmlbarsKeywords.registerKeyword('action', _emberRoutingHtmlbarsKeywordsAction.default); _emberHtmlbarsKeywords.registerKeyword('@element_action', _emberRoutingHtmlbarsKeywordsElementAction.default); _emberHtmlbarsKeywords.registerKeyword('link-to', _emberRoutingHtmlbarsKeywordsLinkTo.default); _emberHtmlbarsKeywords.registerKeyword('render', _emberRoutingHtmlbarsKeywordsRender.default); exports.default = _emberMetalCore.default; }); -/** -@module ember -@submodule ember-routing-htmlbars -*/ enifed('ember-routing-htmlbars/helpers/query-params', ['exports', 'ember-metal/core', 'ember-routing/system/query_params'], function (exports, _emberMetalCore, _emberRoutingSystemQuery_params) { + /** + @module ember + @submodule ember-routing-htmlbars + */ + + 'use strict'; + exports.queryParamsHelper = queryParamsHelper; /** This is a helper to be used in conjunction with the link-to helper. It will supply url query parameters to the target route. @@ -21203,18 +20857,19 @@ return _emberRoutingSystemQuery_params.default.create({ values: hash }); } }); -/** -@module ember -@submodule ember-routing-htmlbars -*/ - // assert enifed('ember-routing-htmlbars/keywords/action', ['exports', 'ember-metal/features', 'htmlbars-runtime/hooks', 'ember-routing-htmlbars/keywords/closure-action'], function (exports, _emberMetalFeatures, _htmlbarsRuntimeHooks, _emberRoutingHtmlbarsKeywordsClosureAction) { + /** + @module ember + @submodule ember-templates + */ + 'use strict'; + /** The `{{action}}` helper provides a way to pass triggers for behavior (usually just a function) between components, and into components from controllers. ### Passing functions with the action helper @@ -21452,15 +21107,13 @@ } return _emberRoutingHtmlbarsKeywordsClosureAction.default(morph, env, scope, params, hash, template, inverse, visitor); }; }); -/** -@module ember -@submodule ember-templates -*/ enifed('ember-routing-htmlbars/keywords/closure-action', ['exports', 'ember-metal/streams/stream', 'ember-metal/streams/utils', 'ember-metal/utils', 'ember-metal/property_get', 'ember-metal/error'], function (exports, _emberMetalStreamsStream, _emberMetalStreamsUtils, _emberMetalUtils, _emberMetalProperty_get, _emberMetalError) { + 'use strict'; + exports.default = closureAction; var INVOKE = _emberMetalUtils.symbol('INVOKE'); exports.INVOKE = INVOKE; var ACTION = _emberMetalUtils.symbol('ACTION'); @@ -21497,12 +21150,10 @@ // on-change={{action 'setName' target=alternativeComponent}} target = _emberMetalStreamsUtils.read(hash.target); } if (target.actions) { action = target.actions[actionName]; - } else if (target._actions) { - action = target._actions[actionName]; } if (!action) { throw new _emberMetalError.default('An action named \'' + actionName + '\' was not found in ' + target + '.'); } @@ -21549,10 +21200,11 @@ return closureAction; } }); enifed('ember-routing-htmlbars/keywords/element-action', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/utils', 'ember-metal/run_loop', 'ember-views/streams/utils', 'ember-views/system/utils', 'ember-views/system/action_manager'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalUtils, _emberMetalRun_loop, _emberViewsStreamsUtils, _emberViewsSystemUtils, _emberViewsSystemAction_manager) { + 'use strict'; function assert(message, test) { // This only exists to prevent defeatureify from error when attempting // to transform the same source twice (tldr; you can't nest stripped statements) _emberMetalCore.default.assert(message, test); @@ -21700,11 +21352,17 @@ return true; } }); // assert enifed('ember-routing-htmlbars/keywords/link-to', ['exports', 'ember-metal/streams/utils', 'ember-metal/core', 'ember-metal/merge'], function (exports, _emberMetalStreamsUtils, _emberMetalCore, _emberMetalMerge) { + /** + @module ember + @submodule ember-routing-htmlbars + */ + 'use strict'; + /** The `{{link-to}}` helper renders a link to the supplied `routeName` passing an optionally supplied model to the route as its `model` context of the route. The block for `{{link-to}}` becomes the innerHTML of the rendered @@ -21980,11 +21638,13 @@ link: function (state, params, hash) { _emberMetalCore.default.assert('You must provide one or more parameters to the link-to helper.', params.length); }, render: function (morph, env, scope, params, hash, template, inverse, visitor) { - var attrs = _emberMetalMerge.default({}, _emberMetalStreamsUtils.readHash(hash)); + var attrs = _emberMetalMerge.default({}, hash); + + // TODO: Rewrite link-to to use arbitrary length positional params. attrs.params = _emberMetalStreamsUtils.readArray(params); // Used for deprecations (to tell the user what view the deprecated syntax // was used in). attrs.view = env.view; @@ -22000,17 +21660,14 @@ rerender: function (morph, env, scope, params, hash, template, inverse, visitor) { this.render(morph, env, scope, params, hash, template, inverse, visitor); } }; }); -/** -@module ember -@submodule ember-routing-htmlbars -*/ - // assert enifed('ember-routing-htmlbars/keywords/render', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/error', 'ember-metal/streams/utils', 'ember-runtime/system/string', 'ember-routing/system/generate_controller', 'ember-htmlbars/node-managers/view-node-manager'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalError, _emberMetalStreamsUtils, _emberRuntimeSystemString, _emberRoutingSystemGenerate_controller, _emberHtmlbarsNodeManagersViewNodeManager) { + 'use strict'; + exports.default = { willRender: function (renderNode, env) { if (env.view.ownerView._outlets) { // We make sure we will get dirtied when outlet state changes. env.view.ownerView._outlets.push(renderNode); @@ -22218,22 +21875,31 @@ return true; } }); // assert enifed('ember-routing-views', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-routing-views/views/link', 'ember-routing-views/views/outlet'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberRoutingViewsViewsLink, _emberRoutingViewsViewsOutlet) { + /** + @module ember + @submodule ember-routing-views + */ + 'use strict'; + _emberMetalCore.default.LinkComponent = _emberRoutingViewsViewsLink.default; _emberMetalCore.default.OutletView = _emberRoutingViewsViewsOutlet.OutletView; exports.default = _emberMetalCore.default; }); -/** -@module ember -@submodule ember-routing-views -*/ -enifed('ember-routing-views/views/link', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/computed', 'ember-views/system/utils', 'ember-views/views/component', 'ember-runtime/inject', 'ember-runtime/mixins/controller', 'ember-htmlbars/templates/link-to'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberViewsSystemUtils, _emberViewsViewsComponent, _emberRuntimeInject, _emberRuntimeMixinsController, _emberHtmlbarsTemplatesLinkTo) { - _emberHtmlbarsTemplatesLinkTo.default.meta.revision = 'Ember@2.0.0-beta.3'; +enifed('ember-routing-views/views/link', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/computed', 'ember-metal/computed_macros', 'ember-views/system/utils', 'ember-views/views/component', 'ember-runtime/inject', 'ember-runtime/system/service', 'ember-runtime/mixins/controller', 'ember-htmlbars/templates/link-to'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberMetalComputed_macros, _emberViewsSystemUtils, _emberViewsViewsComponent, _emberRuntimeInject, _emberRuntimeSystemService, _emberRuntimeMixinsController, _emberHtmlbarsTemplatesLinkTo) { + /** + @module ember + @submodule ember-routing-views + */ + 'use strict'; + + _emberHtmlbarsTemplatesLinkTo.default.meta.revision = 'Ember@2.0.0-beta.5'; + var linkComponentClassNameBindings = ['active', 'loading', 'disabled']; linkComponentClassNameBindings = ['active', 'loading', 'disabled', 'transitioningIn', 'transitioningOut']; /** @@ -22259,49 +21925,49 @@ /** @deprecated Use current-when instead. @property currentWhen @private */ - currentWhen: null, + currentWhen: _emberMetalComputed_macros.deprecatingAlias('current-when', { id: 'ember-routing-view.deprecated-current-when', until: '3.0.0' }), /** Used to determine when this LinkComponent is active. @property currentWhen - @private + @public */ 'current-when': null, /** Sets the `title` attribute of the `LinkComponent`'s HTML element. @property title @default null - @private + @public **/ title: null, /** Sets the `rel` attribute of the `LinkComponent`'s HTML element. @property rel @default null - @private + @public **/ rel: null, /** Sets the `tabindex` attribute of the `LinkComponent`'s HTML element. @property tabindex @default null - @private + @public **/ tabindex: null, /** Sets the `target` attribute of the `LinkComponent`'s HTML element. @since 1.8.0 @property target @default null - @private + @public **/ target: null, /** The CSS class to apply to `LinkComponent`'s element when its `active` @@ -22338,32 +22004,32 @@ Determines whether the `LinkComponent` will trigger routing via the `replaceWith` routing strategy. @property replace @type Boolean @default false - @private + @public **/ replace: false, /** By default the `{{link-to}}` helper will bind to the `href` and `title` attributes. It's discouraged that you override these defaults, however you can push onto the array if needed. @property attributeBindings @type Array | String @default ['title', 'rel', 'tabindex', 'target'] - @private + @public */ attributeBindings: ['href', 'title', 'rel', 'tabindex', 'target'], /** By default the `{{link-to}}` helper will bind to the `active`, `loading`, and `disabled` classes. It is discouraged to override these directly. @property classNameBindings @type Array @default ['active', 'loading', 'disabled'] - @private + @public */ classNameBindings: linkComponentClassNameBindings, /** By default the `{{link-to}}` helper responds to the `click` event. You @@ -22410,12 +22076,10 @@ @private */ init: function () { this._super.apply(this, arguments); - _emberMetalCore.default.deprecate('Using currentWhen with {{link-to}} is deprecated in favor of `current-when`.', !this.currentWhen); - // Map desired event name to invoke function var eventName = _emberMetalProperty_get.get(this, 'eventName'); this.on(eventName, this, this._invoke); }, @@ -22628,21 +22292,10 @@ if (attrs.disabledWhen) { this.set('disabled', attrs.disabledWhen); } - var currentWhen = attrs['current-when']; - - if (attrs.currentWhen) { - _emberMetalCore.default.deprecate('Using currentWhen with {{link-to}} is deprecated in favor of `current-when`.', !attrs.currentWhen); - currentWhen = attrs.currentWhen; - } - - if (currentWhen) { - this.set('currentWhen', currentWhen); - } - // TODO: Change to built-in hasBlock once it's available if (!attrs.hasBlock) { this.set('linkTitle', params.shift()); } @@ -22652,11 +22305,11 @@ for (var i = 0; i < params.length; i++) { var value = params[i]; while (_emberRuntimeMixinsController.default.detect(value)) { - _emberMetalCore.default.deprecate('Providing `{{link-to}}` with a param that is wrapped in a controller is deprecated. Please update `' + attrs.view + '` to use `{{link-to "post" someController.model}}` instead.'); + _emberMetalCore.default.deprecate('Providing `{{link-to}}` with a param that is wrapped in a controller is deprecated. ' + 'Please update `' + attrs.view + '` to use `{{link-to "post" someController.model}}` instead.', false, { id: 'ember-routing-views.controller-wrapped-param', until: '3.0.0' }); value = value.get('model'); } params[i] = value; } @@ -22685,11 +22338,11 @@ function computeActive(view, routerState) { if (_emberMetalProperty_get.get(view, 'loading')) { return false; } - var currentWhen = _emberMetalProperty_get.get(view, 'currentWhen'); + var currentWhen = _emberMetalProperty_get.get(view, 'current-when'); var isCurrentWhenSpecified = !!currentWhen; currentWhen = currentWhen || _emberMetalProperty_get.get(view, 'targetRouteName'); currentWhen = currentWhen.split(' '); for (var i = 0, len = currentWhen.length; i < len; i++) { if (isActiveForRoute(view, currentWhen[i], isCurrentWhenSpecified, routerState)) { @@ -22733,19 +22386,22 @@ return resolvedQueryParams; } exports.default = LinkComponent; }); -/** -@module ember -@submodule ember-routing-views -*/ - // FEATURES, Logger, assert +// creates inject.service enifed('ember-routing-views/views/outlet', ['exports', 'ember-views/views/view', 'ember-htmlbars/templates/top-level-view'], function (exports, _emberViewsViewsView, _emberHtmlbarsTemplatesTopLevelView) { - _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.0.0-beta.3'; + /** + @module ember + @submodule ember-routing-views + */ + 'use strict'; + + _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.0.0-beta.5'; + var CoreOutletView = _emberViewsViewsView.default.extend({ defaultTemplate: _emberHtmlbarsTemplatesTopLevelView.default, init: function () { this._super(); @@ -22777,16 +22433,18 @@ exports.CoreOutletView = CoreOutletView; var OutletView = CoreOutletView.extend({ tagName: '' }); exports.OutletView = OutletView; }); -/** -@module ember -@submodule ember-routing-views -*/ enifed('ember-routing', ['exports', 'ember-metal/core', 'ember-routing/ext/run_loop', 'ember-routing/ext/controller', 'ember-routing/location/api', 'ember-routing/location/none_location', 'ember-routing/location/hash_location', 'ember-routing/location/history_location', 'ember-routing/location/auto_location', 'ember-routing/system/generate_controller', 'ember-routing/system/controller_for', 'ember-routing/system/dsl', 'ember-routing/system/router', 'ember-routing/system/route', 'ember-routing/initializers/routing-service'], function (exports, _emberMetalCore, _emberRoutingExtRun_loop, _emberRoutingExtController, _emberRoutingLocationApi, _emberRoutingLocationNone_location, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingSystemGenerate_controller, _emberRoutingSystemController_for, _emberRoutingSystemDsl, _emberRoutingSystemRouter, _emberRoutingSystemRoute, _emberRoutingInitializersRoutingService) { + /** + @module ember + @submodule ember-routing + */ + 'use strict'; + _emberMetalCore.default.Location = _emberRoutingLocationApi.default; _emberMetalCore.default.AutoLocation = _emberRoutingLocationAuto_location.default; _emberMetalCore.default.HashLocation = _emberRoutingLocationHash_location.default; _emberMetalCore.default.HistoryLocation = _emberRoutingLocationHistory_location.default; _emberMetalCore.default.NoneLocation = _emberRoutingLocationNone_location.default; @@ -22798,17 +22456,14 @@ _emberMetalCore.default.Router = _emberRoutingSystemRouter.default; _emberMetalCore.default.Route = _emberRoutingSystemRoute.default; exports.default = _emberMetalCore.default; }); -/** -@module ember -@submodule ember-routing -*/ // ES6TODO: Cleanup modules with side-effects below enifed('ember-routing/ext/controller', ['exports', 'ember-metal/property_get', 'ember-runtime/mixins/controller'], function (exports, _emberMetalProperty_get, _emberRuntimeMixinsController) { + 'use strict'; /** @module ember @submodule ember-routing */ @@ -22962,10 +22617,11 @@ }); exports.default = _emberRuntimeMixinsController.default; }); enifed('ember-routing/ext/run_loop', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; /** @module ember @submodule ember-views */ @@ -22975,10 +22631,11 @@ // loading state entry if all context promises resolve on the // 'actions' queue first. _emberMetalRun_loop.default._addQueue('routerTransitions', 'actions'); }); enifed('ember-routing/initializers/routing-service', ['exports', 'ember-runtime/system/lazy_load', 'ember-routing/services/routing'], function (exports, _emberRuntimeSystemLazy_load, _emberRoutingServicesRouting) { + 'use strict'; _emberRuntimeSystemLazy_load.onLoad('Ember.Application', function (Application) { Application.initializer({ name: 'routing-service', initialize: function (registry) { @@ -22989,10 +22646,11 @@ } }); }); }); enifed('ember-routing/location/api', ['exports', 'ember-metal/core', 'ember-metal/environment', 'ember-routing/location/util'], function (exports, _emberMetalCore, _emberMetalEnvironment, _emberRoutingLocationUtil) { + 'use strict'; /** @module ember @submodule ember-routing */ @@ -23140,35 +22798,10 @@ _emberMetalCore.default.assert('Ember.Location.create: ' + implementation + ' is not a valid implementation', !!implementationClass); return implementationClass.create.apply(implementationClass, arguments); }, - /** - This is deprecated in favor of using the container to register the - location implementation as desired. - Example: - ```javascript - Application.initializer({ - name: "history-test-location", - initialize: function(container, application) { - application.register('location:history-test', HistoryTestLocation); - } - }); - ``` - @method registerImplementation - @param {String} name - @param {Object} implementation of the `location` API - @deprecated Register your custom location implementation with the - container directly. - @private - */ - registerImplementation: function (name, implementation) { - _emberMetalCore.default.deprecate('Using the Ember.Location.registerImplementation is no longer supported. Register your custom location implementation with the container instead.', false); - - this.implementations[name] = implementation; - }, - implementations: {}, _location: _emberMetalEnvironment.default.location, /** Returns the current `location.hash` by parsing location.href since browsers @@ -23183,10 +22816,12 @@ } }; }); // deprecate, assert enifed('ember-routing/location/auto_location', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-runtime/system/object', 'ember-metal/environment', 'ember-routing/location/util'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberRuntimeSystemObject, _emberMetalEnvironment, _emberRoutingLocationUtil) { + 'use strict'; + exports.getHistoryPath = getHistoryPath; exports.getHashPath = getHashPath; /** @module ember @@ -23463,10 +23098,11 @@ return path; } }); // FEATURES enifed('ember-routing/location/hash_location', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/run_loop', 'ember-metal/utils', 'ember-runtime/system/object', 'ember-routing/location/api'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalRun_loop, _emberMetalUtils, _emberRuntimeSystemObject, _emberRoutingLocationApi) { + 'use strict'; /** @module ember @submodule ember-routing */ @@ -23599,10 +23235,11 @@ _emberMetalCore.default.$(window).off('hashchange.ember-location-' + guid); } }); }); enifed('ember-routing/location/history_location', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-runtime/system/object', 'ember-routing/location/api', 'ember-views/system/jquery'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberRuntimeSystemObject, _emberRoutingLocationApi, _emberViewsSystemJquery) { + 'use strict'; /** @module ember @submodule ember-routing */ @@ -23818,10 +23455,11 @@ */ getHash: _emberRoutingLocationApi.default._getHash }); }); enifed('ember-routing/location/none_location', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-runtime/system/object'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemObject) { + 'use strict'; /** @module ember @submodule ember-routing */ @@ -23902,23 +23540,25 @@ return url; } }); }); enifed('ember-routing/location/util', ['exports'], function (exports) { + /** + @private + + Returns the current `location.pathname`, normalized for IE inconsistencies. + */ + 'use strict'; + exports.getPath = getPath; exports.getQuery = getQuery; exports.getHash = getHash; exports.getFullPath = getFullPath; exports.getOrigin = getOrigin; exports.supportsHashChange = supportsHashChange; exports.supportsHistory = supportsHistory; exports.replacePath = replacePath; - /** - @private - - Returns the current `location.pathname`, normalized for IE inconsistencies. - */ function getPath(location) { var pathname = location.pathname; // Various versions of IE/Opera don't always return a leading slash if (pathname.charAt(0) !== '/') { @@ -24027,11 +23667,17 @@ function replacePath(location, path) { location.replace(getOrigin(location) + path); } }); enifed('ember-routing/services/routing', ['exports', 'ember-runtime/system/service', 'ember-metal/property_get', 'ember-metal/computed_macros', 'ember-routing/utils', 'ember-metal/merge'], function (exports, _emberRuntimeSystemService, _emberMetalProperty_get, _emberMetalComputed_macros, _emberRoutingUtils, _emberMetalMerge) { + /** + @module ember + @submodule ember-routing + */ + 'use strict'; + /** The Routing service is used by LinkComponent, and provides facilities for the component/view layer to interact with the router. While still private, this service can eventually be opened up, and provides @@ -24121,15 +23767,13 @@ } return req; } }); -/** -@module ember -@submodule ember-routing -*/ enifed('ember-routing/system/cache', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { + 'use strict'; + exports.default = _emberRuntimeSystemObject.default.extend({ init: function () { this.cache = {}; }, has: function (bucketKey) { @@ -24156,11 +23800,10 @@ }, cache: null }); }); enifed("ember-routing/system/controller_for", ["exports"], function (exports) { - exports.default = controllerFor; /** @module ember @submodule ember-routing */ @@ -24170,16 +23813,20 @@ @for Ember @method controllerFor @private */ + "use strict"; + exports.default = controllerFor; + function controllerFor(container, controllerName, lookupOptions) { return container.lookup("controller:" + controllerName, lookupOptions); } }); enifed('ember-routing/system/dsl', ['exports', 'ember-metal/core', 'ember-metal/features'], function (exports, _emberMetalCore, _emberMetalFeatures) { + 'use strict'; /** @module ember @submodule ember-routing */ @@ -24251,11 +23898,11 @@ if (arguments.length === 1) { options = {}; } options.resetNamespace = true; - _emberMetalCore.default.deprecate('this.resource() is deprecated. Use this.route(\'name\', { resetNamespace: true }, function () {}) instead.'); + _emberMetalCore.default.deprecate('this.resource() is deprecated. Use this.route(\'name\', { resetNamespace: true }, function () {}) instead.', false, { id: 'ember-routing.router-resource', until: '3.0.0' }); this.route(name, options, callback); }, generate: function () { var dslMatches = this.matches; @@ -24303,10 +23950,12 @@ return dsl; }; }); // FEATURES, assert enifed('ember-routing/system/generate_controller', ['exports', 'ember-metal/core', 'ember-metal/property_get'], function (exports, _emberMetalCore, _emberMetalProperty_get) { + 'use strict'; + exports.generateControllerFactory = generateControllerFactory; exports.default = generateController; /** @module ember @@ -24365,16 +24014,19 @@ return instance; } }); // Logger enifed('ember-routing/system/query_params', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { + 'use strict'; + exports.default = _emberRuntimeSystemObject.default.extend({ isQueryParams: true, values: null }); }); enifed('ember-routing/system/route', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/error', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/get_properties', 'ember-metal/is_none', 'ember-metal/computed', 'ember-metal/merge', 'ember-runtime/utils', 'ember-metal/run_loop', 'ember-runtime/copy', 'ember-runtime/system/string', 'ember-runtime/system/object', 'ember-runtime/mixins/evented', 'ember-runtime/mixins/action_handler', 'ember-routing/system/generate_controller', 'ember-routing/utils'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalError, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalGet_properties, _emberMetalIs_none, _emberMetalComputed, _emberMetalMerge, _emberRuntimeUtils, _emberMetalRun_loop, _emberRuntimeCopy, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented, _emberRuntimeMixinsAction_handler, _emberRoutingSystemGenerate_controller, _emberRoutingUtils) { + 'use strict'; var slice = Array.prototype.slice; function K() { return this; @@ -24436,10 +24088,21 @@ @public */ queryParams: {}, /** + The name of the route, dot-delimited. + For example, a route found at `app/routes/posts/post.js` or + `app/posts/post/route.js` (with pods) will have a `routeName` of + `posts.post`. + @property routeName + @for Ember.Route + @type String + @public + */ + + /** @private @property _qp */ _qp: _emberMetalComputed.computed(function () { var _this = this; @@ -24620,11 +24283,11 @@ _updatingQPChanged: function (qp) { var router = this.router; router._updatingQPChanged(qp.urlKey); }, - mergedProperties: ['events', 'queryParams'], + mergedProperties: ['queryParams'], /** Retrieves parameters, for current route using the state.params variable and getQueryParamsFor, using the supplied routeName. @method paramsFor @@ -25007,11 +24670,11 @@ @type Ember.Controller @since 1.6.0 @private */ - _actions: { + actions: { queryParamsDidChange: function (changed, totalPresent, removed) { var qpMap = _emberMetalProperty_get.get(this, '_qp').map; var totalChanged = Object.keys(changed).concat(Object.keys(removed)); @@ -25112,18 +24775,10 @@ router._qpUpdates = null; } }, /** - @deprecated - Please use `actions` instead. - @method events - @private - */ - events: null, - - /** This hook is executed when the router completely exits this route. It is not executed when the model for the route changes. @method deactivate @public */ @@ -25382,13 +25037,13 @@ (_router = this.router).send.apply(_router, args); } else { var name = args[0]; args = slice.call(args, 1); - var action = this._actions[name]; + var action = this.actions[name]; if (action) { - return this._actions[name].apply(this, args); + return this.actions[name].apply(this, args); } } }, /** @@ -25414,54 +25069,44 @@ var propNames = _emberMetalProperty_get.get(this, '_qp.propertyNames'); addQueryParamsObservers(controller, propNames); this.controller = controller; } - if (this.setupControllers) { - _emberMetalCore.default.deprecate('Ember.Route.setupControllers is deprecated. Please use Ember.Route.setupController(controller, model) instead.'); - this.setupControllers(controller, context); - } else { - var queryParams = _emberMetalProperty_get.get(this, '_qp'); + var queryParams = _emberMetalProperty_get.get(this, '_qp'); - var states = queryParams.states; - if (transition) { - // Update the model dep values used to calculate cache keys. - _emberRoutingUtils.stashParamNames(this.router, transition.state.handlerInfos); + var states = queryParams.states; + if (transition) { + // Update the model dep values used to calculate cache keys. + _emberRoutingUtils.stashParamNames(this.router, transition.state.handlerInfos); - var params = transition.params; - var allParams = queryParams.propertyNames; - var cache = this._bucketCache; + var params = transition.params; + var allParams = queryParams.propertyNames; + var cache = this._bucketCache; - allParams.forEach(function (prop) { - var aQp = queryParams.map[prop]; + allParams.forEach(function (prop) { + var aQp = queryParams.map[prop]; - aQp.values = params; - var cacheKey = _emberRoutingUtils.calculateCacheKey(aQp.prefix, aQp.parts, aQp.values); + aQp.values = params; + var cacheKey = _emberRoutingUtils.calculateCacheKey(aQp.prefix, aQp.parts, aQp.values); - if (cache) { - var value = cache.lookup(cacheKey, prop, aQp.undecoratedDefaultValue); - _emberMetalProperty_set.set(controller, prop, value); - } - }); - } + if (cache) { + var value = cache.lookup(cacheKey, prop, aQp.undecoratedDefaultValue); + _emberMetalProperty_set.set(controller, prop, value); + } + }); + } - controller._qpDelegate = states.allowOverrides; + controller._qpDelegate = states.allowOverrides; - if (transition) { - var qpValues = getQueryParamsFor(this, transition.state); - controller.setProperties(qpValues); - } - - this.setupController(controller, context, transition); + if (transition) { + var qpValues = getQueryParamsFor(this, transition.state); + controller.setProperties(qpValues); } - if (this.renderTemplates) { - _emberMetalCore.default.deprecate('Ember.Route.renderTemplates is deprecated. Please use Ember.Route.renderTemplate(controller, model) instead.'); - this.renderTemplates(context); - } else { - this.renderTemplate(controller, context); - } + this.setupController(controller, context, transition); + + this.renderTemplate(controller, context); }, /* Called when a query parameter for this route changes, regardless of whether the route is currently part of the active route hierarchy. This will update the query parameter's @@ -25988,11 +25633,11 @@ }); ``` @method renderTemplate @param {Object} controller the route's controller @param {Object} model the route's model - @private + @public */ renderTemplate: function (controller, model) { this.render(); }, @@ -26157,10 +25802,14 @@ if (!options || typeof options === 'string') { outletName = options; } else { outletName = options.outlet; parentView = options.parentView; + + if (options && Object.keys(options).indexOf('outlet') !== -1 && typeof options.outlet === 'undefined') { + throw new _emberMetalError.default('You passed undefined as the outlet name.'); + } } parentView = parentView && parentView.replace(/\//g, '.'); outletName = outletName || 'main'; this._disconnectOutlet(outletName, parentView); for (var i = 0; i < this.router.router.currentHandlerInfos.length; i++) { @@ -26210,10 +25859,12 @@ _emberMetalRun_loop.default.once(this.router, '_setOutlets'); } } }); + _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions(Route); + Route.reopenClass({ isRouteFactory: true }); function parentRoute(route) { @@ -26268,10 +25919,14 @@ if (!controller) { throw new _emberMetalError.default('You passed `controller: \'' + controllerName + '\'` into the `render` method, but no such controller could be found.'); } } + if (options && Object.keys(options).indexOf('outlet') !== -1 && typeof options.outlet === 'undefined') { + throw new _emberMetalError.default('You passed undefined as the outlet name.'); + } + if (options && options.model) { controller.set('model', options.model); } viewName = options && options.view || namePassed && name || route.viewName || name; @@ -26401,22 +26056,23 @@ controller.addObserver(prop + '.[]', controller, controller._qpChanged); }); } function deprecateQueryParamDefaultValuesSetOnController(controllerName, routeName, propName) { - _emberMetalCore.default.deprecate('Configuring query parameter default values on controllers is deprecated. Please move the value for the property \'' + propName + '\' from the \'' + controllerName + '\' controller to the \'' + routeName + '\' route in the format: {queryParams: ' + propName + ': {defaultValue: <default value> }}'); + _emberMetalCore.default.deprecate('Configuring query parameter default values on controllers is deprecated. Please move the value for the property \'' + propName + '\' from the \'' + controllerName + '\' controller to the \'' + routeName + '\' route in the format: {queryParams: ' + propName + ': {defaultValue: <default value> }}', false, { id: 'ember-routing.deprecate-query-param-default-values-set-on-controller', until: '3.0.0' }); } 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/core', 'ember-metal/features', 'ember-metal/error', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/merge', 'ember-metal/run_loop', 'ember-runtime/system/string', 'ember-runtime/system/object', 'ember-runtime/mixins/evented', 'ember-routing/system/dsl', 'ember-routing/location/api', 'ember-routing/utils', './router_state', 'router', 'router/transition'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalError, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalProperties, _emberMetalComputed, _emberMetalMerge, _emberMetalRun_loop, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented, _emberRoutingSystemDsl, _emberRoutingLocationApi, _emberRoutingUtils, _router_state, _router4, _routerTransition) { +enifed('ember-routing/system/router', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/error', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/merge', 'ember-metal/run_loop', 'ember-runtime/system/object', 'ember-runtime/mixins/evented', 'ember-routing/system/dsl', 'ember-routing/location/api', 'ember-routing/utils', './router_state', 'router', 'router/transition'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalError, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalProperties, _emberMetalComputed, _emberMetalMerge, _emberMetalRun_loop, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented, _emberRoutingSystemDsl, _emberRoutingLocationApi, _emberRoutingUtils, _router_state, _router4, _routerTransition) { + 'use strict'; function K() { return this; } @@ -26486,11 +26142,11 @@ router.map(dsl.generate()); }, init: function () { this._activeViews = {}; - this._qpCache = {}; + this._qpCache = Object.create(null); this._resetQueuedQueryParameterChanges(); }, /* Resets all pending query paramter changes. @@ -26560,11 +26216,11 @@ /** Handles updating the paths and notifying any listeners of the URL change. Triggers the router level `didTransition` hook. @method didTransition - @private + @public @since 1.2.0 */ didTransition: function (infos) { updatePaths(this); @@ -26620,11 +26276,11 @@ /** Handles notifying any listeners of an impending URL change. Triggers the router level `willTransition` hook. @method willTransition - @private + @public @since 1.11.0 */ willTransition: function (oldInfos, newInfos, transition) { _emberMetalRun_loop.default.once(this, this.trigger, 'willTransition', transition); @@ -26928,11 +26584,11 @@ delete queryParams[key]; }); for (var key in groupedByUrlKey) { var qps = groupedByUrlKey[key]; - _emberMetalCore.default.assert(_emberRuntimeSystemString.fmt('You\'re not allowed to have more than one controller ' + 'property map to the same query param key, but both ' + '`%@` and `%@` map to `%@`. You can fix this by mapping ' + 'one of the controller properties to a different query ' + 'param key via the `as` config option, e.g. `%@: { as: \'other-%@\' }`', [qps[0].qp.scopedPropertyName, qps[1] ? qps[1].qp.scopedPropertyName : '', qps[0].qp.urlKey, qps[0].qp.prop, qps[0].qp.prop]), qps.length <= 1); + _emberMetalCore.default.assert('You\'re not allowed to have more than one controller property map to the same query param key, but both `' + qps[0].qp.scopedPropertyName + '` and `' + (qps[1] ? qps[1].qp.scopedPropertyName : '') + '` map to `' + qps[0].qp.urlKey + '`. You can fix this by mapping one of the controller properties to a different query param key via the `as` config option, e.g. `' + qps[0].qp.prop + ': { as: \'other-' + qps[0].qp.prop + '\' }`', qps.length <= 1); var qp = qps[0].qp; queryParams[qp.urlKey] = qp.route.serializeQueryParam(qps[0].value, qp.urlKey, qp.type); } }, @@ -27234,12 +26890,12 @@ for (var i = handlerInfos.length - 1; i >= 0; i--) { handlerInfo = handlerInfos[i]; handler = handlerInfo.handler; - if (handler._actions && handler._actions[name]) { - if (handler._actions[name].apply(handler, args) === true) { + if (handler.actions && handler.actions[name]) { + if (handler.actions[name].apply(handler, args) === true) { eventWasHandled = true; } else { return; } } @@ -27524,10 +27180,11 @@ /** @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/merge'], function (exports, _emberMetalIs_empty, _emberMetalKeys, _emberRuntimeSystemObject, _emberMetalMerge) { + 'use strict'; var RouterState = _emberRuntimeSystemObject.default.extend({ emberRouter: null, routerJs: null, routerJsState: null, @@ -27568,10 +27225,12 @@ } exports.default = RouterState; }); enifed('ember-routing/utils', ['exports', 'ember-metal/merge', 'ember-metal/property_get'], function (exports, _emberMetalMerge, _emberMetalProperty_get) { + 'use strict'; + exports.routeArgs = routeArgs; exports.getActiveTargetName = getActiveTargetName; exports.stashParamNames = stashParamNames; exports.calculateCacheKey = calculateCacheKey; exports.normalizeControllerQueryParams = normalizeControllerQueryParams; @@ -27738,11 +27397,19 @@ accum[key] = tmp; } } }); -enifed('ember-runtime', ['exports', 'ember-metal', 'ember-runtime/core', 'ember-runtime/compare', 'ember-runtime/copy', 'ember-runtime/inject', 'ember-runtime/system/namespace', 'ember-runtime/system/object', 'ember-runtime/system/tracked_array', 'ember-runtime/system/subarray', 'ember-runtime/system/container', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object_proxy', 'ember-runtime/system/core_object', 'ember-runtime/system/native_array', 'ember-runtime/system/string', 'ember-runtime/system/lazy_load', 'ember-runtime/mixins/array', 'ember-runtime/mixins/comparable', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/freezable', 'ember-runtime/mixins/-proxy', 'ember-runtime/mixins/observable', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/target_action_support', 'ember-runtime/mixins/evented', 'ember-runtime/mixins/promise_proxy', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/controllers/controller', 'ember-runtime/mixins/controller', 'ember-runtime/system/service', 'ember-runtime/ext/rsvp', 'ember-runtime/ext/string', 'ember-runtime/ext/function', 'ember-runtime/utils'], function (exports, _emberMetal, _emberRuntimeCore, _emberRuntimeCompare, _emberRuntimeCopy, _emberRuntimeInject, _emberRuntimeSystemNamespace, _emberRuntimeSystemObject, _emberRuntimeSystemTracked_array, _emberRuntimeSystemSubarray, _emberRuntimeSystemContainer, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject_proxy, _emberRuntimeSystemCore_object, _emberRuntimeSystemNative_array, _emberRuntimeSystemString, _emberRuntimeSystemLazy_load, _emberRuntimeMixinsArray, _emberRuntimeMixinsComparable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsFreezable, _emberRuntimeMixinsProxy, _emberRuntimeMixinsObservable, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsTarget_action_support, _emberRuntimeMixinsEvented, _emberRuntimeMixinsPromise_proxy, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeControllersController, _emberRuntimeMixinsController, _emberRuntimeSystemService, _emberRuntimeExtRsvp, _emberRuntimeExtString, _emberRuntimeExtFunction, _emberRuntimeUtils) { +enifed('ember-runtime', ['exports', 'ember-metal', 'ember-runtime/core', 'ember-runtime/compare', 'ember-runtime/copy', 'ember-runtime/inject', 'ember-runtime/system/namespace', 'ember-runtime/system/object', 'ember-runtime/system/container', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object_proxy', 'ember-runtime/system/core_object', 'ember-runtime/system/native_array', 'ember-runtime/system/string', 'ember-runtime/system/lazy_load', 'ember-runtime/mixins/array', 'ember-runtime/mixins/comparable', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/freezable', 'ember-runtime/mixins/-proxy', 'ember-runtime/mixins/observable', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/target_action_support', 'ember-runtime/mixins/evented', 'ember-runtime/mixins/promise_proxy', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/controllers/controller', 'ember-runtime/mixins/controller', 'ember-runtime/system/service', 'ember-runtime/ext/rsvp', 'ember-runtime/ext/string', 'ember-runtime/ext/function', 'ember-runtime/utils'], function (exports, _emberMetal, _emberRuntimeCore, _emberRuntimeCompare, _emberRuntimeCopy, _emberRuntimeInject, _emberRuntimeSystemNamespace, _emberRuntimeSystemObject, _emberRuntimeSystemContainer, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject_proxy, _emberRuntimeSystemCore_object, _emberRuntimeSystemNative_array, _emberRuntimeSystemString, _emberRuntimeSystemLazy_load, _emberRuntimeMixinsArray, _emberRuntimeMixinsComparable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsFreezable, _emberRuntimeMixinsProxy, _emberRuntimeMixinsObservable, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsTarget_action_support, _emberRuntimeMixinsEvented, _emberRuntimeMixinsPromise_proxy, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeControllersController, _emberRuntimeMixinsController, _emberRuntimeSystemService, _emberRuntimeExtRsvp, _emberRuntimeExtString, _emberRuntimeExtFunction, _emberRuntimeUtils) { + /** + @module ember + @submodule ember-runtime + */ + + // BEGIN IMPORTS + 'use strict'; + // END IMPORTS // BEGIN EXPORTS _emberMetal.default.compare = _emberRuntimeCompare.default; _emberMetal.default.copy = _emberRuntimeCopy.default; @@ -27787,12 +27454,10 @@ EmComputed.union = _emberRuntimeComputedReduce_computed_macros.union; EmComputed.intersect = _emberRuntimeComputedReduce_computed_macros.intersect; _emberMetal.default.String = _emberRuntimeSystemString.default; _emberMetal.default.Object = _emberRuntimeSystemObject.default; - _emberMetal.default.TrackedArray = _emberRuntimeSystemTracked_array.default; - _emberMetal.default.SubArray = _emberRuntimeSystemSubarray.default; _emberMetal.default.Container = _emberRuntimeSystemContainer.Container; _emberMetal.default.Registry = _emberRuntimeSystemContainer.Registry; _emberMetal.default.Namespace = _emberRuntimeSystemNamespace.default; _emberMetal.default.Enumerable = _emberRuntimeMixinsEnumerable.default; _emberMetal.default.ArrayProxy = _emberRuntimeSystemArray_proxy.default; @@ -27815,20 +27480,16 @@ _emberMetal.default.RSVP = _emberRuntimeExtRsvp.default; // END EXPORTS exports.default = _emberMetal.default; }); -/** -@module ember -@submodule ember-runtime -*/ - -// BEGIN IMPORTS // just for side effect of extending Ember.RSVP // just for side effect of extending String.prototype // just for side effect of extending Function.prototype enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtime/mixins/comparable'], function (exports, _emberRuntimeUtils, _emberRuntimeMixinsComparable) { + 'use strict'; + exports.default = compare; var TYPE_ORDER = { 'undefined': 0, 'null': 1, @@ -27938,10 +27599,17 @@ return 0; } } }); enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/error', 'ember-metal/computed', 'ember-metal/observer', 'ember-runtime/compare', 'ember-runtime/utils'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalError, _emberMetalComputed, _emberMetalObserver, _emberRuntimeCompare, _emberRuntimeUtils) { + /** + @module ember + @submodule ember-runtime + */ + + 'use strict'; + exports.sum = sum; exports.max = max; exports.min = min; exports.map = map; exports.mapBy = mapBy; @@ -28598,17 +28266,13 @@ }); return cp.property(itemsKey + '.[]', sortPropertiesKey + '.[]').readOnly(); } }); -/** -@module ember -@submodule ember-runtime -*/ - // Ember.assert -enifed('ember-runtime/controllers/controller', ['exports', 'ember-metal/core', 'ember-runtime/system/object', 'ember-runtime/mixins/controller', 'ember-runtime/inject'], function (exports, _emberMetalCore, _emberRuntimeSystemObject, _emberRuntimeMixinsController, _emberRuntimeInject) { +enifed('ember-runtime/controllers/controller', ['exports', 'ember-metal/core', 'ember-runtime/system/object', 'ember-runtime/mixins/controller', 'ember-runtime/inject', 'ember-runtime/mixins/action_handler'], function (exports, _emberMetalCore, _emberRuntimeSystemObject, _emberRuntimeMixinsController, _emberRuntimeInject, _emberRuntimeMixinsAction_handler) { + 'use strict'; /** @module ember @submodule ember-runtime */ @@ -28620,10 +28284,12 @@ @uses Ember.ControllerMixin @public */ var Controller = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsController.default); + _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions(Controller); + function controllerInjectionHelper(factory) { _emberMetalCore.default.assert('Defining an injected controller property on a ' + 'non-controller is not allowed.', _emberRuntimeMixinsController.default.detect(factory.PrototypeMixin)); } /** @@ -28653,18 +28319,20 @@ @since 1.10.0 @for Ember.inject @param {String} name (optional) name of the controller to inject, defaults to the property's name @return {Ember.InjectedProperty} injection descriptor instance - @private + @public */ _emberRuntimeInject.createInjectionHelper('controller', controllerInjectionHelper); exports.default = Controller; }); // Ember.assert enifed('ember-runtime/copy', ['exports', 'ember-metal/core', 'ember-runtime/system/object', 'ember-runtime/mixins/copyable'], function (exports, _emberMetalCore, _emberRuntimeSystemObject, _emberRuntimeMixinsCopyable) { + 'use strict'; + exports.default = copy; function _copy(obj, deep, seen, copies) { var ret, loc, key; @@ -28752,11 +28420,10 @@ return _copy(obj, deep, deep ? [] : null, deep ? [] : null); } }); enifed('ember-runtime/core', ['exports'], function (exports) { - exports.isEqual = isEqual; /** @module ember @submodule ember-runtime */ @@ -28777,11 +28444,14 @@ @param {Object} a first object to compare @param {Object} b second object to compare @return {Boolean} @public */ + 'use strict'; + exports.isEqual = isEqual; + function isEqual(a, b) { if (a && typeof a.isEqual === 'function') { return a.isEqual(b); } @@ -28791,11 +28461,17 @@ return a === b; } }); enifed('ember-runtime/ext/function', ['exports', 'ember-metal/core', 'ember-metal/computed', 'ember-metal/mixin'], function (exports, _emberMetalCore, _emberMetalComputed, _emberMetalMixin) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; + var a_slice = Array.prototype.slice; var FunctionPrototype = Function.prototype; if (_emberMetalCore.default.EXTEND_PROTOTYPES === true || _emberMetalCore.default.EXTEND_PROTOTYPES.Function) { @@ -28914,11 +28590,11 @@ @method observesImmediately @for Function @deprecated @private */ - FunctionPrototype.observesImmediately = _emberMetalCore.default.deprecateFunc('Function#observesImmediately is deprecated. Use Function#observes instead', FunctionPrototype._observesImmediately); + FunctionPrototype.observesImmediately = _emberMetalCore.default.deprecateFunc('Function#observesImmediately is deprecated. Use Function#observes instead', { id: 'ember-runtime.ext-function', until: '3.0.0' }, FunctionPrototype._observesImmediately); /** The `on` extension of Javascript's Function prototype is available when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default. @@ -28942,18 +28618,18 @@ return this; }; } }); -/** -@module ember -@submodule ember-runtime -*/ - // Ember.EXTEND_PROTOTYPES, Ember.assert enifed('ember-runtime/ext/rsvp', ['exports', 'ember-metal/core', 'ember-metal/logger', 'ember-metal/run_loop', 'rsvp'], function (exports, _emberMetalCore, _emberMetalLogger, _emberMetalRun_loop, _rsvp) { + /* globals RSVP:true */ + + 'use strict'; + exports.onerrorDefault = onerrorDefault; + exports.after = after; var testModuleName = 'ember-testing/test'; var Test; var asyncStart = function () { @@ -29016,26 +28692,37 @@ _emberMetalLogger.default.error(error.stack); } } } + function after(cb) { + _emberMetalCore.default.run.schedule(_emberMetalCore.default.run.queues[_emberMetalCore.default.run.queues.length - 1], cb); + } + _rsvp.on('error', onerrorDefault); + _rsvp.configure('after', after); exports.default = _rsvp; }); -/* globals RSVP:true */ enifed('ember-runtime/ext/string', ['exports', 'ember-metal/core', 'ember-runtime/system/string'], function (exports, _emberMetalCore, _emberRuntimeSystemString) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; + var StringPrototype = String.prototype; if (_emberMetalCore.default.EXTEND_PROTOTYPES === true || _emberMetalCore.default.EXTEND_PROTOTYPES.String) { /** See [Ember.String.fmt](/api/classes/Ember.String.html#method_fmt). @method fmt @for String @private + @deprecated */ StringPrototype.fmt = function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } @@ -29126,17 +28813,14 @@ StringPrototype.capitalize = function () { return _emberRuntimeSystemString.capitalize(this); }; } }); -/** -@module ember -@submodule ember-runtime -*/ - // Ember.EXTEND_PROTOTYPES, Ember.assert enifed('ember-runtime/inject', ['exports', 'ember-metal/core', 'ember-metal/injected_property'], function (exports, _emberMetalCore, _emberMetalInjected_property) { + 'use strict'; + exports.default = inject; exports.createInjectionHelper = createInjectionHelper; exports.validatePropertyInjections = validatePropertyInjections; /** @@ -29211,12 +28895,18 @@ return true; } }); // Ember.assert -enifed('ember-runtime/mixins/-proxy', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/observer', 'ember-metal/property_events', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/mixin', 'ember-runtime/system/string'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalObserver, _emberMetalProperty_events, _emberMetalComputed, _emberMetalProperties, _emberMetalMixin, _emberRuntimeSystemString) { +enifed('ember-runtime/mixins/-proxy', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/observer', 'ember-metal/property_events', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/mixin'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalObserver, _emberMetalProperty_events, _emberMetalComputed, _emberMetalProperties, _emberMetalMixin) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; + function contentPropertyWillChange(content, contentKey) { var key = contentKey.slice(8); // remove "content." if (key in this) { return; } // if shadowed in proxy @@ -29269,11 +28959,11 @@ }, unknownProperty: function (key) { var content = _emberMetalProperty_get.get(this, 'content'); if (content) { - _emberMetalCore.default.deprecate(_emberRuntimeSystemString.fmt('You attempted to access `%@` from `%@`, but object proxying is deprecated. ' + 'Please use `model.%@` instead.', [key, this, key]), !this.isController); + _emberMetalCore.default.deprecate('You attempted to access `' + key + '` from `' + this + '`, but object proxying is deprecated. Please use `model.' + key + '` instead.', !this.isController, { id: 'ember-runtime.controller-proxy', until: '3.0.0' }); return _emberMetalProperty_get.get(content, key); } }, setUnknownProperty: function (key, value) { @@ -29284,31 +28974,29 @@ _emberMetalProperties.defineProperty(this, key, null, value); return value; } var content = _emberMetalProperty_get.get(this, 'content'); - _emberMetalCore.default.assert(_emberRuntimeSystemString.fmt('Cannot delegate set(\'%@\', %@) to the \'content\' property of' + ' object proxy %@: its \'content\' is undefined.', [key, value, this]), content); + _emberMetalCore.default.assert('Cannot delegate set(\'' + key + '\', ' + value + ') to the \'content\' property of object proxy ' + this + ': its \'content\' is undefined.', content); - _emberMetalCore.default.deprecate(_emberRuntimeSystemString.fmt('You attempted to set `%@` from `%@`, but object proxying is deprecated. ' + 'Please use `model.%@` instead.', [key, this, key]), !this.isController); + _emberMetalCore.default.deprecate('You attempted to set `' + key + '` from `' + this + '`, but object proxying is deprecated. Please use `model.' + key + '` instead.', !this.isController, { id: 'ember-runtime.controller-proxy', until: '3.0.0' }); return _emberMetalProperty_set.set(content, key, value); } }); }); -/** -@module ember -@submodule ember-runtime -*/ - // Ember.assert -enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/mixin', 'ember-metal/property_get'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalMixin, _emberMetalProperty_get) { +enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal/core', 'ember-metal/mixin', 'ember-metal/property_get', 'ember-metal/deprecate_property'], function (exports, _emberMetalCore, _emberMetalMixin, _emberMetalProperty_get, _emberMetalDeprecate_property) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; + exports.deprecateUnderscoreActions = deprecateUnderscoreActions; + /** - The `Ember.ActionHandler` mixin implements support for moving an `actions` - property to an `_actions` property at extend time, and adding `_actions` - to the object's mergedProperties list. - `Ember.ActionHandler` is available on some familiar classes including `Ember.Route`, `Ember.View`, `Ember.Component`, and `Ember.Controller`. (Internally the mixin is used by `Ember.CoreView`, `Ember.ControllerMixin`, and `Ember.Route` and available to the above classes through inheritance.) @@ -29316,11 +29004,11 @@ @class ActionHandler @namespace Ember @private */ var ActionHandler = _emberMetalMixin.Mixin.create({ - mergedProperties: ['_actions'], + mergedProperties: ['actions'], /** The collection of functions, keyed by name, available on this `ActionHandler` as action targets. These functions will be invoked when a matching `{{action}}` is triggered @@ -29420,29 +29108,10 @@ @default null @public */ /** - Moves `actions` to `_actions` at extend time. Note that this currently - modifies the mixin themselves, which is technically dubious but - is practically of little consequence. This may change in the future. - @private - @method willMergeMixin - */ - willMergeMixin: function (props) { - if (!props._actions) { - _emberMetalCore.default.assert('\'actions\' should not be a function', typeof props.actions !== 'function'); - - if (!!props.actions && typeof props.actions === 'object') { - var hashName = 'actions'; - props._actions = _emberMetalMerge.default(props._actions || {}, props[hashName]); - delete props[hashName]; - } - } - }, - - /** Triggers a named action on the `ActionHandler`. Any parameters supplied after the `actionName` string will be passed as arguments to the action target function. If the `ActionHandler` has its `target` property set, actions may bubble to the `target`. Bubbling happens when an `actionName` can @@ -29471,32 +29140,45 @@ args[_key - 1] = arguments[_key]; } var target; - if (this._actions && this._actions[actionName]) { - var shouldBubble = this._actions[actionName].apply(this, args) === true; + if (this.actions && this.actions[actionName]) { + var shouldBubble = this.actions[actionName].apply(this, args) === true; if (!shouldBubble) { return; } } if (target = _emberMetalProperty_get.get(this, 'target')) { + var _target; + _emberMetalCore.default.assert('The `target` for ' + this + ' (' + target + ') does not have a `send` method', typeof target.send === 'function'); - target.send.apply(target, arguments); + (_target = target).send.apply(_target, arguments); } } }); exports.default = ActionHandler; + + function deprecateUnderscoreActions(factory) { + _emberMetalDeprecate_property.deprecateProperty(factory.prototype, '_actions', 'actions', { + id: 'ember-runtime.action-handler-_actions', until: '3.0.0' + }); + } }); -/** -@module ember -@submodule ember-runtime -*/ -enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/computed', 'ember-metal/is_none', 'ember-runtime/mixins/enumerable', 'ember-metal/mixin', 'ember-metal/property_events', 'ember-metal/events', 'ember-metal/watching'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalComputed, _emberMetalIs_none, _emberRuntimeMixinsEnumerable, _emberMetalMixin, _emberMetalProperty_events, _emberMetalEvents, _emberMetalWatching) { +enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/computed', 'ember-metal/is_none', 'ember-runtime/mixins/enumerable', 'ember-metal/mixin', 'ember-metal/property_events', 'ember-metal/events', 'ember-runtime/system/each_proxy'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalComputed, _emberMetalIs_none, _emberRuntimeMixinsEnumerable, _emberMetalMixin, _emberMetalProperty_events, _emberMetalEvents, _emberRuntimeSystemEach_proxy) { + /** + @module ember + @submodule ember-runtime + */ + // .......................................................... + // HELPERS + // + 'use strict'; + function arrayObserversHelper(obj, target, opts, operation, notify) { var willChange = opts && opts.willChange || 'arrayWillChange'; var didChange = opts && opts.didChange || 'arrayDidChange'; var hasObservers = _emberMetalProperty_get.get(obj, 'hasArrayObservers'); @@ -29860,13 +29542,12 @@ if (addAmt === undefined) { addAmt = -1; } } - // Make sure the @each proxy is set up if anyone is observing @each - if (_emberMetalWatching.isWatching(this, '@each')) { - _emberMetalProperty_get.get(this, '@each'); + if (this.__each) { + this.__each.arrayWillChange(this, startIdx, removeAmt, addAmt); } _emberMetalEvents.sendEvent(this, '@array:before', [this, startIdx, removeAmt, addAmt]); if (startIdx >= 0 && removeAmt >= 0 && _emberMetalProperty_get.get(this, 'hasEnumerableObservers')) { @@ -29926,10 +29607,15 @@ } else { adding = addAmt; } this.enumerableContentDidChange(removeAmt, adding); + + if (this.__each) { + this.__each.arrayDidChange(this, startIdx, removeAmt, addAmt); + } + _emberMetalEvents.sendEvent(this, '@array:change', [this, startIdx, removeAmt, addAmt]); var length = _emberMetalProperty_get.get(this, 'length'); var cachedFirst = _emberMetalComputed.cacheFor(this, 'firstObject'); var cachedLast = _emberMetalComputed.cacheFor(this, 'lastObject'); @@ -29945,14 +29631,10 @@ } return this; }, - // .......................................................... - // ENUMERATED PROPERTIES - // - /** 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. @@ -29960,31 +29642,22 @@ use the `[]` property instead of `@each`. @property @each @public */ '@each': _emberMetalComputed.computed(function () { + // TODO use Symbol or add to meta if (!this.__each) { - // ES6TODO: GRRRRR - var EachProxy = requireModule('ember-runtime/system/each_proxy')['EachProxy']; - - this.__each = new EachProxy(this); + this.__each = new _emberRuntimeSystemEach_proxy.default(this); } return this.__each; - }) + }).volatile() }); }); -/** -@module ember -@submodule ember-runtime -*/ - -// .......................................................... -// HELPERS -// // ES6TODO: Ember.A enifed('ember-runtime/mixins/comparable', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { + 'use strict'; /** @module ember @submodule ember-runtime */ @@ -30018,10 +29691,11 @@ */ compare: null }); }); enifed('ember-runtime/mixins/controller', ['exports', 'ember-metal/mixin', 'ember-metal/alias', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/controller_content_model_alias_deprecation'], function (exports, _emberMetalMixin, _emberMetalAlias, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsController_content_model_alias_deprecation) { + 'use strict'; /** @class ControllerMixin @namespace Ember @uses Ember.ActionHandler @@ -30069,10 +29743,11 @@ content: _emberMetalAlias.default('model') }); }); enifed('ember-runtime/mixins/controller_content_model_alias_deprecation', ['exports', 'ember-metal/core', 'ember-metal/mixin'], function (exports, _emberMetalCore, _emberMetalMixin) { + 'use strict'; /* The ControllerContentModelAliasDeprecation mixin is used to provide a useful deprecation warning when specifying `content` directly on a `Ember.Controller` (without also specifying `model`). @@ -30105,18 +29780,24 @@ if (props.content && !modelSpecified) { props.model = props.content; delete props['content']; - _emberMetalCore.default.deprecate('Do not specify `content` on a Controller, use `model` instead.', false); + _emberMetalCore.default.deprecate('Do not specify `content` on a Controller, use `model` instead.', false, { id: 'ember-runtime.will-merge-mixin', until: '3.0.0' }); } } }); }); // Ember.deprecate -enifed('ember-runtime/mixins/copyable', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-runtime/mixins/freezable', 'ember-runtime/system/string', 'ember-metal/error'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalMixin, _emberRuntimeMixinsFreezable, _emberRuntimeSystemString, _emberMetalError) { +enifed('ember-runtime/mixins/copyable', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-runtime/mixins/freezable', 'ember-metal/error'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalMixin, _emberRuntimeMixinsFreezable, _emberMetalError) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; + /** Implements some standard methods for copying an object. Add this mixin to any object you create that can create a copy of itself. This mixin is added automatically to the built-in array. @@ -30155,25 +29836,31 @@ @return {Object} copy of receiver or receiver @deprecated Use `Object.freeze` instead. @private */ frozenCopy: function () { - _emberMetalCore.default.deprecate('`frozenCopy` is deprecated, use Object.freeze instead.'); + _emberMetalCore.default.deprecate('`frozenCopy` is deprecated, use `Object.freeze` instead.', false, { id: 'ember-runtime.frozen-copy', until: '3.0.0' }); if (_emberRuntimeMixinsFreezable.Freezable && _emberRuntimeMixinsFreezable.Freezable.detect(this)) { return _emberMetalProperty_get.get(this, 'isFrozen') ? this : this.copy().freeze(); } else { - throw new _emberMetalError.default(_emberRuntimeSystemString.fmt('%@ does not support freezing', [this])); + throw new _emberMetalError.default(this + ' does not support freezing'); } } }); }); -/** -@module ember -@submodule ember-runtime -*/ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/mixin', 'ember-metal/computed', 'ember-metal/property_events', 'ember-metal/events', 'ember-runtime/compare'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberMetalComputed, _emberMetalProperty_events, _emberMetalEvents, _emberRuntimeCompare) { + /** + @module ember + @submodule ember-runtime + */ + // .......................................................... + // HELPERS + // + + 'use strict'; + var contexts = []; function popCtx() { return contexts.length === 0 ? {} : contexts.pop(); } @@ -30372,11 +30059,11 @@ to give your iterator function access to the current object. @method forEach @param {Function} callback The callback to execute @param {Object} [target] The target object to use @return {Object} receiver - @private + @public */ forEach: function (callback, target) { if (typeof callback !== 'function') { throw new TypeError(); } @@ -30661,11 +30348,11 @@ ``` @method every @param {Function} callback The callback to execute @param {Object} [target] The target object to use @return {Boolean} - @private + @public */ every: function (callback, target) { return !this.find(function (x, idx, i) { return !callback.call(target, x, idx, i); }); @@ -30843,11 +30530,11 @@ var arr = ['a', null, 'c', undefined]; arr.compact(); // ['a', 'c'] ``` @method compact @return {Array} the array without null and undefined elements. - @private + @public */ compact: function () { return this.filter(function (value) { return value != null; }); @@ -30862,11 +30549,11 @@ arr.without('a'); // ['b', 'c'] ``` @method without @param {Object} value @return {Ember.Enumerable} - @private + @public */ without: function (value) { if (!this.contains(value)) { return this; // nothing to do } @@ -31105,11 +30792,11 @@ You may provide multiple arguments to sort by multiple properties. @method sortBy @param {String} property name(s) to sort on @return {Array} The sorted array. @since 1.2.0 - @private + @public */ sortBy: function () { var sortKeys = arguments; return this.toArray().sort(function (a, b) { @@ -31127,19 +30814,12 @@ return 0; }); } }); }); -/** -@module ember -@submodule ember-runtime -*/ - -// .......................................................... -// HELPERS -// enifed('ember-runtime/mixins/evented', ['exports', 'ember-metal/mixin', 'ember-metal/events'], function (exports, _emberMetalMixin, _emberMetalEvents) { + 'use strict'; /** @module ember @submodule ember-runtime */ @@ -31278,11 +30958,17 @@ return _emberMetalEvents.hasListeners(this, name); } }); }); enifed('ember-runtime/mixins/freezable', ['exports', 'ember-metal/core', 'ember-metal/mixin', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, _emberMetalCore, _emberMetalMixin, _emberMetalProperty_get, _emberMetalProperty_set) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; + /** The `Ember.Freezable` mixin implements some basic methods for marking an object as frozen. Once an object is frozen it should be read only. No changes may be made the internal state of the object. @@ -31340,11 +31026,11 @@ @private */ var Freezable = _emberMetalMixin.Mixin.create({ init: function () { - _emberMetalCore.default.deprecate('`Ember.Freezable` is deprecated, use `Object.freeze` instead.'); + _emberMetalCore.default.deprecate('`Ember.Freezable` is deprecated, use `Object.freeze` instead.', false, { id: 'ember-runtime.freezable-init', until: '3.0.0' }); this._super.apply(this, arguments); }, /** Set to `true` when the object is frozen. Use this property to detect @@ -31375,14 +31061,10 @@ exports.Freezable = Freezable; var FROZEN_ERROR = 'Frozen object cannot be modified.'; exports.FROZEN_ERROR = FROZEN_ERROR; }); -/** -@module ember -@submodule ember-runtime -*/ enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal/property_get', 'ember-metal/error', 'ember-metal/mixin', 'ember-runtime/mixins/array', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/enumerable'], function (exports, _emberMetalProperty_get, _emberMetalError, _emberMetalMixin, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsEnumerable) { /** @module ember @submodule ember-runtime */ @@ -31392,13 +31074,19 @@ // .......................................................... // CONSTANTS // + 'use strict'; + var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; var EMPTY = []; + // .......................................................... + // HELPERS + // + /** This mixin defines the API for modifying array-like objects. These methods can be applied only to a collection that keeps its items in an ordered set. It builds upon the Array mixin and adds methods to modify the array. One concrete implementations of this class include ArrayProxy. @@ -31727,14 +31415,12 @@ return this; } }); }); -// .......................................................... -// HELPERS -// enifed('ember-runtime/mixins/mutable_enumerable', ['exports', 'ember-runtime/mixins/enumerable', 'ember-metal/mixin', 'ember-metal/property_events'], function (exports, _emberRuntimeMixinsEnumerable, _emberMetalMixin, _emberMetalProperty_events) { + 'use strict'; /** @module ember @submodule ember-runtime */ @@ -31843,10 +31529,15 @@ return this; } }); }); enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/get_properties', 'ember-metal/set_properties', 'ember-metal/mixin', 'ember-metal/events', 'ember-metal/property_events', 'ember-metal/observer', 'ember-metal/computed', 'ember-metal/is_none'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalMixin, _emberMetalEvents, _emberMetalProperty_events, _emberMetalObserver, _emberMetalComputed, _emberMetalIs_none) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; /** ## Overview This mixin provides properties and property observing functionality, core @@ -32106,11 +31797,11 @@ Convenience method to call `propertyWillChange` and `propertyDidChange` in succession. @method notifyPropertyChange @param {String} keyName The property key to be notified about. @return {Ember.Observable} - @private + @public */ notifyPropertyChange: function (keyName) { this.propertyWillChange(keyName); this.propertyDidChange(keyName); return this; @@ -32274,16 +31965,13 @@ observersForKey: function (keyName) { return _emberMetalObserver.observersFor(this, keyName); } }); }); -/** -@module ember -@submodule ember-runtime -*/ // Ember.assert enifed('ember-runtime/mixins/promise_proxy', ['exports', 'ember-metal/property_get', 'ember-metal/set_properties', 'ember-metal/computed', 'ember-metal/mixin', 'ember-metal/error'], function (exports, _emberMetalProperty_get, _emberMetalSet_properties, _emberMetalComputed, _emberMetalMixin, _emberMetalError) { + 'use strict'; var not = _emberMetalComputed.computed.not; var or = _emberMetalComputed.computed.or; /** @@ -32471,10 +32159,15 @@ return promise[name].apply(promise, arguments); }; } }); enifed('ember-runtime/mixins/target_action_support', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-metal/computed'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalMixin, _emberMetalComputed) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; /** `Ember.TargetActionSupport` is a mixin that can be included in a class to add a `triggerAction` method with semantics similar to the Handlebars `{{action}}` helper. In normal Ember usage, the `{{action}}` helper is @@ -32614,19 +32307,18 @@ } }); exports.default = TargetActionSupport; }); -/** -@module ember -@submodule ember-runtime -*/ // Ember.lookup, Ember.assert enifed('ember-runtime/system/application', ['exports', 'ember-runtime/system/namespace'], function (exports, _emberRuntimeSystemNamespace) { + 'use strict'; + exports.default = _emberRuntimeSystemNamespace.default.extend(); }); -enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-runtime/utils', 'ember-metal/computed', 'ember-metal/mixin', 'ember-metal/property_events', 'ember-metal/error', 'ember-runtime/system/object', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/enumerable', 'ember-runtime/system/string', 'ember-metal/alias'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeUtils, _emberMetalComputed, _emberMetalMixin, _emberMetalProperty_events, _emberMetalError, _emberRuntimeSystemObject, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsEnumerable, _emberRuntimeSystemString, _emberMetalAlias) { +enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-runtime/utils', 'ember-metal/computed', 'ember-metal/mixin', 'ember-metal/property_events', 'ember-metal/error', 'ember-runtime/system/object', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/enumerable', 'ember-metal/alias'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeUtils, _emberMetalComputed, _emberMetalMixin, _emberMetalProperty_events, _emberMetalError, _emberRuntimeSystemObject, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsEnumerable, _emberMetalAlias) { + 'use strict'; /** @module ember @submodule ember-runtime */ @@ -32673,11 +32365,11 @@ @class ArrayProxy @namespace Ember @extends Ember.Object @uses Ember.MutableArray - @private + @public */ var ArrayProxy = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsMutable_array.default, { /** The content array. Must be an object that implements `Ember.Array` and/or @@ -32786,11 +32478,11 @@ _setupContent: function () { var content = _emberMetalProperty_get.get(this, 'content'); if (content) { - _emberMetalCore.default.assert(_emberRuntimeSystemString.fmt('ArrayProxy expects an Array or ' + 'Ember.ArrayProxy, but you passed %@', [typeof content]), _emberRuntimeUtils.isArray(content) || content.isDestroyed); + _emberMetalCore.default.assert('ArrayProxy expects an Array or Ember.ArrayProxy, but you passed ' + typeof content, _emberRuntimeUtils.isArray(content) || content.isDestroyed); content.addArrayObserver(this, { willChange: 'contentArrayWillChange', didChange: 'contentArrayDidChange' }); @@ -32821,11 +32513,11 @@ _setupArrangedContent: function () { var arrangedContent = _emberMetalProperty_get.get(this, 'arrangedContent'); if (arrangedContent) { - _emberMetalCore.default.assert(_emberRuntimeSystemString.fmt('ArrayProxy expects an Array or ' + 'Ember.ArrayProxy, but you passed %@', [typeof arrangedContent]), _emberRuntimeUtils.isArray(arrangedContent) || arrangedContent.isDestroyed); + _emberMetalCore.default.assert('ArrayProxy expects an Array or Ember.ArrayProxy, but you passed ' + typeof arrangedContent, _emberRuntimeUtils.isArray(arrangedContent) || arrangedContent.isDestroyed); arrangedContent.addArrayObserver(this, { willChange: 'arrangedContentArrayWillChange', didChange: 'arrangedContentArrayDidChange' }); @@ -32987,10 +32679,11 @@ exports.default = ArrayProxy; }); // Ember.assert enifed('ember-runtime/system/container', ['exports', 'ember-metal/property_set', 'container/registry', 'container/container'], function (exports, _emberMetalProperty_set, _containerRegistry, _containerContainer) { + 'use strict'; _containerRegistry.default.set = _emberMetalProperty_set.set; _containerContainer.default.set = _emberMetalProperty_set.set; exports.Registry = _containerRegistry.default; @@ -32998,12 +32691,21 @@ }); enifed('ember-runtime/system/core_object', ['exports', 'ember-metal', 'ember-metal/features', 'ember-metal/merge', 'ember-metal/property_get', 'ember-metal/utils', 'ember-metal/chains', 'ember-metal/events', 'ember-metal/mixin', 'ember-metal/error', 'ember-runtime/mixins/action_handler', 'ember-metal/properties', 'ember-metal/binding', 'ember-metal/computed', 'ember-metal/injected_property', 'ember-metal/run_loop', 'ember-metal/watching', 'ember-metal/core', 'ember-runtime/inject'], function (exports, _emberMetal, _emberMetalFeatures, _emberMetalMerge, _emberMetalProperty_get, _emberMetalUtils, _emberMetalChains, _emberMetalEvents, _emberMetalMixin, _emberMetalError, _emberRuntimeMixinsAction_handler, _emberMetalProperties, _emberMetalBinding, _emberMetalComputed, _emberMetalInjected_property, _emberMetalRun_loop, _emberMetalWatching, _emberMetalCore, _emberRuntimeInject) { // Remove "use strict"; from transpiled module until // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed // + 'REMOVE_USE_STRICT: true'; + /** + @module ember + @submodule ember-runtime + */ + + // using ember-metal/lib/main here to ensure that ember-debug is setup + // if present + var schedule = _emberMetalRun_loop.default.schedule; var applyMixin = _emberMetalMixin.Mixin._apply; var finishPartial = _emberMetalMixin.Mixin.finishPartial; var reopen = _emberMetalMixin.Mixin.prototype.reopen; var hasCachedComputedProperties = false; @@ -33761,195 +33463,74 @@ } }); exports.default = CoreObject; }); -/** - @module ember - @submodule ember-runtime -*/ -// using ember-metal/lib/main here to ensure that ember-debug is setup -// if present - // Ember.assert, Ember.config // NOTE: this object should never be included directly. Instead use `Ember.Object`. // We only define this separately so that `Ember.Set` can depend on it. -enifed('ember-runtime/system/each_proxy', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/utils', 'ember-runtime/utils', 'ember-runtime/mixins/array', 'ember-runtime/system/object', 'ember-metal/computed', 'ember-metal/observer', 'ember-metal/events', 'ember-metal/properties', 'ember-metal/property_events'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalUtils, _emberRuntimeUtils, _emberRuntimeMixinsArray, _emberRuntimeSystemObject, _emberMetalComputed, _emberMetalObserver, _emberMetalEvents, _emberMetalProperties, _emberMetalProperty_events) { +enifed('ember-runtime/system/each_proxy', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/observer', 'ember-metal/property_events'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalObserver, _emberMetalProperty_events) { + 'use strict'; - var EachArray = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsArray.default, { - - init: function (content, keyName, owner) { - this._super.apply(this, arguments); - this._keyName = keyName; - this._owner = owner; - this._content = content; - }, - - objectAt: function (idx) { - var item = this._content.objectAt(idx); - return item && _emberMetalProperty_get.get(item, this._keyName); - }, - - length: _emberMetalComputed.computed(function () { - var content = this._content; - return content ? _emberMetalProperty_get.get(content, 'length') : 0; - }) - - }); - - var IS_OBSERVER = /^.+:(before|change)$/; - - function addObserverForContentKey(content, keyName, proxy, idx, loc) { - var objects = proxy._objects; - var guid; - if (!objects) { - objects = proxy._objects = {}; - } - - while (--loc >= idx) { - var item = content.objectAt(loc); - if (item) { - _emberMetalCore.default.assert('When using @each to observe the array ' + content + ', the array must return an object', _emberRuntimeUtils.typeOf(item) === 'instance' || _emberRuntimeUtils.typeOf(item) === 'object'); - _emberMetalObserver._addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); - _emberMetalObserver.addObserver(item, keyName, proxy, 'contentKeyDidChange'); - - // keep track of the index each item was found at so we can map - // it back when the obj changes. - guid = _emberMetalUtils.guidFor(item); - if (!objects[guid]) { - objects[guid] = []; - } - - objects[guid].push(loc); - } - } - } - - function removeObserverForContentKey(content, keyName, proxy, idx, loc) { - var objects = proxy._objects; - if (!objects) { - objects = proxy._objects = {}; - } - - var indices, guid; - - while (--loc >= idx) { - var item = content.objectAt(loc); - if (item) { - _emberMetalObserver._removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); - _emberMetalObserver.removeObserver(item, keyName, proxy, 'contentKeyDidChange'); - - guid = _emberMetalUtils.guidFor(item); - indices = objects[guid]; - indices[indices.indexOf(loc)] = null; - } - } - } - /** This is the object instance returned when you get the `@each` property on an array. It uses the unknownProperty handler to automatically create EachArray instances for property names. @class EachProxy @private */ - var EachProxy = _emberRuntimeSystemObject.default.extend({ + function EachProxy(content) { + this._content = content; + this._keys = undefined; + this.__ember_meta__ = undefined; + } - init: function (content) { - var _this = this; - - this._super.apply(this, arguments); - this._content = content; - content.addArrayObserver(this); - - // in case someone is already observing some keys make sure they are - // added - _emberMetalEvents.watchedEvents(this).forEach(function (eventName) { - _this.didAddListener(eventName); - }); - }, - - /** - You can directly access mapped properties by simply requesting them. - The `unknownProperty` handler will generate an EachArray of each item. - @method unknownProperty - @param keyName {String} - @param value {*} - @private - */ - unknownProperty: function (keyName, value) { - var ret = new EachArray(this._content, keyName, this); - _emberMetalProperties.defineProperty(this, keyName, null, ret); - this.beginObservingContentKey(keyName); - return ret; - }, - + EachProxy.prototype = { // .......................................................... // ARRAY CHANGES // Invokes whenever the content array itself changes. arrayWillChange: function (content, idx, removedCnt, addedCnt) { var keys = this._keys; - var key, lim; - - lim = removedCnt > 0 ? idx + removedCnt : -1; - _emberMetalProperty_events.beginPropertyChanges(this); - - for (key in keys) { + var lim = removedCnt > 0 ? idx + removedCnt : -1; + for (var key in keys) { if (!keys.hasOwnProperty(key)) { continue; } - if (lim > 0) { removeObserverForContentKey(content, key, this, idx, lim); } - _emberMetalProperty_events.propertyWillChange(this, key); } - - _emberMetalProperty_events.propertyWillChange(this._content, '@each'); - _emberMetalProperty_events.endPropertyChanges(this); }, arrayDidChange: function (content, idx, removedCnt, addedCnt) { var keys = this._keys; - var lim; - - lim = addedCnt > 0 ? idx + addedCnt : -1; - _emberMetalProperty_events.changeProperties(function () { - for (var key in keys) { - if (!keys.hasOwnProperty(key)) { - continue; - } - - if (lim > 0) { - addObserverForContentKey(content, key, this, idx, lim); - } - - _emberMetalProperty_events.propertyDidChange(this, key); + var lim = addedCnt > 0 ? idx + addedCnt : -1; + for (var key in keys) { + if (!keys.hasOwnProperty(key)) { + continue; } - - _emberMetalProperty_events.propertyDidChange(this._content, '@each'); - }, this); + if (lim > 0) { + addObserverForContentKey(content, key, this, idx, lim); + } + _emberMetalProperty_events.propertyDidChange(this, key); + } }, // .......................................................... // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS // Start monitoring keys based on who is listening... - didAddListener: function (eventName) { - if (IS_OBSERVER.test(eventName)) { - this.beginObservingContentKey(eventName.slice(0, -7)); - } + willWatchProperty: function (property) { + this.beginObservingContentKey(property); }, - didRemoveListener: function (eventName) { - if (IS_OBSERVER.test(eventName)) { - this.stopObservingContentKey(eventName.slice(0, -7)); - } + didUnwatchProperty: function (property) { + this.stopObservingContentKey(property); }, // .......................................................... // CONTENT KEY OBSERVING // Actual watch keys on the source content. @@ -33986,24 +33567,41 @@ }, contentKeyDidChange: function (obj, keyName) { _emberMetalProperty_events.propertyDidChange(this, keyName); } - }); + }; - exports.EachArray = EachArray; - exports.EachProxy = EachProxy; -}); -/** -@module ember -@submodule ember-runtime -*/ + function addObserverForContentKey(content, keyName, proxy, idx, loc) { + while (--loc >= idx) { + var item = content.objectAt(loc); + if (item) { + _emberMetalCore.default.assert('When using @each to observe the array ' + content + ', the array must return an object', typeof item === 'object'); + _emberMetalObserver._addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); + _emberMetalObserver.addObserver(item, keyName, proxy, 'contentKeyDidChange'); + } + } + } -// Ember.assert + function removeObserverForContentKey(content, keyName, proxy, idx, loc) { + while (--loc >= idx) { + var item = content.objectAt(loc); + if (item) { + _emberMetalObserver._removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); + _emberMetalObserver.removeObserver(item, keyName, proxy, 'contentKeyDidChange'); + } + } + } -// ES6TODO: WAT? Circular dep? + exports.default = EachProxy; +}); +// Ember.assert enifed('ember-runtime/system/lazy_load', ['exports', 'ember-metal/core', 'ember-runtime/system/native_array'], function (exports, _emberMetalCore, _emberRuntimeSystemNative_array) { + /*globals CustomEvent */ + + 'use strict'; + exports.onLoad = onLoad; exports.runLoadHooks = runLoadHooks; // make sure Ember.A is setup. /** @@ -34011,11 +33609,13 @@ @submodule ember-runtime */ var loadHooks = _emberMetalCore.default.ENV.EMBER_LOAD_HOOKS || {}; var loaded = {}; + var _loaded = loaded; + exports._loaded = _loaded; /** Detects when a specific package of Ember (e.g. 'Ember.Application') has fully loaded and is available for extension. The provided `callback` will be called with the `name` passed @@ -34033,16 +33633,16 @@ @param callback {Function} callback to be called @private */ function onLoad(name, callback) { - var object; + var object = loaded[name]; loadHooks[name] = loadHooks[name] || _emberMetalCore.default.A(); loadHooks[name].pushObject(callback); - if (object = loaded[name]) { + if (object) { callback(object); } } /** @@ -34069,15 +33669,20 @@ return callback(object); }); } } }); -/*globals CustomEvent */ - // Ember.ENV.EMBER_LOAD_HOOKS enifed('ember-runtime/system/namespace', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/utils', 'ember-metal/mixin', 'ember-runtime/system/object'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalUtils, _emberMetalMixin, _emberRuntimeSystemObject) { + /** + @module ember + @submodule ember-runtime + */ + // Ember.lookup, Ember.BOOTED, Ember.deprecate, Ember.NAME_KEY, Ember.anyUnprocessedMixins + 'use strict'; + /** A Namespace is an object usually used to contain other objects or methods such as an application or framework. Create a namespace anytime you want to define one of these new containers. @@ -34173,19 +33778,19 @@ obj.toString = makeToString(paths.join('.')); obj[NAME_KEY] = paths.join('.'); // Support nested namespaces } else if (obj && obj.isNamespace) { - // Skip aliased namespaces - if (seen[_emberMetalUtils.guidFor(obj)]) { - continue; - } - seen[_emberMetalUtils.guidFor(obj)] = true; + // Skip aliased namespaces + if (seen[_emberMetalUtils.guidFor(obj)]) { + continue; + } + seen[_emberMetalUtils.guidFor(obj)] = true; - // Process the child namespace - processNamespace(paths, obj, seen); - } + // Process the child namespace + processNamespace(paths, obj, seen); + } } paths.length = idx; // cut out last item } @@ -34193,11 +33798,13 @@ function tryIsNamespace(lookup, prop) { try { var obj = lookup[prop]; return obj && obj.isNamespace && obj; - } catch (e) {} + } catch (e) { + // continue + } } function findNamespaces() { var lookup = _emberMetalCore.default.lookup; var obj; @@ -34295,20 +33902,18 @@ _emberMetalMixin.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. exports.default = Namespace; }); -/** -@module ember -@submodule ember-runtime -*/ - -// Ember.lookup, Ember.BOOTED, Ember.deprecate, Ember.NAME_KEY, Ember.anyUnprocessedMixins - -// continue enifed('ember-runtime/system/native_array', ['exports', 'ember-metal/core', 'ember-metal/replace', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-runtime/mixins/array', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/observable', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/freezable', 'ember-runtime/copy'], function (exports, _emberMetalCore, _emberMetalReplace, _emberMetalProperty_get, _emberMetalMixin, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsObservable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsFreezable, _emberRuntimeCopy) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; + // Add Ember.Array to Array.prototype. Remove methods with native // implementations and supply some more optimized versions of generic methods // because they are so common. /** @@ -34396,11 +34001,12 @@ if (Array.prototype[methodName]) { ignore.push(methodName); } }); - exports.NativeArray = NativeArray = NativeArray.without.apply(NativeArray, ignore); + exports.NativeArray // TODO: only use default export + = NativeArray = NativeArray.without.apply(NativeArray, ignore); /** Creates an `Ember.NativeArray` from an Array like object. Does not modify the original object. Ember.A is not needed if `Ember.EXTEND_PROTOTYPES` is `true` (the default value). However, @@ -34457,33 +34063,33 @@ @private */ NativeArray.activate = function () { NativeArray.apply(Array.prototype); - exports.A = A = function (arr) { + exports. // ES6TODO: Setting A onto the object returned by ember-metal/core to avoid circles + A = A = function (arr) { return arr || []; }; }; if (_emberMetalCore.default.EXTEND_PROTOTYPES === true || _emberMetalCore.default.EXTEND_PROTOTYPES.Array) { NativeArray.activate(); } - _emberMetalCore.default.A = A; // ES6TODO: Setting A onto the object returned by ember-metal/core to avoid circles - exports.A = A; - exports.NativeArray = NativeArray // TODO: only use default export - ; + _emberMetalCore.default.A = A;exports.A = A; + exports.NativeArray = NativeArray; exports.default = NativeArray; }); -/** -@module ember -@submodule ember-runtime -*/ - // Ember.EXTEND_PROTOTYPES enifed('ember-runtime/system/object', ['exports', 'ember-runtime/system/core_object', 'ember-runtime/mixins/observable'], function (exports, _emberRuntimeSystemCore_object, _emberRuntimeMixinsObservable) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; + /** `Ember.Object` is the main base class for all Ember objects. It is a subclass of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details, see the documentation for each of these. @@ -34498,15 +34104,12 @@ return 'Ember.Object'; }; exports.default = EmberObject; }); -/** -@module ember -@submodule ember-runtime -*/ enifed('ember-runtime/system/object_proxy', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/-proxy'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsProxy) { + 'use strict'; /** `Ember.ObjectProxy` forwards all properties not defined by the proxy itself to a proxied `content` object. @@ -34577,10 +34180,11 @@ */ exports.default = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsProxy.default); }); enifed('ember-runtime/system/service', ['exports', 'ember-runtime/system/object', 'ember-runtime/inject'], function (exports, _emberRuntimeSystemObject, _emberRuntimeInject) { + 'use strict'; /** Creates a property that lazily looks up a service in the container. There are no restrictions as to what objects a service can be injected into. @@ -34624,10 +34228,15 @@ }); exports.default = Service; }); enifed('ember-runtime/system/string', ['exports', 'ember-metal/core', 'ember-metal/utils', 'ember-runtime/utils', 'ember-metal/cache'], function (exports, _emberMetalCore, _emberMetalUtils, _emberRuntimeUtils, _emberMetalCache) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; var STRING_DASHERIZE_REGEXP = /[ _]/g; var STRING_DASHERIZE_CACHE = new _emberMetalCache.default(1000, function (key) { return decamelize(key).replace(STRING_DASHERIZE_REGEXP, '-'); @@ -34674,11 +34283,11 @@ var DECAMELIZE_CACHE = new _emberMetalCache.default(1000, function (str) { return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase(); }); - function fmt(str, formats) { + function _fmt(str, formats) { var cachedFormats = formats; if (!_emberRuntimeUtils.isArray(cachedFormats) || arguments.length > 2) { cachedFormats = new Array(arguments.length - 1); @@ -34694,17 +34303,22 @@ s = cachedFormats[argIndex]; return s === null ? '(null)' : s === undefined ? '' : _emberMetalUtils.inspect(s); }); } + function fmt(str, formats) { + _emberMetalCore.default.deprecate('Ember.String.fmt is deprecated, use ES6 template strings instead.', false, { id: 'ember-string-utils.fmt', until: '3.0.0', url: 'https://babeljs.io/docs/learn-es6/#template-strings' }); + return _fmt.apply(undefined, arguments); + } + function loc(str, formats) { if (!_emberRuntimeUtils.isArray(formats) || arguments.length > 2) { formats = Array.prototype.slice.call(arguments, 1); } str = _emberMetalCore.default.STRINGS[str] || str; - return fmt(str, formats); + return _fmt(str, formats); } function w(str) { return str.split(/\s+/); } @@ -34771,10 +34385,11 @@ @method fmt @param {String} str The string to format @param {Array} formats An array of parameters to interpolate into string. @return {String} formatted string @public + @deprecated Use ES6 template strings instead: https://babeljs.io/docs/learn-es6/#template-strings'); */ fmt: fmt, /** Formats the passed string, but first looks up the string in the localized @@ -34923,520 +34538,14 @@ exports.camelize = camelize; exports.classify = classify; exports.underscore = underscore; exports.capitalize = capitalize; }); -/** -@module ember -@submodule ember-runtime -*/ // Ember.STRINGS -enifed('ember-runtime/system/subarray', ['exports', 'ember-metal/error'], function (exports, _emberMetalError) { - - var RETAIN = 'r'; - var FILTER = 'f'; - - function Operation(type, count) { - this.type = type; - this.count = count; - } - - exports.default = SubArray; - - /** - An `Ember.SubArray` tracks an array in a way similar to, but more specialized - than, `Ember.TrackedArray`. It is useful for keeping track of the indexes of - items within a filtered array. - - @class SubArray - @namespace Ember - @private - */ - function SubArray(length) { - if (arguments.length < 1) { - length = 0; - } - - if (length > 0) { - this._operations = [new Operation(RETAIN, length)]; - } else { - this._operations = []; - } - } - - SubArray.prototype = { - /** - Track that an item was added to the tracked array. - @method addItem - @param {Number} index The index of the item in the tracked array. - @param {Boolean} match `true` iff the item is included in the subarray. - @return {number} The index of the item in the subarray. - @private - */ - addItem: function (index, match) { - var returnValue = -1; - var itemType = match ? RETAIN : FILTER; - var self = this; - - this._findOperation(index, function (operation, operationIndex, rangeStart, rangeEnd, seenInSubArray) { - var newOperation, splitOperation; - - if (itemType === operation.type) { - ++operation.count; - } else if (index === rangeStart) { - // insert to the left of `operation` - self._operations.splice(operationIndex, 0, new Operation(itemType, 1)); - } else { - newOperation = new Operation(itemType, 1); - splitOperation = new Operation(operation.type, rangeEnd - index + 1); - operation.count = index - rangeStart; - - self._operations.splice(operationIndex + 1, 0, newOperation, splitOperation); - } - - if (match) { - if (operation.type === RETAIN) { - returnValue = seenInSubArray + (index - rangeStart); - } else { - returnValue = seenInSubArray; - } - } - - self._composeAt(operationIndex); - }, function (seenInSubArray) { - self._operations.push(new Operation(itemType, 1)); - - if (match) { - returnValue = seenInSubArray; - } - - self._composeAt(self._operations.length - 1); - }); - - return returnValue; - }, - - /** - Track that an item was removed from the tracked array. - @method removeItem - @param {Number} index The index of the item in the tracked array. - @return {number} The index of the item in the subarray, or `-1` if the item - was not in the subarray. - @private - */ - removeItem: function (index) { - var returnValue = -1; - var self = this; - - this._findOperation(index, function (operation, operationIndex, rangeStart, rangeEnd, seenInSubArray) { - if (operation.type === RETAIN) { - returnValue = seenInSubArray + (index - rangeStart); - } - - if (operation.count > 1) { - --operation.count; - } else { - self._operations.splice(operationIndex, 1); - self._composeAt(operationIndex); - } - }, function () { - throw new _emberMetalError.default('Can\'t remove an item that has never been added.'); - }); - - return returnValue; - }, - - _findOperation: function (index, foundCallback, notFoundCallback) { - var seenInSubArray = 0; - var operationIndex, len, operation, rangeStart, rangeEnd; - - // OPTIMIZE: change to balanced tree - // find leftmost operation to the right of `index` - for (operationIndex = rangeStart = 0, len = this._operations.length; operationIndex < len; rangeStart = rangeEnd + 1, ++operationIndex) { - operation = this._operations[operationIndex]; - rangeEnd = rangeStart + operation.count - 1; - - if (index >= rangeStart && index <= rangeEnd) { - foundCallback(operation, operationIndex, rangeStart, rangeEnd, seenInSubArray); - return; - } else if (operation.type === RETAIN) { - seenInSubArray += operation.count; - } - } - - notFoundCallback(seenInSubArray); - }, - - _composeAt: function (index) { - var op = this._operations[index]; - var otherOp; - - if (!op) { - // Composing out of bounds is a no-op, as when removing the last operation - // in the list. - return; - } - - if (index > 0) { - otherOp = this._operations[index - 1]; - if (otherOp.type === op.type) { - op.count += otherOp.count; - this._operations.splice(index - 1, 1); - --index; - } - } - - if (index < this._operations.length - 1) { - otherOp = this._operations[index + 1]; - if (otherOp.type === op.type) { - op.count += otherOp.count; - this._operations.splice(index + 1, 1); - } - } - }, - - toString: function () { - var str = ''; - this._operations.forEach(function (operation) { - str += ' ' + operation.type + ':' + operation.count; - }); - return str.substring(1); - } - }; -}); -enifed('ember-runtime/system/tracked_array', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) { - - var RETAIN = 'r'; - var INSERT = 'i'; - var DELETE = 'd'; - - exports.default = TrackedArray; - - /** - An `Ember.TrackedArray` tracks array operations. It's useful when you want to - lazily compute the indexes of items in an array after they've been shifted by - subsequent operations. - - @class TrackedArray - @namespace Ember - @param {Array} [items=[]] The array to be tracked. This is used just to get - the initial items for the starting state of retain:n. - @private - */ - function TrackedArray(items) { - if (arguments.length < 1) { - items = []; - } - - var length = _emberMetalProperty_get.get(items, 'length'); - - if (length) { - this._operations = [new ArrayOperation(RETAIN, length, items)]; - } else { - this._operations = []; - } - } - - TrackedArray.RETAIN = RETAIN; - TrackedArray.INSERT = INSERT; - TrackedArray.DELETE = DELETE; - - TrackedArray.prototype = { - - /** - Track that `newItems` were added to the tracked array at `index`. - @method addItems - @param index - @param newItems - @private - */ - addItems: function (index, newItems) { - var count = _emberMetalProperty_get.get(newItems, 'length'); - if (count < 1) { - return; - } - - var match = this._findArrayOperation(index); - var arrayOperation = match.operation; - var arrayOperationIndex = match.index; - var arrayOperationRangeStart = match.rangeStart; - var composeIndex, newArrayOperation; - - newArrayOperation = new ArrayOperation(INSERT, count, newItems); - - if (arrayOperation) { - if (!match.split) { - // insert left of arrayOperation - this._operations.splice(arrayOperationIndex, 0, newArrayOperation); - composeIndex = arrayOperationIndex; - } else { - this._split(arrayOperationIndex, index - arrayOperationRangeStart, newArrayOperation); - composeIndex = arrayOperationIndex + 1; - } - } else { - // insert at end - this._operations.push(newArrayOperation); - composeIndex = arrayOperationIndex; - } - - this._composeInsert(composeIndex); - }, - - /** - Track that `count` items were removed at `index`. - @method removeItems - @param index - @param count - @private - */ - removeItems: function (index, count) { - if (count < 1) { - return; - } - - var match = this._findArrayOperation(index); - var arrayOperationIndex = match.index; - var arrayOperationRangeStart = match.rangeStart; - var newArrayOperation, composeIndex; - - newArrayOperation = new ArrayOperation(DELETE, count); - if (!match.split) { - // insert left of arrayOperation - this._operations.splice(arrayOperationIndex, 0, newArrayOperation); - composeIndex = arrayOperationIndex; - } else { - this._split(arrayOperationIndex, index - arrayOperationRangeStart, newArrayOperation); - composeIndex = arrayOperationIndex + 1; - } - - return this._composeDelete(composeIndex); - }, - - /** - Apply all operations, reducing them to retain:n, for `n`, the number of - items in the array. - `callback` will be called for each operation and will be passed the following arguments: - * {array} items The items for the given operation - * {number} offset The computed offset of the items, ie the index in the - array of the first item for this operation. - * {string} operation The type of the operation. One of - `Ember.TrackedArray.{RETAIN, DELETE, INSERT}` - @method apply - @param {Function} callback - @private - */ - apply: function (callback) { - var items = []; - var offset = 0; - - this._operations.forEach(function (arrayOperation, operationIndex) { - callback(arrayOperation.items, offset, arrayOperation.type, operationIndex); - - if (arrayOperation.type !== DELETE) { - offset += arrayOperation.count; - items = items.concat(arrayOperation.items); - } - }); - - this._operations = [new ArrayOperation(RETAIN, items.length, items)]; - }, - - /** - Return an `ArrayOperationMatch` for the operation that contains the item at `index`. - @method _findArrayOperation - @param {Number} index the index of the item whose operation information - should be returned. - @private - */ - _findArrayOperation: function (index) { - var split = false; - var arrayOperationIndex, arrayOperation, arrayOperationRangeStart, arrayOperationRangeEnd, len; - - // OPTIMIZE: we could search these faster if we kept a balanced tree. - // find leftmost arrayOperation to the right of `index` - for (arrayOperationIndex = arrayOperationRangeStart = 0, len = this._operations.length; arrayOperationIndex < len; ++arrayOperationIndex) { - arrayOperation = this._operations[arrayOperationIndex]; - - if (arrayOperation.type === DELETE) { - continue; - } - - arrayOperationRangeEnd = arrayOperationRangeStart + arrayOperation.count - 1; - - if (index === arrayOperationRangeStart) { - break; - } else if (index > arrayOperationRangeStart && index <= arrayOperationRangeEnd) { - split = true; - break; - } else { - arrayOperationRangeStart = arrayOperationRangeEnd + 1; - } - } - - return new ArrayOperationMatch(arrayOperation, arrayOperationIndex, split, arrayOperationRangeStart); - }, - - _split: function (arrayOperationIndex, splitIndex, newArrayOperation) { - var arrayOperation = this._operations[arrayOperationIndex]; - var splitItems = arrayOperation.items.slice(splitIndex); - var splitArrayOperation = new ArrayOperation(arrayOperation.type, splitItems.length, splitItems); - - // truncate LHS - arrayOperation.count = splitIndex; - arrayOperation.items = arrayOperation.items.slice(0, splitIndex); - - this._operations.splice(arrayOperationIndex + 1, 0, newArrayOperation, splitArrayOperation); - }, - - // see SubArray for a better implementation. - _composeInsert: function (index) { - var newArrayOperation = this._operations[index]; - var leftArrayOperation = this._operations[index - 1]; // may be undefined - var rightArrayOperation = this._operations[index + 1]; // may be undefined - var leftOp = leftArrayOperation && leftArrayOperation.type; - var rightOp = rightArrayOperation && rightArrayOperation.type; - - if (leftOp === INSERT) { - // merge left - leftArrayOperation.count += newArrayOperation.count; - leftArrayOperation.items = leftArrayOperation.items.concat(newArrayOperation.items); - - if (rightOp === INSERT) { - // also merge right (we have split an insert with an insert) - leftArrayOperation.count += rightArrayOperation.count; - leftArrayOperation.items = leftArrayOperation.items.concat(rightArrayOperation.items); - this._operations.splice(index, 2); - } else { - // only merge left - this._operations.splice(index, 1); - } - } else if (rightOp === INSERT) { - // merge right - newArrayOperation.count += rightArrayOperation.count; - newArrayOperation.items = newArrayOperation.items.concat(rightArrayOperation.items); - this._operations.splice(index + 1, 1); - } - }, - - _composeDelete: function (index) { - var arrayOperation = this._operations[index]; - var deletesToGo = arrayOperation.count; - var leftArrayOperation = this._operations[index - 1]; // may be undefined - var leftOp = leftArrayOperation && leftArrayOperation.type; - var nextArrayOperation; - var nextOp; - var nextCount; - var removeNewAndNextOp = false; - var removedItems = []; - - if (leftOp === DELETE) { - arrayOperation = leftArrayOperation; - index -= 1; - } - - for (var i = index + 1; deletesToGo > 0; ++i) { - nextArrayOperation = this._operations[i]; - nextOp = nextArrayOperation.type; - nextCount = nextArrayOperation.count; - - if (nextOp === DELETE) { - arrayOperation.count += nextCount; - continue; - } - - if (nextCount > deletesToGo) { - // d:2 {r,i}:5 we reduce the retain or insert, but it stays - removedItems = removedItems.concat(nextArrayOperation.items.splice(0, deletesToGo)); - nextArrayOperation.count -= deletesToGo; - - // In the case where we truncate the last arrayOperation, we don't need to - // remove it; also the deletesToGo reduction is not the entirety of - // nextCount - i -= 1; - nextCount = deletesToGo; - - deletesToGo = 0; - } else { - if (nextCount === deletesToGo) { - // Handle edge case of d:2 i:2 in which case both operations go away - // during composition. - removeNewAndNextOp = true; - } - removedItems = removedItems.concat(nextArrayOperation.items); - deletesToGo -= nextCount; - } - - if (nextOp === INSERT) { - // d:2 i:3 will result in delete going away - arrayOperation.count -= nextCount; - } - } - - if (arrayOperation.count > 0) { - // compose our new delete with possibly several operations to the right of - // disparate types - this._operations.splice(index + 1, i - 1 - index); - } else { - // The delete operation can go away; it has merely reduced some other - // operation, as in d:3 i:4; it may also have eliminated that operation, - // as in d:3 i:3. - this._operations.splice(index, removeNewAndNextOp ? 2 : 1); - } - - return removedItems; - }, - - toString: function () { - var str = ''; - this._operations.forEach(function (operation) { - str += ' ' + operation.type + ':' + operation.count; - }); - return str.substring(1); - } - }; - - /** - Internal data structure to represent an array operation. - - @method ArrayOperation - @private - @param {String} operation The type of the operation. One of - `Ember.TrackedArray.{RETAIN, INSERT, DELETE}` - @param {Number} count The number of items in this operation. - @param {Array} items The items of the operation, if included. RETAIN and - INSERT include their items, DELETE does not. - @private - */ - function ArrayOperation(operation, count, items) { - this.type = operation; // RETAIN | INSERT | DELETE - this.count = count; - this.items = items; - } - - /** - Internal data structure used to include information when looking up operations - by item index. - - @method ArrayOperationMatch - @private - @param {ArrayOperation} operation - @param {Number} index The index of `operation` in the array of operations. - @param {Boolean} split Whether or not the item index searched for would - require a split for a new operation type. - @param {Number} rangeStart The index of the first item in the operation, - with respect to the tracked array. The index of the last item can be computed - from `rangeStart` and `operation.count`. - @private - */ - function ArrayOperationMatch(operation, index, split, rangeStart) { - this.operation = operation; - this.index = index; - this.split = split; - this.rangeStart = rangeStart; - } -}); enifed('ember-runtime/utils', ['exports', 'ember-runtime/mixins/array', 'ember-runtime/system/object'], function (exports, _emberRuntimeMixinsArray, _emberRuntimeSystemObject) { + 'use strict'; + exports.isArray = isArray; exports.typeOf = typeOf; // ........................................ // TYPING & ARRAY MESSAGING @@ -35579,10 +34688,11 @@ return ret; } }); enifed('ember-template-compiler', ['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-each-into-collection', 'ember-template-compiler/plugins/deprecate-view-and-controller-paths', 'ember-template-compiler/plugins/deprecate-view-helper', 'ember-template-compiler/compat'], function (exports, _emberMetal, _emberTemplateCompilerSystemPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemTemplate, _emberTemplateCompilerPlugins, _emberTemplateCompilerPluginsTransformOldBindingSyntax, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax, _emberTemplateCompilerPluginsTransformItemClass, _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut, _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly, _emberTemplateCompilerPluginsTransformAngleBracketComponents, _emberTemplateCompilerPluginsTransformInputOnToOnEvent, _emberTemplateCompilerPluginsTransformEachIntoCollection, _emberTemplateCompilerPluginsDeprecateViewAndControllerPaths, _emberTemplateCompilerPluginsDeprecateViewHelper, _emberTemplateCompilerCompat) { + 'use strict'; _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformOldBindingSyntax.default); _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformOldClassBindingSyntax.default); _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformItemClass.default); _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut.default); @@ -35603,18 +34713,24 @@ exports.registerPlugin = _emberTemplateCompilerPlugins.registerPlugin; }); // used for adding Ember.Handlebars.compile for backwards compat enifed('ember-template-compiler/compat', ['exports', 'ember-metal/core', 'ember-template-compiler/compat/precompile', 'ember-template-compiler/system/compile', 'ember-template-compiler/system/template'], function (exports, _emberMetalCore, _emberTemplateCompilerCompatPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemTemplate) { + 'use strict'; var EmberHandlebars = _emberMetalCore.default.Handlebars = _emberMetalCore.default.Handlebars || {}; EmberHandlebars.precompile = _emberTemplateCompilerCompatPrecompile.default; EmberHandlebars.compile = _emberTemplateCompilerSystemCompile.default; EmberHandlebars.template = _emberTemplateCompilerSystemTemplate.default; }); enifed('ember-template-compiler/compat/precompile', ['exports', 'ember-metal/core', 'ember-template-compiler/system/compile_options'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCompile_options) { + /** + @module ember + @submodule ember-template-compiler + */ + 'use strict'; var compile, compileSpec; exports.default = function (string) { if ((!compile || !compileSpec) && _emberMetalCore.default.__loader.registry['htmlbars-compiler/compiler']) { @@ -35632,25 +34748,23 @@ var compileFunc = asObject ? compile : compileSpec; return compileFunc(string, _emberTemplateCompilerSystemCompile_options.default()); }; }); -/** -@module ember -@submodule ember-template-compiler -*/ enifed('ember-template-compiler/plugins', ['exports'], function (exports) { - exports.registerPlugin = registerPlugin; /** @module ember @submodule ember-template-compiler */ /** @private @property helpers */ + 'use strict'; + + exports.registerPlugin = registerPlugin; var plugins = { ast: [] }; /** @@ -35669,10 +34783,11 @@ } exports.default = plugins; }); 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 this.syntax = null; this.options = options || {}; @@ -35743,10 +34858,11 @@ } exports.default = DeprecateViewAndControllerPaths; }); enifed('ember-template-compiler/plugins/deprecate-view-helper', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { + 'use strict'; function DeprecateViewHelper(options) { // set later within HTMLBars to the syntax package this.syntax = null; this.options = options || {}; @@ -35796,10 +34912,12 @@ } exports.default = DeprecateViewHelper; }); enifed('ember-template-compiler/plugins/transform-angle-bracket-components', ['exports'], function (exports) { + 'use strict'; + function TransformAngleBracketComponents() { // set later within HTMLBars to the syntax package this.syntax = null; } @@ -35827,10 +34945,12 @@ } exports.default = TransformAngleBracketComponents; }); 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 this.syntax = null; } @@ -35871,10 +34991,12 @@ } exports.default = TransformComponentAttrsIntoMut; }); enifed('ember-template-compiler/plugins/transform-component-curly-to-readonly', ['exports'], function (exports) { + 'use strict'; + function TransformComponentCurlyToReadonly() { // set later within HTMLBars to the syntax package this.syntax = null; } @@ -35941,10 +35063,12 @@ ``` @class TransformEachInToHash @private */ + 'use strict'; + function TransformEachInToHash(options) { // set later within HTMLBars to the syntax package this.syntax = null; this.options = options || {}; } @@ -35986,10 +35110,12 @@ }; exports.default = TransformEachInToHash; }); enifed('ember-template-compiler/plugins/transform-each-into-collection', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { + 'use strict'; + exports.default = TransformEachIntoCollection; function TransformEachIntoCollection(options) { this.options = options; this.syntax = null; @@ -36048,10 +35174,11 @@ return false; } }); enifed('ember-template-compiler/plugins/transform-input-on-to-onEvent', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { + 'use strict'; /** @module ember @submodule ember-htmlbars */ @@ -36165,10 +35292,12 @@ } exports.default = TransformInputOnToOnEvent; }); enifed('ember-template-compiler/plugins/transform-item-class', ['exports'], function (exports) { + 'use strict'; + exports.default = TransformItemClass; function TransformItemClass() { this.syntax = null; } @@ -36216,10 +35345,12 @@ callback(list[i]); } } }); enifed('ember-template-compiler/plugins/transform-old-binding-syntax', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) { + 'use strict'; + exports.default = TransformOldBindingSyntax; function TransformOldBindingSyntax(options) { this.syntax = null; this.options = options; @@ -36281,10 +35412,12 @@ return expr.original; } } }); enifed('ember-template-compiler/plugins/transform-old-class-binding-syntax', ['exports'], function (exports) { + 'use strict'; + exports.default = TransformOldClassBindingSyntax; function TransformOldClassBindingSyntax(options) { this.syntax = null; this.options = options; @@ -36419,10 +35552,12 @@ return segments; } }); enifed('ember-template-compiler/system/calculate-location-display', ['exports'], function (exports) { + 'use strict'; + exports.default = calculateLocationDisplay; function calculateLocationDisplay(moduleName, _loc) { var loc = _loc || {}; @@ -36450,11 +35585,17 @@ return moduleInfo; } }); enifed('ember-template-compiler/system/compile', ['exports', 'ember-metal/core', 'ember-template-compiler/system/compile_options', 'ember-template-compiler/system/template'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCompile_options, _emberTemplateCompilerSystemTemplate) { + /** + @module ember + @submodule ember-template-compiler + */ + 'use strict'; + var compile; /** Uses HTMLBars `compile` function to process a string into a compiled template. @@ -36478,16 +35619,18 @@ var templateSpec = compile(templateString, _emberTemplateCompilerSystemCompile_options.default(options)); return _emberTemplateCompilerSystemTemplate.default(templateSpec); }; }); -/** -@module ember -@submodule ember-template-compiler -*/ enifed('ember-template-compiler/system/compile_options', ['exports', 'ember-metal/features', 'ember-metal/merge', 'ember-template-compiler/plugins'], function (exports, _emberMetalFeatures, _emberMetalMerge, _emberTemplateCompilerPlugins) { + /** + @module ember + @submodule ember-template-compiler + */ + 'use strict'; + /** @private @property compileOptions */ @@ -36515,24 +35658,25 @@ } options.plugins = plugins; options.buildMeta = function buildMeta(program) { return { - revision: 'Ember@2.0.0-beta.3', + revision: 'Ember@2.0.0-beta.5', loc: program.loc, moduleName: options.moduleName }; }; return options; }; }); -/** -@module ember -@submodule ember-template-compiler -*/ enifed('ember-template-compiler/system/precompile', ['exports', 'ember-metal/core', 'ember-template-compiler/system/compile_options'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCompile_options) { + /** + @module ember + @submodule ember-template-compiler + */ + 'use strict'; var compileSpec; /** Uses HTMLBars `compile` function to process a string into a compiled template string. @@ -36555,15 +35699,12 @@ } return compileSpec(templateString, _emberTemplateCompilerSystemCompile_options.default(options)); }; }); -/** -@module ember -@submodule ember-template-compiler -*/ enifed('ember-template-compiler/system/template', ['exports', 'htmlbars-runtime/hooks'], function (exports, _htmlbarsRuntimeHooks) { + 'use strict'; /** @module ember @submodule ember-template-compiler */ @@ -36587,10 +35728,12 @@ return templateSpec; }; }); enifed('ember-testing', ['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 /** @module ember @submodule ember-testing @@ -36602,10 +35745,11 @@ _emberMetalCore.default.setupForTesting = _emberTestingSetup_for_testing.default; }); // to setup initializer // to handle various edge cases enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { + 'use strict'; function K() { return this; } @@ -36659,10 +35803,11 @@ }); exports.default = Adapter; }); enifed('ember-testing/adapters/qunit', ['exports', 'ember-testing/adapters/adapter', 'ember-metal/utils'], function (exports, _emberTestingAdaptersAdapter, _emberMetalUtils) { + 'use strict'; /** This class implements the methods defined by Ember.Test.Adapter for the QUnit testing framework. @@ -36682,10 +35827,11 @@ ok(false, _emberMetalUtils.inspect(error)); } }); }); enifed('ember-testing/helpers', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/error', 'ember-metal/run_loop', 'ember-views/system/jquery', 'ember-testing/test', 'ember-runtime/ext/rsvp'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalError, _emberMetalRun_loop, _emberViewsSystemJquery, _emberTestingTest, _emberRuntimeExtRsvp) { + 'use strict'; /** @module ember @submodule ember-testing */ @@ -37202,10 +36348,11 @@ element on the DOM to uncheck @return {RSVP.Promise} @private */ enifed('ember-testing/initializers', ['exports', 'ember-runtime/system/lazy_load'], function (exports, _emberRuntimeSystemLazy_load) { + 'use strict'; var name = 'deferReadiness in `testing` mode'; _emberRuntimeSystemLazy_load.onLoad('Ember.Application', function (Application) { if (!Application.initializers[name]) { @@ -37220,10 +36367,12 @@ }); } }); }); enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal/core', 'ember-testing/adapters/qunit', 'ember-views/system/jquery'], function (exports, _emberMetalCore, _emberTestingAdaptersQunit, _emberViewsSystemJquery) { + 'use strict'; + exports.default = setupForTesting; var Test, requests; function incrementAjaxPendingRequests(_, xhr) { @@ -37275,10 +36424,11 @@ } }); // import Test from "ember-testing/test"; // ES6TODO: fix when cycles are supported enifed('ember-testing/support', ['exports', 'ember-metal/core', 'ember-views/system/jquery', 'ember-metal/environment'], function (exports, _emberMetalCore, _emberViewsSystemJquery, _emberMetalEnvironment) { + 'use strict'; /** @module ember @submodule ember-testing */ @@ -37320,16 +36470,17 @@ } }); // Try again to verify that the patch took effect or blow up. testCheckboxClick(function () { - _emberMetalCore.default.warn('clicked checkboxes should be checked! the jQuery patch didn\'t work', this.checked); + _emberMetalCore.default.warn('clicked checkboxes should be checked! the jQuery patch didn\'t work', this.checked, { id: 'ember-testing.test-checkbox-click' }); }); }); } }); enifed('ember-testing/test', ['exports', 'ember-metal/core', 'ember-metal/run_loop', 'ember-runtime/ext/rsvp', 'ember-testing/setup_for_testing', 'ember-application/system/application'], function (exports, _emberMetalCore, _emberMetalRun_loop, _emberRuntimeExtRsvp, _emberTestingSetup_for_testing, _emberApplicationSystemApplication) { + 'use strict'; /** @module ember @submodule ember-testing */ @@ -37702,10 +36853,17 @@ this.helperContainer = helperContainer; } else { this.helperContainer = window; } + this.reopen({ + willDestroy: function () { + this._super.apply(this, arguments); + this.removeTestHelpers(); + } + }); + this.testHelpers = {}; for (var name in helpers) { this.originalMethods[name] = this.helperContainer[name]; this.testHelpers[name] = this.helperContainer[name] = helper(this, name); protoWrap(Test.Promise.prototype, name, helper(this, name), helpers[name].meta.wait); @@ -37731,10 +36889,11 @@ return; } for (var name in helpers) { this.helperContainer[name] = this.originalMethods[name]; + delete Test.Promise.prototype[name]; delete this.testHelpers[name]; delete this.originalMethods[name]; } } }); @@ -37807,12 +36966,19 @@ } } exports.default = Test; }); -enifed('ember-views', ['exports', 'ember-runtime', 'ember-views/system/jquery', 'ember-views/system/utils', 'ember-views/compat/render_buffer', '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/views/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, _emberViewsCompatRender_buffer, _emberViewsSystemExt, _emberViewsViewsStates, _emberMetalViewsRenderer, _emberViewsViewsCore_view, _emberViewsViewsView, _emberViewsViewsContainer_view, _emberViewsViewsCollection_view, _emberViewsViewsComponent, _emberViewsSystemEvent_dispatcher, _emberViewsMixinsView_target_action_support, _emberViewsComponent_lookup, _emberViewsViewsCheckbox, _emberViewsMixinsText_support, _emberViewsViewsText_field, _emberViewsViewsText_area, _emberViewsViewsSelect, _emberViewsCompatMetamorph_view, _emberViewsViewsLegacy_each_view) { +enifed('ember-views', ['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/views/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, _emberViewsViewsComponent, _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 + */ + // BEGIN IMPORTS + 'use strict'; + // END IMPORTS /** Alias for jQuery @@ -37823,11 +36989,10 @@ // BEGIN EXPORTS _emberRuntime.default.$ = _emberViewsSystemJquery.default; _emberRuntime.default.ViewTargetActionSupport = _emberViewsMixinsView_target_action_support.default; - _emberRuntime.default.RenderBuffer = _emberViewsCompatRender_buffer.default; var ViewUtils = _emberRuntime.default.ViewUtils = {}; ViewUtils.isSimpleClick = _emberViewsSystemUtils.isSimpleClick; ViewUtils.getViewClientRects = _emberViewsSystemUtils.getViewClientRects; ViewUtils.getViewBoundingClientRect = _emberViewsSystemUtils.getViewBoundingClientRect; @@ -37836,10 +37001,12 @@ _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.ContainerView = _emberViewsViewsContainer_view.DeprecatedContainerView; + _emberRuntime.default.CollectionView = _emberViewsViewsCollection_view.DeprecatedCollectionView; } _emberRuntime.default._Renderer = _emberMetalViewsRenderer.default; _emberRuntime.default.Checkbox = _emberViewsViewsCheckbox.default; @@ -37853,12 +37020,10 @@ _emberRuntime.default.SelectOption = _emberViewsViewsSelect.SelectOption; _emberRuntime.default.SelectOptgroup = _emberViewsViewsSelect.SelectOptgroup; _emberRuntime.default.TextSupport = _emberViewsMixinsText_support.default; _emberRuntime.default.ComponentLookup = _emberViewsComponent_lookup.default; - _emberRuntime.default.ContainerView = _emberViewsViewsContainer_view.default; - _emberRuntime.default.CollectionView = _emberViewsViewsCollection_view.default; _emberRuntime.default.Component = _emberViewsViewsComponent.default; _emberRuntime.default.EventDispatcher = _emberViewsSystemEvent_dispatcher.default; // Deprecated: if (_emberRuntime.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT) { @@ -37869,18 +37034,14 @@ // END EXPORTS exports.default = _emberRuntime.default; }); -/** -@module ember -@submodule ember-views -*/ - -// BEGIN IMPORTS // for the side effect of extending Ember.run.queues -enifed('ember-views/compat/attrs-proxy', ['exports', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-metal/events', 'ember-metal/utils', 'ember-metal/property_events', 'ember-metal/observer'], function (exports, _emberMetalProperty_get, _emberMetalMixin, _emberMetalEvents, _emberMetalUtils, _emberMetalProperty_events, _emberMetalObserver) { +enifed('ember-views/compat/attrs-proxy', ['exports', 'ember-metal/mixin', 'ember-metal/utils', 'ember-metal/property_events', 'ember-metal/events'], function (exports, _emberMetalMixin, _emberMetalUtils, _emberMetalProperty_events, _emberMetalEvents) { + 'use strict'; + exports.deprecation = deprecation; function deprecation(key) { return 'You tried to look up an attribute directly on the component. This is deprecated. Use attrs.' + key + ' instead.'; } @@ -37890,20 +37051,10 @@ exports.MUTABLE_CELL = MUTABLE_CELL; function isCell(val) { return val && val[MUTABLE_CELL]; } - function attrsWillChange(view, attrsKey) { - var key = attrsKey.slice(6); - view.currentState.legacyAttrWillChange(view, key); - } - - function attrsDidChange(view, attrsKey) { - var key = attrsKey.slice(6); - view.currentState.legacyAttrDidChange(view, key); - } - var AttrsProxyMixin = { attrs: null, getAttr: function (key) { var attrs = this.attrs; @@ -37927,58 +37078,44 @@ } val.update(value); }, - willWatchProperty: function (key) { - if (this._isAngleBracket || key === 'attrs') { - return; + _propagateAttrsToThis: function () { + var attrs = this.attrs; + var values = {}; + for (var prop in attrs) { + if (prop !== 'attrs') { + values[prop] = this.getAttr(prop); + } } - - var attrsKey = 'attrs.' + key; - _emberMetalObserver._addBeforeObserver(this, attrsKey, null, attrsWillChange); - _emberMetalObserver.addObserver(this, attrsKey, null, attrsDidChange); + this.setProperties(values); }, - didUnwatchProperty: function (key) { - if (this._isAngleBracket || key === 'attrs') { - return; - } + initializeShape: _emberMetalEvents.on('init', function () { + this._isDispatchingAttrs = false; + }), - var attrsKey = 'attrs.' + key; - _emberMetalObserver._removeBeforeObserver(this, attrsKey, null, attrsWillChange); - _emberMetalObserver.removeObserver(this, attrsKey, null, attrsDidChange); + didReceiveAttrs: function () { + this._super(); + this._isDispatchingAttrs = true; + this._propagateAttrsToThis(); + this._isDispatchingAttrs = false; }, - legacyDidReceiveAttrs: _emberMetalEvents.on('didReceiveAttrs', function () { - if (this._isAngleBracket) { - return; - } - - var keys = Object.keys(this.attrs); - - for (var i = 0, l = keys.length; i < l; i++) { - // Only issue the deprecation if it wasn't already issued when - // setting attributes initially. - if (!(keys[i] in this)) { - this.notifyPropertyChange(keys[i]); - } - } - }), - unknownProperty: function (key) { if (this._isAngleBracket) { return; } - var attrs = _emberMetalProperty_get.get(this, 'attrs'); + var attrs = this.attrs; if (attrs && key in attrs) { // do not deprecate accessing `this[key]` at this time. // add this back when we have a proper migration path - // Ember.deprecate(deprecation(key)); - var possibleCell = _emberMetalProperty_get.get(attrs, key); + // Ember.deprecate(deprecation(key), { id: 'ember-views.', until: '3.0.0' }); + var possibleCell = attrs.key; if (possibleCell && possibleCell[MUTABLE_CELL]) { return possibleCell.value; } @@ -37993,19 +37130,24 @@ AttrsProxyMixin[_emberMetalProperty_events.PROPERTY_DID_CHANGE] = function (key) { if (this._isAngleBracket) { return; } + if (this._isDispatchingAttrs) { + return; + } if (this.currentState) { this.currentState.legacyPropertyDidChange(this, key); } }; exports.default = _emberMetalMixin.Mixin.create(AttrsProxyMixin); }); enifed('ember-views/compat/metamorph_view', ['exports', 'ember-metal/core', 'ember-views/views/view', 'ember-metal/mixin'], function (exports, _emberMetalCore, _emberViewsViewsView, _emberMetalMixin) { + /*jshint newcap:false*/ + 'use strict'; /** @module ember @submodule ember-views */ @@ -38024,13 +37166,13 @@ instrumentName: 'metamorph', init: function () { this._super.apply(this, arguments); - _emberMetalCore.default.deprecate('Supplying a tagName to Metamorph views is unreliable and is deprecated.' + ' You may be setting the tagName on a Handlebars helper that creates a Metamorph.', !this.tagName); + _emberMetalCore.default.deprecate('Supplying a tagName to Metamorph views is unreliable and is deprecated.' + ' You may be setting the tagName on a Handlebars helper that creates a Metamorph.', !this.tagName, { id: 'ember-views.metamorph-tag-name', until: '2.4.0' }); - _emberMetalCore.default.deprecate('Using ' + this.__metamorphType + ' is deprecated.'); + _emberMetalCore.default.deprecate('Using ' + this.__metamorphType + ' is deprecated.', false, { id: 'ember-views.metamorph', until: '2.4.0' }); } }); exports._Metamorph = _Metamorph; /** @@ -38042,621 +37184,14 @@ */ exports.default = _emberViewsViewsView.default.extend(_Metamorph, { __metamorphType: 'Ember._MetamorphView' }); }); -/*jshint newcap:false*/ // Ember.deprecate -enifed('ember-views/compat/render_buffer', ['exports', 'ember-views/system/jquery', 'ember-metal/core', 'dom-helper/prop', 'ember-views/system/platform'], function (exports, _emberViewsSystemJquery, _emberMetalCore, _domHelperProp, _emberViewsSystemPlatform) { - exports.renderComponentWithBuffer = renderComponentWithBuffer; - exports.default = RenderBuffer; - - // The HTML spec allows for "omitted start tags". These tags are optional - // when their intended child is the first thing in the parent tag. For - // example, this is a tbody start tag: - // - // <table> - // <tbody> - // <tr> - // - // The tbody may be omitted, and the browser will accept and render: - // - // <table> - // <tr> - // - // However, the omitted start tag will still be added to the DOM. Here - // we test the string and context to see if the browser is about to - // perform this cleanup, but with a special allowance for disregarding - // <script tags. This disregarding of <script being the first child item - // may bend the official spec a bit, and is only needed for Handlebars - // templates. - // - // http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#optional-tags - // describes which tags are omittable. The spec for tbody and colgroup - // explains this behavior: - // - // http://www.whatwg.org/specs/web-apps/current-work/multipage/tables.html#the-tbody-element - // http://www.whatwg.org/specs/web-apps/current-work/multipage/tables.html#the-colgroup-element - // - var omittedStartTagChildren; - var omittedStartTagChildTest = /(?:<script)*.*?<([\w:]+)/i; - - function detectOmittedStartTag(dom, string, contextualElement) { - omittedStartTagChildren = omittedStartTagChildren || { - tr: dom.createElement('tbody'), - col: dom.createElement('colgroup') - }; - - // Omitted start tags are only inside table tags. - if (contextualElement.tagName === 'TABLE') { - var omittedStartTagChildMatch = omittedStartTagChildTest.exec(string); - if (omittedStartTagChildMatch) { - // It is already asserted that the contextual element is a table - // and not the proper start tag. Just look up the start tag. - return omittedStartTagChildren[omittedStartTagChildMatch[1].toLowerCase()]; - } - } - } - - function ClassSet() { - this.seen = Object.create(null); - this.list = []; - } - - ClassSet.prototype = { - add: function (string) { - if (this.seen[string] === true) { - return; - } - this.seen[string] = true; - - this.list.push(string); - } - }; - - var BAD_TAG_NAME_TEST_REGEXP = /[^a-zA-Z0-9\-]/; - var BAD_TAG_NAME_REPLACE_REGEXP = /[^a-zA-Z0-9\-]/g; - - function stripTagName(tagName) { - if (!tagName) { - return tagName; - } - - if (!BAD_TAG_NAME_TEST_REGEXP.test(tagName)) { - return tagName; - } - - return tagName.replace(BAD_TAG_NAME_REPLACE_REGEXP, ''); - } - - var BAD_CHARS_REGEXP = /&(?!\w+;)|[<>"'`]/g; - var POSSIBLE_CHARS_REGEXP = /[&<>"'`]/; - - function escapeAttribute(value) { - // Stolen shamelessly from Handlebars - - var escape = { - '<': '&lt;', - '>': '&gt;', - '"': '&quot;', - '\'': '&#x27;', - '`': '&#x60;' - }; - - var escapeChar = function (chr) { - return escape[chr] || '&amp;'; - }; - - var string = value.toString(); - - if (!POSSIBLE_CHARS_REGEXP.test(string)) { - return string; - } - return string.replace(BAD_CHARS_REGEXP, escapeChar); - } - - function renderComponentWithBuffer(component, contextualElement, dom) { - var buffer = []; - component.render(buffer); - var element = dom.parseHTML(buffer.join(''), contextualElement); - return element; - } - - /** - `Ember.RenderBuffer` gathers information regarding the view and generates the - final representation. `Ember.RenderBuffer` will generate HTML which can be pushed - to the DOM. - - ```javascript - var buffer = new Ember.RenderBuffer('div', contextualElement); - ``` - - @class RenderBuffer - @namespace Ember - @deprecated - @private - */ - - function RenderBuffer(domHelper) { - _emberMetalCore.default.deprecate('`Ember.RenderBuffer` is deprecated.'); - this.buffer = null; - this.childViews = []; - this.attrNodes = []; - - _emberMetalCore.default.assert('RenderBuffer requires a DOM helper to be passed to its constructor.', !!domHelper); - - this.dom = domHelper; - - this.tagName = undefined; - this.buffer = null; - this._element = null; - this._outerContextualElement = undefined; - this.elementClasses = null; - this.elementId = null; - this.elementAttributes = null; - this.elementProperties = null; - this.elementTag = null; - this.elementStyle = null; - } - - RenderBuffer.prototype = { - - reset: function (tagName, contextualElement) { - this.tagName = tagName; - this.buffer = null; - this._element = null; - this._outerContextualElement = contextualElement; - this.elementClasses = null; - this.elementId = null; - this.elementAttributes = null; - this.elementProperties = null; - this.elementTag = null; - this.elementStyle = null; - this.childViews.length = 0; - this.attrNodes.length = 0; - }, - - // The root view's element - _element: null, - - // The root view's contextualElement - _outerContextualElement: null, - - /** - An internal set used to de-dupe class names when `addClass()` is - used. After each call to `addClass()`, the `classes` property - will be updated. - @private - @property elementClasses - @type Array - @default null - */ - elementClasses: null, - - /** - Array of class names which will be applied in the class attribute. - You can use `setClasses()` to set this property directly. If you - use `addClass()`, it will be maintained for you. - @property classes - @type Array - @default null - @private - */ - classes: null, - - /** - The id in of the element, to be applied in the id attribute. - You should not set this property yourself, rather, you should use - the `id()` method of `Ember.RenderBuffer`. - @property elementId - @type String - @default null - @private - */ - elementId: null, - - /** - A hash keyed on the name of the attribute and whose value will be - applied to that attribute. For example, if you wanted to apply a - `data-view="Foo.bar"` property to an element, you would set the - elementAttributes hash to `{'data-view':'Foo.bar'}`. - You should not maintain this hash yourself, rather, you should use - the `attr()` method of `Ember.RenderBuffer`. - @property elementAttributes - @type Hash - @default {} - @private - */ - elementAttributes: null, - - /** - A hash keyed on the name of the properties and whose value will be - applied to that property. For example, if you wanted to apply a - `checked=true` property to an element, you would set the - elementProperties hash to `{'checked':true}`. - You should not maintain this hash yourself, rather, you should use - the `prop()` method of `Ember.RenderBuffer`. - @property elementProperties - @type Hash - @default {} - @private - */ - elementProperties: null, - - /** - The tagname of the element an instance of `Ember.RenderBuffer` represents. - Usually, this gets set as the first parameter to `Ember.RenderBuffer`. For - example, if you wanted to create a `p` tag, then you would call - ```javascript - Ember.RenderBuffer('p', contextualElement) - ``` - @property elementTag - @type String - @default null - @private - */ - elementTag: null, - - /** - A hash keyed on the name of the style attribute and whose value will - be applied to that attribute. For example, if you wanted to apply a - `background-color:black;` style to an element, you would set the - elementStyle hash to `{'background-color':'black'}`. - You should not maintain this hash yourself, rather, you should use - the `style()` method of `Ember.RenderBuffer`. - @property elementStyle - @type Hash - @default {} - @private - */ - elementStyle: null, - - pushChildView: function (view) { - var index = this.childViews.length; - this.childViews[index] = view; - this.push('<script id=\'morph-' + index + '\' type=\'text/x-placeholder\'></script>'); - }, - - pushAttrNode: function (node) { - var index = this.attrNodes.length; - this.attrNodes[index] = node; - }, - - hydrateMorphs: function (contextualElement) { - var childViews = this.childViews; - var el = this._element; - for (var i = 0, l = childViews.length; i < l; i++) { - var childView = childViews[i]; - var ref = el.querySelector('#morph-' + i); - - _emberMetalCore.default.assert('An error occurred while setting up template bindings. Please check ' + (childView && childView.parentView && childView._parentView._debugTemplateName ? '"' + childView._parentView._debugTemplateName + '" template ' : '') + 'for invalid markup or bindings within HTML comments.', ref); - - var parent = ref.parentNode; - - childView._morph = this.dom.insertMorphBefore(parent, ref, parent.nodeType === 1 ? parent : contextualElement); - parent.removeChild(ref); - } - }, - - /** - Adds a string of HTML to the `RenderBuffer`. - @method push - @param {String} string HTML to push into the buffer - @chainable - @private - */ - push: function (content) { - if (typeof content === 'string') { - if (this.buffer === null) { - this.buffer = ''; - } - _emberMetalCore.default.assert('A string cannot be pushed into the buffer after a fragment', !this.buffer.nodeType); - this.buffer += content; - } else { - _emberMetalCore.default.assert('A fragment cannot be pushed into a buffer that contains content', !this.buffer); - this.buffer = content; - } - return this; - }, - - /** - Adds a class to the buffer, which will be rendered to the class attribute. - @method addClass - @param {String} className Class name to add to the buffer - @chainable - @private - */ - addClass: function (className) { - // lazily create elementClasses - this.elementClasses = this.elementClasses || new ClassSet(); - this.elementClasses.add(className); - this.classes = this.elementClasses.list; - - return this; - }, - - setClasses: function (classNames) { - this.elementClasses = null; - var len = classNames.length; - var i; - for (i = 0; i < len; i++) { - this.addClass(classNames[i]); - } - }, - - /** - Sets the elementID to be used for the element. - @method id - @param {String} id - @chainable - @private - */ - id: function (id) { - this.elementId = id; - return this; - }, - - // duck type attribute functionality like jQuery so a render buffer - // can be used like a jQuery object in attribute binding scenarios. - - /** - Adds an attribute which will be rendered to the element. - @method attr - @param {String} name The name of the attribute - @param {String} value The value to add to the attribute - @chainable - @return {Ember.RenderBuffer|String} this or the current attribute value - @private - */ - attr: function (name, value) { - var attributes = this.elementAttributes = this.elementAttributes || {}; - - if (arguments.length === 1) { - return attributes[name]; - } else { - attributes[name] = value; - } - - return this; - }, - - /** - Remove an attribute from the list of attributes to render. - @method removeAttr - @param {String} name The name of the attribute - @chainable - @private - */ - removeAttr: function (name) { - var attributes = this.elementAttributes; - if (attributes) { - delete attributes[name]; - } - - return this; - }, - - /** - Adds a property which will be rendered to the element. - @method prop - @param {String} name The name of the property - @param {String} value The value to add to the property - @chainable - @return {Ember.RenderBuffer|String} this or the current property value - @private - */ - prop: function (name, value) { - var properties = this.elementProperties = this.elementProperties || {}; - - if (arguments.length === 1) { - return properties[name]; - } else { - properties[name] = value; - } - - return this; - }, - - /** - Remove an property from the list of properties to render. - @method removeProp - @param {String} name The name of the property - @chainable - @private - */ - removeProp: function (name) { - var properties = this.elementProperties; - if (properties) { - delete properties[name]; - } - - return this; - }, - - /** - Adds a style to the style attribute which will be rendered to the element. - @method style - @param {String} name Name of the style - @param {String} value - @chainable - @private - */ - style: function (name, value) { - this.elementStyle = this.elementStyle || {}; - - this.elementStyle[name] = value; - return this; - }, - - generateElement: function () { - var tagName = this.tagName; - var id = this.elementId; - var classes = this.classes; - var attrs = this.elementAttributes; - var props = this.elementProperties; - var style = this.elementStyle; - var styleBuffer = ''; - var attr, prop, tagString; - - if (!_emberViewsSystemPlatform.canSetNameOnInputs && attrs && attrs.name) { - // IE allows passing a tag to createElement. See note on `canSetNameOnInputs` above as well. - tagString = '<' + stripTagName(tagName) + ' name="' + escapeAttribute(attrs.name) + '">'; - } else { - tagString = tagName; - } - - var element = this.dom.createElement(tagString, this.outerContextualElement()); - - if (id) { - this.dom.setAttribute(element, 'id', id); - this.elementId = null; - } - if (classes) { - this.dom.setAttribute(element, 'class', classes.join(' ')); - this.classes = null; - this.elementClasses = null; - } - - if (style) { - for (prop in style) { - styleBuffer += prop + ':' + style[prop] + ';'; - } - - this.dom.setAttribute(element, 'style', styleBuffer); - - this.elementStyle = null; - } - - if (attrs) { - for (attr in attrs) { - this.dom.setAttribute(element, attr, attrs[attr]); - } - - this.elementAttributes = null; - } - - if (props) { - for (prop in props) { - var _normalizeProperty = _domHelperProp.normalizeProperty(element, prop); - - var normalized = _normalizeProperty.normalized; - - this.dom.setPropertyStrict(element, normalized, props[prop]); - } - - this.elementProperties = null; - } - - return this._element = element; - }, - - /** - @method element - @return {DOMElement} The element corresponding to the generated HTML - of this buffer - @private - */ - element: function () { - - if (this._element && this.attrNodes.length > 0) { - var i, l, attrMorph, attrNode; - for (i = 0, l = this.attrNodes.length; i < l; i++) { - attrNode = this.attrNodes[i]; - attrMorph = this.dom.createAttrMorph(this._element, attrNode.attrName); - attrNode._morph = attrMorph; - } - } - - var content = this.innerContent(); - // No content means a text node buffer, with the content - // in _element. Ember._BoundView is an example. - if (content === null) { - return this._element; - } - - var contextualElement = this.innerContextualElement(content); - this.dom.detectNamespace(contextualElement); - - if (!this._element) { - this._element = this.dom.createDocumentFragment(); - } - - if (content.nodeType) { - this._element.appendChild(content); - } else { - var frag = this.dom.parseHTML(content, contextualElement); - this._element.appendChild(frag); - } - - // This should only happen with legacy string buffers - if (this.childViews.length > 0) { - this.hydrateMorphs(contextualElement); - } - - return this._element; - }, - - /** - Generates the HTML content for this buffer. - @method string - @return {String} The generated HTML - @private - */ - string: function () { - if (this._element) { - // Firefox versions < 11 do not have support for element.outerHTML. - var thisElement = this.element(); - var outerHTML = thisElement.outerHTML; - if (typeof outerHTML === 'undefined') { - return _emberViewsSystemJquery.default('<div/>').append(thisElement).html(); - } - return outerHTML; - } else { - return this.innerString(); - } - }, - - outerContextualElement: function () { - if (this._outerContextualElement === undefined) { - _emberMetalCore.default.deprecate('The render buffer expects an outer contextualElement to exist.' + ' This ensures DOM that requires context is correctly generated (tr, SVG tags).' + ' Defaulting to document.body, but this will be removed in the future'); - this.outerContextualElement = document.body; - } - return this._outerContextualElement; - }, - - innerContextualElement: function (html) { - var innerContextualElement; - if (this._element && this._element.nodeType === 1) { - innerContextualElement = this._element; - } else { - innerContextualElement = this.outerContextualElement(); - } - - var omittedStartTag; - if (html) { - omittedStartTag = detectOmittedStartTag(this.dom, html, innerContextualElement); - } - return omittedStartTag || innerContextualElement; - }, - - innerString: function () { - var content = this.innerContent(); - if (content && !content.nodeType) { - return content; - } - }, - - innerContent: function () { - return this.buffer; - } - }; -}); -/** -@module ember -@submodule ember-views -*/ enifed('ember-views/component_lookup', ['exports', 'ember-metal/core', 'ember-runtime/system/object', 'ember-htmlbars/system/lookup-helper'], function (exports, _emberMetalCore, _emberRuntimeSystemObject, _emberHtmlbarsSystemLookupHelper) { + 'use strict'; + exports.default = _emberRuntimeSystemObject.default.extend({ invalidName: function (name) { if (!_emberHtmlbarsSystemLookupHelper.CONTAINS_DASH_CACHE.get(name)) { _emberMetalCore.default.assert('You cannot use \'' + name + '\' as a component name. Component names must contain a hyphen.'); return true; @@ -38706,11 +37241,17 @@ return container.lookup(templateFullName); } }); }); enifed('ember-views/mixins/aria_role_support', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; + /** @class AriaRoleSupport @namespace Ember @private */ @@ -38730,15 +37271,16 @@ @public */ ariaRole: null }); }); -/** - @module ember - @submodule ember-views -*/ enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal/core', 'ember-metal/mixin', 'ember-runtime/system/native_array'], function (exports, _emberMetalCore, _emberMetalMixin, _emberRuntimeSystemNative_array) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; var EMPTY_ARRAY = []; /** @class ClassNamesSupport @@ -38805,69 +37347,18 @@ @public */ classNameBindings: EMPTY_ARRAY }); }); -/** -@module ember -@submodule ember-views -*/ -enifed('ember-views/mixins/component_template_deprecation', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalMixin) { - - /* - The ComponentTemplateDeprecation mixin is used to provide a useful - deprecation warning when using either `template` or `templateName` with - a component. The `template` and `templateName` properties specified at - extend time are moved to `layout` and `layoutName` respectively. - - This is used internally by Ember in `Ember.Component`. +enifed('ember-views/mixins/empty_view_support', ['exports', 'ember-metal/mixin', 'ember-views/views/view', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/computed'], function (exports, _emberMetalMixin, _emberViewsViewsView, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed) { + /** + @module ember + @submodule ember-views */ - exports.default = _emberMetalMixin.Mixin.create({ - /** - @private - Moves `templateName` to `layoutName` and `template` to `layout` at extend - time if a layout is not also specified. - Note that this currently modifies the mixin themselves, which is technically - dubious but is practically of little consequence. This may change in the - future. - @method willMergeMixin - @since 1.4.0 - */ - willMergeMixin: function (props) { - // must call _super here to ensure that the ActionHandler - // mixin is setup properly (moves actions -> _actions) - // - // Calling super is only OK here since we KNOW that - // there is another Mixin loaded first. - this._super.apply(this, arguments); - var deprecatedProperty, replacementProperty; - var layoutSpecified = props.layoutName || props.layout || _emberMetalProperty_get.get(this, 'layoutName'); + 'use strict'; - if (props.templateName && !layoutSpecified) { - deprecatedProperty = 'templateName'; - replacementProperty = 'layoutName'; - - props.layoutName = props.templateName; - delete props['templateName']; - } - - if (props.template && !layoutSpecified) { - deprecatedProperty = 'template'; - replacementProperty = 'layout'; - - props.layout = props.template; - delete props['template']; - } - - _emberMetalCore.default.deprecate('Do not specify ' + deprecatedProperty + ' on a Component, use ' + replacementProperty + ' instead.', !deprecatedProperty); - } - }); -}); -// Ember.deprecate -enifed('ember-views/mixins/empty_view_support', ['exports', 'ember-metal/mixin', 'ember-views/views/view', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/computed'], function (exports, _emberMetalMixin, _emberViewsViewsView, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed) { - /** @class EmptyViewSupport @namespace Ember @private */ @@ -38916,15 +37407,16 @@ return actualEmpty; }) }); }); -/** - @module ember - @submodule ember-views -*/ enifed('ember-views/mixins/instrumentation_support', ['exports', 'ember-metal/mixin', 'ember-metal/computed', 'ember-metal/property_get'], function (exports, _emberMetalMixin, _emberMetalComputed, _emberMetalProperty_get) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; /** @class InstrumentationSupport @namespace Ember @public @@ -38950,15 +37442,16 @@ } }); exports.default = InstrumentationSupport; }); -/** -@module ember -@submodule ember-views -*/ enifed('ember-views/mixins/legacy_view_support', ['exports', 'ember-metal/core', 'ember-metal/mixin', 'ember-metal/property_get'], function (exports, _emberMetalCore, _emberMetalMixin, _emberMetalProperty_get) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; /** @class LegacyViewSupport @namespace Ember @private @@ -39017,11 +37510,11 @@ @return Ember.View @deprecated @private */ nearestChildOf: function (klass) { - _emberMetalCore.default.deprecate('nearestChildOf has been deprecated.'); + _emberMetalCore.default.deprecate('nearestChildOf has been deprecated.', false, { id: 'ember-views.nearest-child-of', until: '3.0.0' }); var view = _emberMetalProperty_get.get(this, 'parentView'); while (view) { if (_emberMetalProperty_get.get(view, 'parentView') instanceof klass) { @@ -39039,11 +37532,11 @@ @return Ember.View @deprecated @private */ nearestInstanceOf: function (klass) { - _emberMetalCore.default.deprecate('nearestInstanceOf is deprecated and will be removed from future releases. Use nearestOfType.'); + _emberMetalCore.default.deprecate('nearestInstanceOf is deprecated and will be removed from future releases. Use nearestOfType.', false, { id: 'ember-views.nearest-instance-of', until: '3.0.0' }); var view = _emberMetalProperty_get.get(this, 'parentView'); while (view) { if (view instanceof klass) { return view; @@ -39053,16 +37546,18 @@ } }); exports.default = LegacyViewSupport; }); -/** -@module ember -@submodule ember-views -*/ enifed('ember-views/mixins/normalized_rerender_if_needed', ['exports', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-metal/merge', 'ember-views/views/states'], function (exports, _emberMetalProperty_get, _emberMetalMixin, _emberMetalMerge, _emberViewsViewsStates) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; + var states = _emberViewsViewsStates.cloneStates(_emberViewsViewsStates.states); _emberMetalMerge.default(states._default, { rerenderIfNeeded: function () { return this; @@ -39089,15 +37584,16 @@ rerenderIfNeeded: function () { this.currentState.rerenderIfNeeded(this); } }); }); -/** -@module ember -@submodule ember-views -*/ enifed('ember-views/mixins/template_rendering_support', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; // Circular dep var _renderView; /** @@ -39127,16 +37623,18 @@ } }); exports.default = TemplateRenderingSupport; }); -/** -@module ember -@submodule ember-views -*/ enifed('ember-views/mixins/text_support', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/mixin', 'ember-runtime/mixins/target_action_support'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberRuntimeMixinsTarget_action_support) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; + /** `TextSupport` is a shared mixin used by both `Ember.TextField` and `Ember.TextArea`. `TextSupport` adds a number of methods that allow you to specify a controller action to invoke when a certain event is fired on your text field or textarea. The specifed controller action would get the current @@ -39447,15 +37945,16 @@ } } exports.default = TextSupport; }); -/** -@module ember -@submodule ember-views -*/ enifed('ember-views/mixins/view_child_views_support', ['exports', 'ember-metal/core', 'ember-metal/mixin', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/set_properties'], function (exports, _emberMetalCore, _emberMetalMixin, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalSet_properties) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; var EMPTY_ARRAY = []; exports.default = _emberMetalMixin.Mixin.create({ /** @@ -39585,15 +38084,16 @@ _emberMetalProperty_set.set(instance, 'parentView', null); instance.trigger('parentViewDidChange'); } }); }); -/** -@module ember -@submodule ember-views -*/ enifed('ember-views/mixins/view_context_support', ['exports', 'ember-metal/mixin', 'ember-metal/computed', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-views/mixins/legacy_view_support', 'ember-metal/events'], function (exports, _emberMetalMixin, _emberMetalComputed, _emberMetalProperty_get, _emberMetalProperty_set, _emberViewsMixinsLegacy_view_support, _emberMetalEvents) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; var ViewContextSupport = _emberMetalMixin.Mixin.create(_emberViewsMixinsLegacy_view_support.default, { /** The object from which templates should access properties. This object will be passed to the template function each time the render @@ -39681,19 +38181,16 @@ }) }); exports.default = ViewContextSupport; }); -/** -@module ember -@submodule ember-views -*/ enifed('ember-views/mixins/view_state_support', ['exports', 'ember-metal/core', 'ember-metal/mixin'], function (exports, _emberMetalCore, _emberMetalMixin) { + 'use strict'; var ViewStateSupport = _emberMetalMixin.Mixin.create({ transitionTo: function (state) { - _emberMetalCore.default.deprecate('Ember.View#transitionTo has been deprecated, it is for internal use only'); + _emberMetalCore.default.deprecate('Ember.View#transitionTo has been deprecated, it is for internal use only', false, { id: 'ember-views.view-transition-to', until: '2.4.0' }); this._transitionTo(state); }, _transitionTo: function (state) { var priorState = this.currentState; @@ -39710,10 +38207,11 @@ }); exports.default = ViewStateSupport; }); enifed('ember-views/mixins/view_target_action_support', ['exports', 'ember-metal/mixin', 'ember-runtime/mixins/target_action_support', 'ember-metal/alias'], function (exports, _emberMetalMixin, _emberRuntimeMixinsTarget_action_support, _emberMetalAlias) { + 'use strict'; /** `Ember.ViewTargetActionSupport` is a mixin that can be included in a view class to add a `triggerAction` method with semantics similar to the Handlebars `{{action}}` helper. It provides intelligent defaults @@ -39767,10 +38265,15 @@ */ actionContext: _emberMetalAlias.default('context') }); }); enifed('ember-views/mixins/visibility_support', ['exports', 'ember-metal/mixin', 'ember-metal/property_get', 'ember-metal/run_loop'], function (exports, _emberMetalMixin, _emberMetalProperty_get, _emberMetalRun_loop) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; function K() { return this; } @@ -39872,15 +38375,13 @@ } }); exports.default = VisibilitySupport; }); -/** - @module ember - @submodule ember-views -*/ enifed('ember-views/streams/class_name_binding', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/utils', 'ember-metal/streams/utils', 'ember-runtime/system/string'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalUtils, _emberMetalStreamsUtils, _emberRuntimeSystemString) { + 'use strict'; + exports.parsePropertyPath = parsePropertyPath; exports.classStringForValue = classStringForValue; exports.streamifyClassNameBinding = streamifyClassNameBinding; /** @@ -39972,26 +38473,26 @@ } // If value is a Boolean and true, return the dasherized property // name. } else if (val === true) { - // Normalize property path to be suitable for use - // as a class name. For exaple, content.foo.barBaz - // becomes bar-baz. - var parts = path.split('.'); - return _emberRuntimeSystemString.dasherize(parts[parts.length - 1]); + // Normalize property path to be suitable for use + // as a class name. For exaple, content.foo.barBaz + // becomes bar-baz. + var parts = path.split('.'); + return _emberRuntimeSystemString.dasherize(parts[parts.length - 1]); - // If the value is not false, undefined, or null, return the current - // value of the property. - } else if (val !== false && val != null) { - return val; + // If the value is not false, undefined, or null, return the current + // value of the property. + } else if (val !== false && val != null) { + return val; - // Nothing to display. Return null so that the old class is removed - // but no new class is added. - } else { - return null; - } + // Nothing to display. Return null so that the old class is removed + // but no new class is added. + } else { + return null; + } } function streamifyClassNameBinding(view, classNameBinding, prefix) { prefix = prefix || ''; _emberMetalCore.default.assert('classNameBindings must not have spaces in them. Multiple class name bindings can be provided as elements of an array, e.g. [\'foo\', \':bar\']', classNameBinding.indexOf(' ') === -1); @@ -40005,10 +38506,12 @@ }); } } }); enifed('ember-views/streams/should_display', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/property_get', 'ember-runtime/utils', 'ember-metal/streams/stream', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalProperty_get, _emberRuntimeUtils, _emberMetalStreamsStream, _emberMetalStreamsUtils) { + 'use strict'; + exports.default = shouldDisplay; function shouldDisplay(predicate) { if (_emberMetalStreamsUtils.isStream(predicate)) { return new ShouldDisplayStream(predicate); @@ -40077,11 +38580,13 @@ } } } }); }); -enifed('ember-views/streams/utils', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-runtime/system/string', 'ember-metal/streams/utils', 'ember-runtime/mixins/controller'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeSystemString, _emberMetalStreamsUtils, _emberRuntimeMixinsController) { +enifed('ember-views/streams/utils', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/streams/utils', 'ember-runtime/mixins/controller'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalStreamsUtils, _emberRuntimeMixinsController) { + 'use strict'; + exports.readViewFactory = readViewFactory; exports.readComponentFactory = readComponentFactory; exports.readUnwrappedModel = readUnwrappedModel; function readViewFactory(object, container) { @@ -40093,11 +38598,11 @@ viewClass = container.lookupFactory('view:' + value); } else { viewClass = value; } - _emberMetalCore.default.assert(_emberRuntimeSystemString.fmt(value + ' must be a subclass or an instance of Ember.View, not %@', [viewClass]), (function (viewClass) { + _emberMetalCore.default.assert(value + ' must be a subclass or an instance of Ember.View, not ' + viewClass, (function (viewClass) { return viewClass && (viewClass.isViewFactory || viewClass.isView || viewClass.isComponentFactory || viewClass.isComponent); })(viewClass)); return viewClass; } @@ -40131,10 +38636,12 @@ /** @module ember @submodule ember-views */ + "use strict"; + function ActionManager() {} /** Global action id hash. @@ -40145,10 +38652,12 @@ ActionManager.registeredActions = {}; exports.default = ActionManager; }); enifed('ember-views/system/build-component-template', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/path_cache', 'htmlbars-runtime', 'ember-htmlbars/hooks/get-value'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalPath_cache, _htmlbarsRuntime, _emberHtmlbarsHooksGetValue) { + 'use strict'; + exports.default = buildComponentTemplate; function buildComponentTemplate(_ref, attrs, content) { var component = _ref.component; var layout = _ref.layout; @@ -40249,11 +38758,11 @@ function tagNameFor(view) { var tagName = view.tagName; if (tagName !== null && typeof tagName === 'object' && tagName.isDescriptor) { tagName = _emberMetalProperty_get.get(view, 'tagName'); - _emberMetalCore.default.deprecate('In the future using a computed property to define tagName will not be permitted. That value will be respected, but changing it will not update the element.', !tagName); + _emberMetalCore.default.deprecate('In the future using a computed property to define tagName will not be permitted. That value will be respected, but changing it will not update the element.', !tagName, { id: 'ember-views.computed-tag-name', until: '2.0.0' }); } if (tagName === null || tagName === undefined) { tagName = view._defaultTagName || 'div'; } @@ -40266,10 +38775,18 @@ function normalizeComponentAttributes(component, isAngleBracket, attrs) { var normalized = {}; var attributeBindings = component.attributeBindings; var i, l; + if (attrs.id && _emberHtmlbarsHooksGetValue.default(attrs.id)) { + // Do not allow binding to the `id` + normalized.id = _emberHtmlbarsHooksGetValue.default(attrs.id); + component.elementId = normalized.id; + } else { + normalized.id = component.elementId; + } + if (attributeBindings) { for (i = 0, l = attributeBindings.length; i < l; i++) { var attr = attributeBindings[i]; var colonIndex = attr.indexOf(':'); @@ -40307,18 +38824,10 @@ normalized[prop] = ['value', val]; } } } - if (attrs.id && _emberHtmlbarsHooksGetValue.default(attrs.id)) { - // Do not allow binding to the `id` - normalized.id = _emberHtmlbarsHooksGetValue.default(attrs.id); - component.elementId = normalized.id; - } else { - normalized.id = component.elementId; - } - if (attrs.tagName) { component.tagName = attrs.tagName; } var normalizedClass = normalizeClass(component, attrs); @@ -40413,11 +38922,16 @@ var classNameBindings = component.classNameBindings; return !classNameBindings || classNameBindings.length === 0; }); } }); -enifed('ember-views/system/event_dispatcher', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/is_none', 'ember-metal/run_loop', 'ember-runtime/system/string', 'ember-runtime/system/object', 'ember-views/system/jquery', 'ember-views/system/action_manager', 'ember-views/views/view', 'ember-metal/merge'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalIs_none, _emberMetalRun_loop, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberViewsSystemJquery, _emberViewsSystemAction_manager, _emberViewsViewsView, _emberMetalMerge) { +enifed('ember-views/system/event_dispatcher', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/is_none', 'ember-metal/run_loop', 'ember-runtime/system/object', 'ember-views/system/jquery', 'ember-views/system/action_manager', 'ember-views/views/view', 'ember-metal/merge'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalIs_none, _emberMetalRun_loop, _emberRuntimeSystemObject, _emberViewsSystemJquery, _emberViewsSystemAction_manager, _emberViewsViewsView, _emberMetalMerge) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; /** `Ember.EventDispatcher` handles delegating browser events to their corresponding `Ember.Views.` For example, when you click on a view, `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets @@ -40530,11 +39044,11 @@ _emberMetalProperty_set.set(this, 'rootElement', rootElement); } rootElement = _emberViewsSystemJquery.default(_emberMetalProperty_get.get(this, 'rootElement')); - _emberMetalCore.default.assert(_emberRuntimeSystemString.fmt('You cannot use the same root element (%@) multiple times in an Ember.Application', [rootElement.selector || rootElement[0].tagName]), !rootElement.is('.ember-application')); + _emberMetalCore.default.assert('You cannot use the same root element (' + (rootElement.selector || rootElement[0].tagName) + ') multiple times in an Ember.Application', !rootElement.is('.ember-application')); _emberMetalCore.default.assert('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', !rootElement.closest('.ember-application').length); _emberMetalCore.default.assert('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.find('.ember-application').length); rootElement.addClass('ember-application'); @@ -40642,28 +39156,27 @@ toString: function () { return '(EventDispatcher)'; } }); }); -/** -@module ember -@submodule ember-views -*/ // Ember.assert enifed('ember-views/system/ext', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; + // Add a new named queue for rendering views that happens // after bindings have synced, and a queue for scheduling actions // that that should occur after view rendering. _emberMetalRun_loop.default._addQueue('render', 'actions'); _emberMetalRun_loop.default._addQueue('afterRender', 'render'); }); -/** -@module ember -@submodule ember-views -*/ enifed('ember-views/system/jquery', ['exports', 'ember-metal/core', 'ember-metal/environment'], function (exports, _emberMetalCore, _emberMetalEnvironment) { + 'use strict'; var jQuery; if (_emberMetalEnvironment.default.hasDOM) { // mainContext is set in `package/loader/lib/main.js` to the `this` context before entering strict mode @@ -40692,10 +39205,12 @@ }); // Ember.assert // ES6TODO: the functions on EnumerableUtils need their own exports enifed('ember-views/system/lookup_partial', ['exports', 'ember-metal/core', 'ember-metal/error'], function (exports, _emberMetalCore, _emberMetalError) { + 'use strict'; + exports.default = lookupPartial; function lookupPartial(env, templateName) { if (templateName == null) { return; @@ -40727,10 +39242,11 @@ return env.container.lookup('template:' + underscored) || env.container.lookup('template:' + name); } }); // Ember.assert enifed('ember-views/system/platform', ['exports', 'ember-metal/environment'], function (exports, _emberMetalEnvironment) { + 'use strict'; // IE 6/7 have bugs around setting names on inputs during creation. // From http://msdn.microsoft.com/en-us/library/ie/ms536389(v=vs.85).aspx: // "To include the NAME attribute at run time on objects created with the createElement method, use the eTag." var canSetNameOnInputs = _emberMetalEnvironment.default.hasDOM && (function () { @@ -40743,18 +39259,21 @@ return !!div.innerHTML.match('foo'); })(); exports.canSetNameOnInputs = canSetNameOnInputs; }); enifed("ember-views/system/utils", ["exports"], function (exports) { - exports.isSimpleClick = isSimpleClick; - exports.getViewClientRects = getViewClientRects; - exports.getViewBoundingClientRect = getViewBoundingClientRect; /** @module ember @submodule ember-views */ + "use strict"; + + exports.isSimpleClick = isSimpleClick; + exports.getViewClientRects = getViewClientRects; + exports.getViewBoundingClientRect = getViewBoundingClientRect; + function isSimpleClick(event) { var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey; var secondaryClick = event.which > 1; // IE9 may return undefined return !modifier && !secondaryClick; @@ -40805,10 +39324,11 @@ var range = getViewRange(view); return range.getBoundingClientRect(); } }); enifed('ember-views/views/checkbox', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-views/views/component'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberViewsViewsComponent) { + 'use strict'; /** @module ember @submodule ember-views */ @@ -40865,12 +39385,18 @@ _updateElementValue: function () { _emberMetalProperty_set.set(this, 'checked', this.$().prop('checked')); } }); }); -enifed('ember-views/views/collection_view', ['exports', 'ember-metal/core', 'ember-views/views/container_view', 'ember-views/views/view', 'ember-runtime/mixins/array', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-runtime/system/string', 'ember-metal/computed', 'ember-metal/mixin', 'ember-views/streams/utils', 'ember-views/mixins/empty_view_support'], function (exports, _emberMetalCore, _emberViewsViewsContainer_view, _emberViewsViewsView, _emberRuntimeMixinsArray, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemString, _emberMetalComputed, _emberMetalMixin, _emberViewsStreamsUtils, _emberViewsMixinsEmpty_view_support) { +enifed('ember-views/views/collection_view', ['exports', 'ember-metal/core', 'ember-views/views/container_view', 'ember-views/views/view', 'ember-runtime/mixins/array', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/computed', 'ember-metal/mixin', 'ember-views/streams/utils', 'ember-views/mixins/empty_view_support'], function (exports, _emberMetalCore, _emberViewsViewsContainer_view, _emberViewsViewsView, _emberRuntimeMixinsArray, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberMetalMixin, _emberViewsStreamsUtils, _emberViewsMixinsEmpty_view_support) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; + /** `Ember.CollectionView` is an `Ember.View` descendent responsible for managing a collection (an array or array-like object) by maintaining a child view object and associated DOM representation for each item in the array and ensuring that child views and their associated rendered HTML are updated when items in @@ -41104,11 +39630,11 @@ Ensure that the content implements Ember.Array @private @method _assertArrayLike */ _assertArrayLike: function (content) { - _emberMetalCore.default.assert(_emberRuntimeSystemString.fmt('an Ember.CollectionView\'s content must implement Ember.Array. You passed %@', [content]), _emberRuntimeMixinsArray.default.detect(content)); + _emberMetalCore.default.assert('an Ember.CollectionView\'s content must implement Ember.Array. You passed ' + content, _emberRuntimeMixinsArray.default.detect(content)); }, /** Removes the content and content observers. @method destroy @@ -41292,19 +39818,39 @@ } return props; } + function viewDeprecationMessage() { + _emberMetalCore.default.deprecate('Ember.CollectionView is deprecated. Consult the Deprecations Guide for a migration strategy.', !!_emberMetalCore.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT, { + url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-collectionview', + id: 'ember-views.collection-view-deprecated', + until: '2.4.0' + }); + } + + var DeprecatedCollectionView = CollectionView.extend({ + init: function () { + viewDeprecationMessage(); + this._super.apply(this, arguments); + } + }); + + DeprecatedCollectionView.reopen = function () { + viewDeprecationMessage(); + CollectionView.reopen.apply(CollectionView, arguments); + return this; + }; + + DeprecatedCollectionView.CONTAINER_MAP = CONTAINER_MAP; + exports.default = CollectionView; + exports.DeprecatedCollectionView = DeprecatedCollectionView; }); -/** -@module ember -@submodule ember-views -*/ - // Ember.assert -enifed('ember-views/views/component', ['exports', 'ember-metal/core', 'ember-views/mixins/component_template_deprecation', 'ember-runtime/mixins/target_action_support', 'ember-views/views/view', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/is_none', 'ember-metal/computed', 'ember-views/compat/attrs-proxy'], function (exports, _emberMetalCore, _emberViewsMixinsComponent_template_deprecation, _emberRuntimeMixinsTarget_action_support, _emberViewsViewsView, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalIs_none, _emberMetalComputed, _emberViewsCompatAttrsProxy) { +enifed('ember-views/views/component', ['exports', 'ember-metal/core', 'ember-runtime/mixins/target_action_support', 'ember-views/views/view', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/is_none', 'ember-metal/computed', 'ember-views/compat/attrs-proxy'], function (exports, _emberMetalCore, _emberRuntimeMixinsTarget_action_support, _emberViewsViewsView, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalIs_none, _emberMetalComputed, _emberViewsCompatAttrsProxy) { + 'use strict'; function validateAction(component, actionName) { if (actionName && actionName[_emberViewsCompatAttrsProxy.MUTABLE_CELL]) { actionName = actionName.value; } @@ -41401,11 +39947,11 @@ @class Component @namespace Ember @extends Ember.View @public */ - var Component = _emberViewsViewsView.default.extend(_emberRuntimeMixinsTarget_action_support.default, _emberViewsMixinsComponent_template_deprecation.default, { + var Component = _emberViewsViewsView.default.extend(_emberRuntimeMixinsTarget_action_support.default, { isComponent: true, /* This is set so that the proto inspection in appendTemplatedView does not think that it should set the components `context` to that of the parent view. */ @@ -41423,64 +39969,13 @@ this._super.apply(this, arguments); _emberMetalProperty_set.set(this, 'controller', this); _emberMetalProperty_set.set(this, 'context', this); }, - /** - A components template property is set by passing a block - during its invocation. It is executed within the parent context. - Example: - ```handlebars - {{#my-component}} - // something that is run in the context - // of the parent context - {{/my-component}} - ``` - Specifying a template directly to a component is deprecated without - also specifying the layout property. - @deprecated - @property template - @public - */ - template: _emberMetalComputed.computed('_template', { - get: function () { - _emberMetalCore.default.deprecate('Accessing \'template\' in ' + this + ' is deprecated. To determine if a block was specified to ' + this + ' please use \'{{#if hasBlock}}\' in the components layout.'); + template: null, - return _emberMetalProperty_get.get(this, '_template'); - }, - - set: function (key, value) { - return _emberMetalProperty_set.set(this, '_template', value); - } - }), - - _template: _emberMetalComputed.computed('templateName', { - get: function () { - if (_emberMetalProperty_get.get(this, '_deprecatedFlagForBlockProvided')) { - return true; - } - var templateName = _emberMetalProperty_get.get(this, 'templateName'); - var template = this.templateForName(templateName, 'template'); - - _emberMetalCore.default.assert('You specified the templateName ' + templateName + ' for ' + this + ', but it did not exist.', !templateName || !!template); - return template || _emberMetalProperty_get.get(this, 'defaultTemplate'); - }, - set: function (key, value) { - return value; - } - }), - /** - Specifying a components `templateName` is deprecated without also - providing the `layout` or `layoutName` properties. - @deprecated - @property templateName - @public - */ - templateName: null, - - /** If the component is currently inserted into the DOM of a parent view, this property will point to the controller of the parent view. @property targetObject @type Ember.Controller @default null @@ -41565,10 +40060,14 @@ @param [action] {String} the action to call @param [params] {*} arguments for the action @public */ sendAction: function (action) { + for (var _len = arguments.length, contexts = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + contexts[_key - 1] = arguments[_key]; + } + var actionName; // Send the default action if (action === undefined) { action = 'action'; @@ -41579,14 +40078,10 @@ // If no action name for that action could be found, just abort. if (actionName === undefined) { return; } - for (var _len = arguments.length, contexts = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - contexts[_key - 1] = arguments[_key]; - } - if (typeof actionName === 'function') { actionName.apply(null, contexts); } else { this.triggerAction({ action: actionName, @@ -41599,22 +40094,24 @@ for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } var target; - var hasAction = this._actions && this._actions[actionName]; + var hasAction = this.actions && this.actions[actionName]; if (hasAction) { - var shouldBubble = this._actions[actionName].apply(this, args) === true; + var shouldBubble = this.actions[actionName].apply(this, args) === true; if (!shouldBubble) { return; } } if (target = _emberMetalProperty_get.get(this, 'target')) { + var _target; + _emberMetalCore.default.assert('The `target` for ' + this + ' (' + target + ') does not have a `send` method', typeof target.send === 'function'); - target.send.apply(target, arguments); + (_target = target).send.apply(_target, arguments); } else { if (!hasAction) { throw new Error(_emberMetalCore.default.inspect(this) + ' had no action handler for: ' + actionName); } } @@ -41687,12 +40184,14 @@ exports.default = Component; }); // Ember.assert, Ember.Handlebars enifed('ember-views/views/container_view', ['exports', 'ember-metal/core', 'ember-runtime/mixins/mutable_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, _emberRuntimeMixinsMutable_array, _emberViewsViewsView, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberMetalEvents, _emberHtmlbarsTemplatesContainerView) { - _emberHtmlbarsTemplatesContainerView.default.meta.revision = 'Ember@2.0.0-beta.3'; + 'use strict'; + _emberHtmlbarsTemplatesContainerView.default.meta.revision = 'Ember@2.0.0-beta.5'; + /** @module ember @submodule ember-views */ @@ -41843,24 +40342,25 @@ representation will only be the rendered HTML of its child views. @class ContainerView @namespace Ember @extends Ember.View + @deprecated See http://emberjs.com/deprecations/v1.x/#toc_ember-containerview @private */ var ContainerView = _emberViewsViewsView.default.extend(_emberRuntimeMixinsMutable_array.default, { willWatchProperty: function (prop) { - _emberMetalCore.default.deprecate('ContainerViews should not be observed as arrays. This behavior will change in future implementations of ContainerView.', !prop.match(/\[]/) && prop.indexOf('@') !== 0); + _emberMetalCore.default.deprecate('ContainerViews should not be observed as arrays. This behavior will change in future implementations of ContainerView.', !prop.match(/\[]/) && prop.indexOf('@') !== 0, { id: 'ember-views.container-views-array-observed', until: '2.4.0' }); }, init: function () { var _this = this; this._super.apply(this, arguments); var userChildViews = _emberMetalProperty_get.get(this, 'childViews'); - _emberMetalCore.default.deprecate('Setting `childViews` on a Container is deprecated.', _emberMetalCore.default.isEmpty(userChildViews)); + _emberMetalCore.default.deprecate('Setting `childViews` on a Container is deprecated.', _emberMetalCore.default.isEmpty(userChildViews), { id: 'ember-views.container-child-views', until: '2.4.0' }); // redefine view's childViews property that was obliterated // 2.0TODO: Don't Ember.A() this so users disabling prototype extensions // don't pay a penalty. var childViews = this.childViews = _emberMetalCore.default.A([]); @@ -41989,13 +40489,36 @@ } } }) }); + function containerViewDeprecationMessage() { + _emberMetalCore.default.deprecate('Ember.ContainerView is deprecated.', !!_emberMetalCore.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT, { + url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-containerview', + id: 'ember-views.container-view', + until: '2.4.0' + }); + } + + var DeprecatedContainerView = ContainerView.extend({ + init: function () { + containerViewDeprecationMessage(); + this._super.apply(this, arguments); + } + }); + + exports.DeprecatedContainerView = DeprecatedContainerView; + DeprecatedContainerView.reopen = function () { + containerViewDeprecationMessage(); + ContainerView.reopen.apply(ContainerView, arguments); + return this; + }; + exports.default = ContainerView; }); enifed('ember-views/views/core_view', ['exports', 'ember-metal/core', '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'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented, _emberRuntimeMixinsAction_handler, _emberRuntimeUtils, _emberMetalViewsRenderer, _emberViewsViewsStates, _htmlbarsRuntime) { + 'use strict'; function K() { return this; } @@ -42114,17 +40637,19 @@ clearRenderedChildren: K, _transitionTo: K, destroyElement: K }); + _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions(CoreView); + CoreView.reopenClass({ isViewFactory: true }); var DeprecatedCoreView = CoreView.extend({ init: function () { - _emberMetalCore.default.deprecate('Ember.CoreView is deprecated. Please use Ember.View.', false); + _emberMetalCore.default.deprecate('Ember.CoreView is deprecated. Please use Ember.View.', false, { id: 'ember-views.core-view', until: '2.4.0' }); this._super.apply(this, arguments); } }); exports.DeprecatedCoreView = DeprecatedCoreView; @@ -42134,10 +40659,16 @@ } exports.default = CoreView; }); enifed('ember-views/views/legacy_each_view', ['exports', 'ember-htmlbars/templates/legacy-each', 'ember-metal/property_get', 'ember-metal/computed', 'ember-views/views/view', 'ember-views/views/collection_view', 'ember-views/mixins/empty_view_support'], function (exports, _emberHtmlbarsTemplatesLegacyEach, _emberMetalProperty_get, _emberMetalComputed, _emberViewsViewsView, _emberViewsViewsCollection_view, _emberViewsMixinsEmpty_view_support) { + //2.0TODO: Remove this in 2.0 + //This is a fallback path for the `{{#each}}` helper that supports deprecated + //behavior such as itemController. + + 'use strict'; + exports.default = _emberViewsViewsView.default.extend(_emberViewsMixinsEmpty_view_support.default, { template: _emberHtmlbarsTemplatesLegacyEach.default, tagName: '', /* @@ -42152,15 +40683,18 @@ var tagName = _emberMetalProperty_get.get(this, 'tagName'); return _emberViewsViewsCollection_view.CONTAINER_MAP[tagName]; }) }); }); -//2.0TODO: Remove this in 2.0 -//This is a fallback path for the `{{#each}}` helper that supports deprecated -//behavior such as itemController. enifed('ember-views/views/select', ['exports', 'ember-metal/core', 'ember-metal/replace', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-views/views/view', 'ember-runtime/utils', 'ember-metal/is_none', 'ember-metal/computed', 'ember-runtime/system/native_array', 'ember-metal/mixin', 'ember-metal/properties', 'ember-htmlbars/templates/select', 'ember-htmlbars/templates/select-option', 'ember-htmlbars/templates/select-optgroup'], function (exports, _emberMetalCore, _emberMetalReplace, _emberMetalProperty_get, _emberMetalProperty_set, _emberViewsViewsView, _emberRuntimeUtils, _emberMetalIs_none, _emberMetalComputed, _emberRuntimeSystemNative_array, _emberMetalMixin, _emberMetalProperties, _emberHtmlbarsTemplatesSelect, _emberHtmlbarsTemplatesSelectOption, _emberHtmlbarsTemplatesSelectOptgroup) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; + var defaultTemplate = _emberHtmlbarsTemplatesSelect.default; var SelectOption = _emberViewsViewsView.default.extend({ instrumentDisplay: 'Ember.SelectOption', @@ -42586,11 +41120,11 @@ @default Ember.SelectOptgroup @public */ groupView: SelectOptgroup, - groupedContent: _emberMetalComputed.computed('optionGroupPath', 'content.@each', function () { + groupedContent: _emberMetalComputed.computed('optionGroupPath', 'content.[]', function () { var groupPath = _emberMetalProperty_get.get(this, 'optionGroupPath'); var groupedContent = _emberRuntimeSystemNative_array.A(); var content = _emberMetalProperty_get.get(this, 'content') || []; content.forEach(function (item) { @@ -42624,11 +41158,11 @@ } else { this._changeSingle(hasDOM); } }, - selectionDidChange: _emberMetalMixin.observer('selection.@each', function () { + selectionDidChange: _emberMetalMixin.observer('selection.[]', function () { var selection = _emberMetalProperty_get.get(this, 'selection'); if (_emberMetalProperty_get.get(this, 'multiple')) { if (!_emberRuntimeUtils.isArray(selection)) { _emberMetalProperty_set.set(this, 'selection', _emberRuntimeSystemNative_array.A([selection])); return; @@ -42800,17 +41334,31 @@ this._super.apply(this, arguments); this.on('change', this, this._change); } }); + function selectViewDeprecationMessage() { + _emberMetalCore.default.deprecate('Ember.Select is deprecated. Consult the Deprecations Guide for a migration strategy.', !!_emberMetalCore.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT, { + url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-select', + id: 'ember-views.select-deprecated', + until: '2.4.0' + }); + } + var DeprecatedSelect = Select.extend({ init: function () { + selectViewDeprecationMessage(); this._super.apply(this, arguments); - _emberMetalCore.default.deprecate('Ember.Select is deprecated. Consult the Deprecations Guide for a migration strategy.', !!_emberMetalCore.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT, { url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-select' }); } }); + DeprecatedSelect.reopen = function () { + selectViewDeprecationMessage(); + Select.reopen.apply(Select, arguments); + return this; + }; + function indexesOf(iterable, elements) { return elements === undefined ? [] : elements.map(function (item) { return iterable.indexOf(item); }); } @@ -42819,15 +41367,13 @@ exports.Select = Select; exports.DeprecatedSelect = DeprecatedSelect; exports.SelectOption = SelectOption; exports.SelectOptgroup = SelectOptgroup; }); -/** -@module ember -@submodule ember-views -*/ enifed('ember-views/views/states', ['exports', 'ember-metal/merge', 'ember-views/views/states/default', 'ember-views/views/states/pre_render', 'ember-views/views/states/has_element', 'ember-views/views/states/in_dom', 'ember-views/views/states/destroying'], function (exports, _emberMetalMerge, _emberViewsViewsStatesDefault, _emberViewsViewsStatesPre_render, _emberViewsViewsStatesHas_element, _emberViewsViewsStatesIn_dom, _emberViewsViewsStatesDestroying) { + 'use strict'; + exports.cloneStates = cloneStates; function cloneStates(from) { var into = {}; @@ -42854,11 +41400,12 @@ hasElement: _emberViewsViewsStatesHas_element.default, destroying: _emberViewsViewsStatesDestroying.default }; exports.states = states; }); -enifed('ember-views/views/states/default', ['exports', 'ember-metal/error', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-views/compat/attrs-proxy'], function (exports, _emberMetalError, _emberMetalProperty_get, _emberMetalProperty_events, _emberViewsCompatAttrsProxy) { +enifed('ember-views/views/states/default', ['exports', 'ember-metal/error', 'ember-metal/property_get', 'ember-views/compat/attrs-proxy'], function (exports, _emberMetalError, _emberMetalProperty_get, _emberViewsCompatAttrsProxy) { + 'use strict'; /** @module ember @submodule ember-views */ @@ -42874,25 +41421,12 @@ getElement: function () { return null; }, - legacyAttrWillChange: function (view, key) { - if (key in view.attrs && !(key in view)) { - _emberMetalProperty_events.propertyWillChange(view, key); - } - }, - - legacyAttrDidChange: function (view, key) { - if (key in view.attrs && !(key in view)) { - _emberMetalProperty_events.propertyDidChange(view, key); - } - }, - legacyPropertyDidChange: function (view, key) { var attrs = view.attrs; - if (attrs && key in attrs) { var possibleCell = attrs[key]; if (possibleCell && possibleCell[_emberViewsCompatAttrsProxy.MUTABLE_CELL]) { var value = _emberMetalProperty_get.get(view, key); @@ -42916,35 +41450,36 @@ view.renderer.ensureViewNotRendering(view); }, invokeObserver: function () {} }; }); -enifed('ember-views/views/states/destroying', ['exports', 'ember-metal/merge', 'ember-runtime/system/string', 'ember-views/views/states/default', 'ember-metal/error'], function (exports, _emberMetalMerge, _emberRuntimeSystemString, _emberViewsViewsStatesDefault, _emberMetalError) { +enifed('ember-views/views/states/destroying', ['exports', 'ember-metal/merge', 'ember-views/views/states/default', 'ember-metal/error'], function (exports, _emberMetalMerge, _emberViewsViewsStatesDefault, _emberMetalError) { + 'use strict'; + /** @module ember @submodule ember-views */ - var destroyingError = 'You can\'t call %@ on a view being destroyed'; - var destroying = Object.create(_emberViewsViewsStatesDefault.default); _emberMetalMerge.default(destroying, { appendChild: function () { - throw new _emberMetalError.default(_emberRuntimeSystemString.fmt(destroyingError, ['appendChild'])); + throw new _emberMetalError.default('You can\'t call appendChild on a view being destroyed'); }, rerender: function () { - throw new _emberMetalError.default(_emberRuntimeSystemString.fmt(destroyingError, ['rerender'])); + throw new _emberMetalError.default('You can\'t call rerender on a view being destroyed'); }, destroyElement: function () { - throw new _emberMetalError.default(_emberRuntimeSystemString.fmt(destroyingError, ['destroyElement'])); + throw new _emberMetalError.default('You can\'t call destroyElement on a view being destroyed'); } }); exports.default = destroying; }); enifed('ember-views/views/states/has_element', ['exports', 'ember-views/views/states/default', 'ember-metal/merge', 'ember-views/system/jquery', 'ember-metal/property_get', 'htmlbars-runtime'], function (exports, _emberViewsViewsStatesDefault, _emberMetalMerge, _emberViewsSystemJquery, _emberMetalProperty_get, _htmlbarsRuntime) { + 'use strict'; var hasElement = Object.create(_emberViewsViewsStatesDefault.default); _emberMetalMerge.default(hasElement, { $: function (view, sel) { @@ -43016,10 +41551,12 @@ /** @module ember @submodule ember-views */ enifed('ember-views/views/states/in_dom', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/error', 'ember-metal/observer', 'ember-views/views/states/has_element'], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalError, _emberMetalObserver, _emberViewsViewsStatesHas_element) { + 'use strict'; + /** @module ember @submodule ember-views */ @@ -43063,27 +41600,31 @@ }); exports.default = inDOM; }); enifed('ember-views/views/states/pre_render', ['exports', 'ember-views/views/states/default', 'ember-metal/merge'], function (exports, _emberViewsViewsStatesDefault, _emberMetalMerge) { + 'use strict'; /** @module ember @submodule ember-views */ var preRender = Object.create(_emberViewsViewsStatesDefault.default); _emberMetalMerge.default(preRender, { - legacyAttrWillChange: function (view, key) {}, - legacyAttrDidChange: function (view, key) {}, legacyPropertyDidChange: function (view, key) {} }); exports.default = preRender; }); enifed('ember-views/views/text_area', ['exports', 'ember-views/views/component', 'ember-views/mixins/text_support'], function (exports, _emberViewsViewsComponent, _emberViewsMixinsText_support) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; /** The internal class used to create textarea element when the `{{textarea}}` helper is used. @@ -43110,15 +41651,16 @@ attributeBindings: ['rows', 'cols', 'name', 'selectionEnd', 'selectionStart', 'wrap', 'lang', 'dir', 'value'], rows: null, cols: null }); }); -/** -@module ember -@submodule ember-views -*/ enifed('ember-views/views/text_field', ['exports', 'ember-metal/computed', 'ember-metal/environment', 'ember-views/views/component', 'ember-views/mixins/text_support'], function (exports, _emberMetalComputed, _emberMetalEnvironment, _emberViewsViewsComponent, _emberViewsMixinsText_support) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; var inputTypeTestElement; var inputTypes = Object.create(null); function canSetTypeOfInput(type) { if (type in inputTypes) { @@ -43242,26 +41784,27 @@ @public */ max: null }); }); -/** -@module ember -@submodule ember-views -*/ enifed('ember-views/views/view', ['exports', 'ember-metal/core', 'ember-metal/error', 'ember-metal/property_get', 'ember-metal/run_loop', 'ember-metal/observer', 'ember-metal/utils', 'ember-metal/computed', 'ember-metal/mixin', 'ember-views/system/jquery', 'ember-views/system/ext', 'ember-views/views/core_view', 'ember-views/mixins/view_context_support', 'ember-views/mixins/view_child_views_support', 'ember-views/mixins/view_state_support', 'ember-views/mixins/template_rendering_support', 'ember-views/mixins/class_names_support', 'ember-views/mixins/legacy_view_support', 'ember-views/mixins/instrumentation_support', 'ember-views/mixins/aria_role_support', 'ember-views/mixins/visibility_support', 'ember-views/compat/attrs-proxy'], function (exports, _emberMetalCore, _emberMetalError, _emberMetalProperty_get, _emberMetalRun_loop, _emberMetalObserver, _emberMetalUtils, _emberMetalComputed, _emberMetalMixin, _emberViewsSystemJquery, _emberViewsSystemExt, _emberViewsViewsCore_view, _emberViewsMixinsView_context_support, _emberViewsMixinsView_child_views_support, _emberViewsMixinsView_state_support, _emberViewsMixinsTemplate_rendering_support, _emberViewsMixinsClass_names_support, _emberViewsMixinsLegacy_view_support, _emberViewsMixinsInstrumentation_support, _emberViewsMixinsAria_role_support, _emberViewsMixinsVisibility_support, _emberViewsCompatAttrsProxy) { + // Ember.assert, Ember.deprecate, Ember.warn, Ember.TEMPLATES, + // jQuery, Ember.lookup, + // Ember.ContainerView circular dependency + // Ember.ENV + 'use strict'; function K() { return this; } /** @module ember @submodule ember-views */ - _emberMetalCore.default.warn('The VIEW_PRESERVES_CONTEXT flag has been removed and the functionality can no longer be disabled.', _emberMetalCore.default.ENV.VIEW_PRESERVES_CONTEXT !== false); + _emberMetalCore.default.warn('The VIEW_PRESERVES_CONTEXT flag has been removed and the functionality can no longer be disabled.', _emberMetalCore.default.ENV.VIEW_PRESERVES_CONTEXT !== false, { id: 'ember-views.view-preserves-context-flag', until: '2.0.0' }); /** Global hash of shared templates. This will automatically be populated by the build tools so that you can store your Handlebars templates in separate files that get loaded into JavaScript at buildtime. @@ -43919,11 +42462,11 @@ By default `Ember.View` will lookup a template with this name in `Ember.TEMPLATES` (a shared global object). @property layoutName @type String @default null - @private + @public */ layoutName: null, /** The template used to render the view. This should be a function that @@ -43933,11 +42476,11 @@ the template yourself. @property template @type Function @private */ - template: _emberMetalComputed.computed('templateName', { + template: _emberMetalComputed.computed({ get: function () { var templateName = _emberMetalProperty_get.get(this, 'templateName'); var template = this.templateForName(templateName, 'template'); _emberMetalCore.default.assert('You specified the templateName ' + templateName + ' for ' + this + ', but it did not exist.', !templateName || !!template); return template || _emberMetalProperty_get.get(this, 'defaultTemplate'); @@ -43959,13 +42502,13 @@ This is useful for a view that has a shared wrapper, but which delegates the rendering of the contents of the wrapper to the `template` property on a subclass. @property layout @type Function - @private + @public */ - layout: _emberMetalComputed.computed('layoutName', { + layout: _emberMetalComputed.computed({ get: function (key) { var layoutName = _emberMetalProperty_get.get(this, 'layoutName'); var layout = this.templateForName(layoutName, 'layout'); _emberMetalCore.default.assert('You specified the layoutName ' + layoutName + ' for ' + this + ', but it did not exist.', !layoutName || !!layout); @@ -44061,23 +42604,10 @@ */ rerender: function () { return this.currentState.rerender(this); }, - /* - * @private - * - * @method _rerender - */ - _rerender: function () { - if (this.isDestroying || this.isDestroyed) { - return; - } - - this._renderer.renderTree(this, this.parentView); - }, - /** Given a property name, returns a dasherized version of that property name if the property evaluates to a non-falsy value. For example, if the view has property `isUrgent` that evaluates to true, passing `isUrgent` to this method will return `"is-urgent"`. @@ -44477,10 +43007,14 @@ this._super.apply(this, arguments); if (!this._viewRegistry) { this._viewRegistry = View.views; } + + this.renderer.componentInitAttrs(this, this.attrs || {}); + + _emberMetalCore.default.assert('Using a custom `.render` function is no longer supported.', !this.render); }, __defineNonEnumerable: function (property) { this[property.name] = property.descriptor.value; }, @@ -44491,19 +43025,19 @@ }, scheduleRevalidate: function (node, label, manualRerender) { if (node && !this._dispatching && node.guid in this.env.renderedNodes) { if (manualRerender) { - _emberMetalCore.default.deprecate('You manually rerendered ' + label + ' (a parent component) from a child component during the rendering process. This rarely worked in Ember 1.x and will be removed in Ember 2.0'); + _emberMetalCore.default.deprecate('You manually rerendered ' + label + ' (a parent component) from a child component during the rendering process. This rarely worked in Ember 1.x and will be removed in Ember 2.0', false, { id: 'ember-views.manual-parent-rerender', until: '3.0.0' }); } else { - _emberMetalCore.default.deprecate('You modified ' + label + ' twice in a single render. This was unreliable in Ember 1.x and will be removed in Ember 2.0'); + _emberMetalCore.default.deprecate('You modified ' + label + ' twice in a single render. This was unreliable in Ember 1.x and will be removed in Ember 2.0', false, { id: 'ember-views.render-double-modify', until: '3.0.0' }); } _emberMetalRun_loop.default.scheduleOnce('render', this, this.revalidate); return; } - _emberMetalCore.default.deprecate('A property of ' + this + ' was modified inside the ' + this._dispatching + ' hook. You should never change properties on components, services or models during ' + this._dispatching + ' because it causes significant performance degradation.', !this._dispatching); + _emberMetalCore.default.deprecate('A property of ' + this + ' was modified inside the ' + this._dispatching + ' hook. You should never change properties on components, services or models during ' + this._dispatching + ' because it causes significant performance degradation.', !this._dispatching, { id: 'ember-views.dispatching-modify-property', until: '3.0.0' }); if (!this.scheduledRevalidation || this._dispatching) { this.scheduledRevalidation = true; _emberMetalRun_loop.default.scheduleOnce('render', this, this.revalidate); } @@ -44660,48 +43194,62 @@ // inside the buffer, legal manipulations are done on the buffer // once the view has been inserted into the DOM, legal manipulations // are done on the DOM element. - /** - Global views hash - - @property views - @static - @type Object - @private - */ - View.views = {}; + View.reopenClass({ + /** + Global views hash + @property views + @static + @type Object + @private + */ + views: {}, - // If someone overrides the child views computed property when - // defining their class, we want to be able to process the user's - // supplied childViews and then restore the original computed property - // at view initialization time. This happens in Ember.ContainerView's init - // method. - View.childViewsProperty = _emberViewsMixinsView_child_views_support.childViewsProperty; + // If someone overrides the child views computed property when + // defining their class, we want to be able to process the user's + // supplied childViews and then restore the original computed property + // at view initialization time. This happens in Ember.ContainerView's init + // method. + childViewsProperty: _emberViewsMixinsView_child_views_support.childViewsProperty + }); + function viewDeprecationMessage() { + _emberMetalCore.default.deprecate('Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy.', !!_emberMetalCore.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT, { + url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-view', + id: 'ember-views.view-deprecated', + until: '2.4.0' + }); + } + var DeprecatedView = View.extend({ init: function () { + viewDeprecationMessage(); this._super.apply(this, arguments); - _emberMetalCore.default.deprecate('Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy.', !!_emberMetalCore.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT, { url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-view' }); } }); + DeprecatedView.reopen = function () { + viewDeprecationMessage(); + View.reopen.apply(View, arguments); + return this; + }; + exports.default = View; exports.ViewContextSupport = _emberViewsMixinsView_context_support.default; exports.ViewChildViewsSupport = _emberViewsMixinsView_child_views_support.default; exports.ViewStateSupport = _emberViewsMixinsView_state_support.default; exports.TemplateRenderingSupport = _emberViewsMixinsTemplate_rendering_support.default; exports.ClassNamesSupport = _emberViewsMixinsClass_names_support.default; exports.DeprecatedView = DeprecatedView; }); -// Ember.assert, Ember.deprecate, Ember.warn, Ember.TEMPLATES, -// jQuery, Ember.lookup, -// Ember.ContainerView circular dependency -// Ember.ENV // for the side effect of extending Ember.run.queues -enifed('ember', ['exports', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-routing', 'ember-application', 'ember-extension-support', 'ember-htmlbars', 'ember-routing-htmlbars', 'ember-routing-views', 'ember-metal/core', 'ember-metal/environment', 'ember-runtime/system/lazy_load'], function (exports, _emberMetal, _emberRuntime, _emberViews, _emberRouting, _emberApplication, _emberExtensionSupport, _emberHtmlbars, _emberRoutingHtmlbars, _emberRoutingViews, _emberMetalCore, _emberMetalEnvironment, _emberRuntimeSystemLazy_load) { +enifed('ember', ['exports', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-routing', 'ember-application', 'ember-extension-support', 'ember-htmlbars', 'ember-routing-htmlbars', 'ember-routing-views', 'ember-metal/core', 'ember-runtime/system/lazy_load'], function (exports, _emberMetal, _emberRuntime, _emberViews, _emberRouting, _emberApplication, _emberExtensionSupport, _emberHtmlbars, _emberRoutingHtmlbars, _emberRoutingViews, _emberMetalCore, _emberRuntimeSystemLazy_load) { + // require the main entry points for each of these packages + // this is so that the global exports occur properly + 'use strict'; if (_emberMetalCore.default.__loader.registry['ember-template-compiler']) { requireModule('ember-template-compiler'); } @@ -44714,16 +43262,13 @@ _emberRuntimeSystemLazy_load.runLoadHooks('Ember'); /** @module ember */ - - _emberMetalCore.default.deprecate('Usage of Ember is deprecated for Internet Explorer 6 and 7, support will be removed in the next major version.', !_emberMetalEnvironment.default.userAgent.match(/MSIE [67]/)); }); -// require the main entry points for each of these packages -// this is so that the global exports occur properly enifed('htmlbars-runtime', ['exports', './htmlbars-runtime/hooks', './htmlbars-runtime/render', '../htmlbars-util/morph-utils', '../htmlbars-util/template-utils', './htmlbars-runtime/expression-visitor', 'htmlbars-runtime/hooks'], function (exports, _htmlbarsRuntimeHooks, _htmlbarsRuntimeRender, _htmlbarsUtilMorphUtils, _htmlbarsUtilTemplateUtils, _htmlbarsRuntimeExpressionVisitor, _htmlbarsRuntimeHooks2) { + 'use strict'; var internal = { blockFor: _htmlbarsUtilTemplateUtils.blockFor, manualElement: _htmlbarsRuntimeRender.manualElement, hostBlock: _htmlbarsRuntimeHooks2.hostBlock, @@ -44737,10 +43282,11 @@ exports.hooks = _htmlbarsRuntimeHooks.default; exports.render = _htmlbarsRuntimeRender.default; exports.internal = internal; }); enifed("htmlbars-runtime/expression-visitor", ["exports", "../htmlbars-util/object-utils", "../htmlbars-util/morph-utils"], function (exports, _htmlbarsUtilObjectUtils, _htmlbarsUtilMorphUtils) { + "use strict"; /** Node classification: # Primary Statement Nodes: @@ -44773,24 +43319,24 @@ acceptExpression: function (node, env, scope) { var ret = { value: null }; // Primitive literals are unambiguously non-array representations of // themselves. - if (typeof node !== "object" || node === null) { + if (typeof node !== 'object' || node === null) { ret.value = node; return ret; } switch (node[0]) { // can be used by manualElement - case "value": + case 'value': ret.value = node[1];break; - case "get": + case 'get': ret.value = this.get(node, env, scope);break; - case "subexpr": + case 'subexpr': ret.value = this.subexpr(node, env, scope);break; - case "concat": + case 'concat': ret.value = this.concat(node, env, scope);break; } return ret; }, @@ -44879,11 +43425,11 @@ morph.isDirty = morph.isSubtreeDirty = false; if (isHelper(env, scope, path)) { env.hooks.inline(morph, env, scope, path, [], {}, visitor); if (morph.linkedResult) { - _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, "@content-helper", [morph.linkedResult], null); + _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, '@content-helper', [morph.linkedResult], null); } return; } var params; @@ -44891,11 +43437,11 @@ params = morph.linkedParams.params; } else { params = [env.hooks.get(env, scope, path)]; } - _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, "@range", params, null); + _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, '@range', params, null); env.hooks.range(morph, env, scope, path, params[0], visitor); }, // [ 'element', path, params, hash ] element: function (node, morph, env, scope, visitor) { @@ -44910,11 +43456,11 @@ // [ 'attribute', name, value ] attribute: function (node, morph, env, scope) { var name = node[1], value = node[2]; - var paramsAndHash = this.linkParamsAndHash(env, scope, morph, "@attribute", [value], null); + var paramsAndHash = this.linkParamsAndHash(env, scope, morph, '@attribute', [value], null); morph.isDirty = morph.isSubtreeDirty = false; env.hooks.attribute(morph, env, scope, name, paramsAndHash[0][0]); }, @@ -45013,10 +43559,12 @@ function isHelper(env, scope, path) { return env.hooks.keywords[path] !== undefined || env.hooks.hasHelper(env, scope, path); } }); enifed("htmlbars-runtime/hooks", ["exports", "./render", "../morph-range/morph-list", "../htmlbars-util/object-utils", "../htmlbars-util/morph-utils", "../htmlbars-util/template-utils"], function (exports, _render, _morphRangeMorphList, _htmlbarsUtilObjectUtils, _htmlbarsUtilMorphUtils, _htmlbarsUtilTemplateUtils) { + "use strict"; + exports.wrap = wrap; exports.wrapForHelper = wrapForHelper; exports.hostYieldWithShadowTemplate = hostYieldWithShadowTemplate; exports.createScope = createScope; exports.createFreshScope = createFreshScope; @@ -45247,13 +43795,13 @@ currentMorph = seek.nextMorph; return seek; } - return function (key, blockArguments, self) { - if (typeof key !== "string") { - throw new Error("You must provide a string key when calling `yieldItem`; you provided " + key); + return function (_key, blockArguments, self) { + if (typeof _key !== 'string') { + throw new Error("You must provide a string key when calling `yieldItem`; you provided " + _key); } // At least one item has been yielded, so we do not wholesale // clear the last MorphList but instead apply a prune operation. renderState.morphListToClear = null; @@ -45273,11 +43821,30 @@ // A map of morphs that have been yielded in on this // rendering pass. Any morphs that do not make it into // this list will be pruned from the MorphList during the cleanup // process. var handledMorphs = renderState.handledMorphs; + var key = undefined; + 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. + var collisions = renderState.collisions; + if (collisions === undefined) { + collisions = renderState.collisions = {}; + } + var count = collisions[_key] | 0; + collisions[_key] = ++count; + + key = _key + '--z8mS2hvDW0A--' + count; + } else { + key = _key; + } + if (currentMorph && currentMorph.key === key) { yieldTemplate(template, env, parentScope, currentMorph, renderState, visitor)(blockArguments, self); currentMorph = currentMorph.nextMorph; handledMorphs[key] = currentMorph; } else if (morphMap[key] !== undefined) { @@ -45549,11 +44116,11 @@ `{{yield}}` is used. Optionally provide a non-default block name that can be targeted by `{{yield to=blockName}}`. */ function bindBlock(env, scope, block) { - var name = arguments.length <= 3 || arguments[3] === undefined ? "default" : arguments[3]; + var name = arguments.length <= 3 || arguments[3] === undefined ? 'default' : arguments[3]; scope.blocks[name] = block; } /** @@ -45631,15 +44198,15 @@ } var redirect = env.hooks.classify(env, scope, path); if (redirect) { switch (redirect) { - case "component": + case 'component': env.hooks.component(morph, env, scope, path, params, hash, { default: template, inverse: inverse }, visitor);break; - case "inline": + case 'inline': env.hooks.inline(morph, env, scope, path, params, hash, visitor);break; - case "block": + case 'block': env.hooks.block(morph, env, scope, path, params, hash, template, inverse, visitor);break; default: throw new Error("Internal HTMLBars redirection to " + redirect + " not supported"); } return true; @@ -45656,11 +44223,11 @@ var keyword = env.hooks.keywords[path]; if (!keyword) { return false; } - if (typeof keyword === "function") { + if (typeof keyword === 'function') { return keyword(morph, env, scope, params, hash, template, inverse, visitor); } if (keyword.willRender) { keyword.willRender(morph, env); @@ -45742,11 +44309,11 @@ } return true; } - function linkRenderNode() { + function linkRenderNode() /* morph, env, scope, params, hash */{ return; } /** Host Hook: inline @@ -45803,14 +44370,14 @@ var helper = env.hooks.lookupHelper(env, scope, path); var result = env.hooks.invokeHelper(morph, env, scope, visitor, params, hash, helper, options.templates, thisFor(options.templates)); if (result && result.link) { morph.linkedResult = result.value; - _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, "@content-helper", [morph.linkedResult], null); + _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, '@content-helper', [morph.linkedResult], null); } - if (result && "value" in result) { + if (result && 'value' in result) { value = env.hooks.getValue(result.value); hasValue = true; } } @@ -45850,11 +44417,11 @@ } return out; } - function classify() { + function classify() /* env, scope, path */{ return null; } var keywords = { partial: function (morph, env, scope, params) { @@ -45865,24 +44432,24 @@ yield: function (morph, env, scope, params, hash, template, inverse, visitor) { // the current scope is provided purely for the creation of shadow // scopes; it should not be provided to user code. - var to = env.hooks.getValue(hash.to) || "default"; + var to = env.hooks.getValue(hash.to) || 'default'; if (scope.blocks[to]) { scope.blocks[to](env, params, hash.self, morph, scope, visitor); } return true; }, hasBlock: function (morph, env, scope, params) { - var name = env.hooks.getValue(params[0]) || "default"; + var name = env.hooks.getValue(params[0]) || 'default'; return !!scope.blocks[name]; }, hasBlockParams: function (morph, env, scope, params) { - var name = env.hooks.getValue(params[0]) || "default"; + var name = env.hooks.getValue(params[0]) || 'default'; return !!(scope.blocks[name] && scope.blocks[name].arity); } }; @@ -46024,11 +44591,11 @@ } function subexpr(env, scope, helperName, params, hash) { var helper = env.hooks.lookupHelper(env, scope, helperName); var result = env.hooks.invokeHelper(null, env, scope, null, params, hash, helper, {}); - if (result && "value" in result) { + if (result && 'value' in result) { return env.hooks.getValue(result.value); } } /** @@ -46051,15 +44618,15 @@ This hook is the "leaf" hook of the system. It is used to resolve a path relative to the current scope. */ function get(env, scope, path) { - if (path === "") { + if (path === '') { return scope.self; } - var keys = path.split("."); + var keys = path.split('.'); var value = env.hooks.getRoot(scope, keys[0])[0]; for (var i = 1; i < keys.length; i++) { if (value) { value = env.hooks.getChild(value, keys[i]); @@ -46125,11 +44692,14 @@ function lookupHelper(env, scope, helperName) { return env.helpers[helperName]; } - function bindScope() {} + function bindScope() /* env, scope */{ + // this function is used to handle host-specified extensions to scope + // other than `self`, `locals` and `block`. + } function updateScope(env, scope) { env.hooks.bindScope(env, scope); } @@ -46177,14 +44747,12 @@ inline: inline, range: range, keyword: keyword }; }); -/* morph, env, scope, params, hash */ /* env, scope, path */ /* env, scope */ -// this function is used to handle host-specified extensions to scope -// other than `self`, `locals` and `block`. enifed("htmlbars-runtime/morph", ["exports", "../morph-range"], function (exports, _morphRange) { + "use strict"; var guid = 1; function HTMLBarsMorph(domHelper, contextualElement) { this.super$constructor(domHelper, contextualElement); @@ -46230,10 +44798,12 @@ prototype.super$constructor = _morphRange.default; exports.default = HTMLBarsMorph; }); enifed("htmlbars-runtime/render", ["exports", "../htmlbars-util/array-utils", "../htmlbars-util/morph-utils", "./expression-visitor", "./morph", "../htmlbars-util/template-utils", "../htmlbars-util/void-tag-names"], function (exports, _htmlbarsUtilArrayUtils, _htmlbarsUtilMorphUtils, _expressionVisitor, _morph, _htmlbarsUtilTemplateUtils, _htmlbarsUtilVoidTagNames) { + "use strict"; + exports.default = render; exports.manualElement = manualElement; exports.attachAttributes = attachAttributes; exports.createChildMorph = createChildMorph; exports.getCachedFragment = getCachedFragment; @@ -46273,11 +44843,11 @@ this.bindScope(); if (options.attributes !== undefined) { nodes.push({ state: {} }); - this.statements.push(["attributes", attachAttributes(options.attributes)]); + this.statements.push(['attributes', attachAttributes(options.attributes)]); } if (options.self !== undefined) { this.bindSelf(options.self); } @@ -46318,31 +44888,31 @@ function manualElement(tagName, attributes) { var statements = []; for (var key in attributes) { - if (typeof attributes[key] === "string") { + if (typeof attributes[key] === 'string') { continue; } statements.push(["attribute", key, attributes[key]]); } - statements.push(["content", "yield"]); + statements.push(['content', 'yield']); var template = { arity: 0, cachedFragment: null, hasRendered: false, buildFragment: function buildFragment(dom) { var el0 = dom.createDocumentFragment(); - if (tagName === "svg") { + if (tagName === 'svg') { dom.setNamespace(svgNamespace); } var el1 = dom.createElement(tagName); for (var key in attributes) { - if (typeof attributes[key] !== "string") { + if (typeof attributes[key] !== 'string') { continue; } dom.setAttribute(el1, key, attributes[key]); } @@ -46358,11 +44928,11 @@ buildRenderNodes: function buildRenderNodes(dom, fragment) { var element = dom.childAt(fragment, [0]); var morphs = []; for (var key in attributes) { - if (typeof attributes[key] === "string") { + if (typeof attributes[key] === 'string') { continue; } morphs.push(dom.createAttrMorph(element, key)); } @@ -46379,11 +44949,11 @@ function attachAttributes(attributes) { var statements = []; for (var key in attributes) { - if (typeof attributes[key] === "string") { + if (typeof attributes[key] === 'string') { continue; } statements.push(["attribute", key, attributes[key]]); } @@ -46395,11 +44965,11 @@ var el0 = this.element; if (el0.namespaceURI === "http://www.w3.org/2000/svg") { dom.setNamespace(svgNamespace); } for (var key in attributes) { - if (typeof attributes[key] !== "string") { + if (typeof attributes[key] !== 'string') { continue; } dom.setAttribute(el0, key, attributes[key]); } @@ -46408,11 +44978,11 @@ buildRenderNodes: function buildRenderNodes(dom) { var element = this.element; var morphs = []; for (var key in attributes) { - if (typeof attributes[key] === "string") { + if (typeof attributes[key] === 'string') { continue; } morphs.push(dom.createAttrMorph(element, key)); } @@ -46496,23 +45066,23 @@ if (env.hooks.willRenderNode) { env.hooks.willRenderNode(morph, env, scope); } switch (statement[0]) { - case "block": + case 'block': visitor.block(statement, morph, env, scope, template, visitor);break; - case "inline": + case 'inline': visitor.inline(statement, morph, env, scope, visitor);break; - case "content": + case 'content': visitor.content(statement, morph, env, scope, visitor);break; - case "element": + case 'element': visitor.element(statement, morph, env, scope, template, visitor);break; - case "attribute": + case 'attribute': visitor.attribute(statement, morph, env, scope);break; - case "component": + case 'component': visitor.component(statement, morph, env, scope, template, visitor);break; - case "attributes": + case 'attributes': visitor.attributes(statement, morph, env, scope, this.fragment, visitor);break; } if (env.hooks.didRenderNode) { env.hooks.didRenderNode(morph, env, scope); @@ -46583,18 +45153,22 @@ return fragment; } }); enifed('htmlbars-util', ['exports', './htmlbars-util/safe-string', './htmlbars-util/handlebars/utils', './htmlbars-util/namespaces', './htmlbars-util/morph-utils'], function (exports, _htmlbarsUtilSafeString, _htmlbarsUtilHandlebarsUtils, _htmlbarsUtilNamespaces, _htmlbarsUtilMorphUtils) { + 'use strict'; + exports.SafeString = _htmlbarsUtilSafeString.default; exports.escapeExpression = _htmlbarsUtilHandlebarsUtils.escapeExpression; exports.getAttrNamespace = _htmlbarsUtilNamespaces.getAttrNamespace; exports.validateChildMorphs = _htmlbarsUtilMorphUtils.validateChildMorphs; exports.linkParams = _htmlbarsUtilMorphUtils.linkParams; exports.dump = _htmlbarsUtilMorphUtils.dump; }); enifed('htmlbars-util/array-utils', ['exports'], function (exports) { + 'use strict'; + exports.forEach = forEach; exports.map = map; function forEach(array, callback, binding) { var i, l; @@ -46649,10 +45223,12 @@ var indexOfArray = getIdx; exports.indexOfArray = indexOfArray; }); enifed('htmlbars-util/handlebars/safe-string', ['exports'], function (exports) { // Build out our basic SafeString type + 'use strict'; + function SafeString(string) { this.string = string; } SafeString.prototype.toString = SafeString.prototype.toHTML = function () { @@ -46660,10 +45236,12 @@ }; exports.default = SafeString; }); enifed('htmlbars-util/handlebars/utils', ['exports'], function (exports) { + 'use strict'; + exports.extend = extend; exports.indexOf = indexOf; exports.escapeExpression = escapeExpression; exports.isEmpty = isEmpty; exports.blockParams = blockParams; @@ -46671,11 +45249,11 @@ var escape = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', - '\'': '&#x27;', + "'": '&#x27;', '`': '&#x60;' }; var badChars = /[&<>"'`]/g, possible = /[&<>"'`]/; @@ -46774,15 +45352,18 @@ function appendContextPath(contextPath, id) { return (contextPath ? contextPath + '.' : '') + id; } }); enifed("htmlbars-util/morph-utils", ["exports"], function (exports) { + /*globals console*/ + + "use strict"; + exports.visitChildren = visitChildren; exports.validateChildMorphs = validateChildMorphs; exports.linkParams = linkParams; exports.dump = dump; - /*globals console*/ function visitChildren(nodes, callback) { if (!nodes || nodes.length === 0) { return; } @@ -46862,12 +45443,14 @@ cb(nodes[i]); } } }); enifed('htmlbars-util/namespaces', ['exports'], function (exports) { - exports.getAttrNamespace = getAttrNamespace; // ref http://dev.w3.org/html5/spec-LC/namespaces.html + 'use strict'; + + exports.getAttrNamespace = getAttrNamespace; var defaultNamespaces = { html: 'http://www.w3.org/1999/xhtml', mathml: 'http://www.w3.org/1998/Math/MathML', svg: 'http://www.w3.org/2000/svg', xlink: 'http://www.w3.org/1999/xlink', @@ -46885,10 +45468,12 @@ return namespace || null; } }); enifed("htmlbars-util/object-utils", ["exports"], function (exports) { + "use strict"; + exports.merge = merge; exports.shallowCopy = shallowCopy; exports.keySet = keySet; exports.keyLength = keyLength; @@ -46929,23 +45514,25 @@ return count; } }); enifed("htmlbars-util/quoting", ["exports"], function (exports) { + "use strict"; + exports.hash = hash; exports.repeat = repeat; function escapeString(str) { str = str.replace(/\\/g, "\\\\"); - str = str.replace(/"/g, "\\\""); + str = str.replace(/"/g, '\\"'); str = str.replace(/\n/g, "\\n"); return str; } exports.escapeString = escapeString; function string(str) { - return "\"" + escapeString(str) + "\""; + return '"' + escapeString(str) + '"'; } exports.string = string; function array(a) { @@ -46965,13 +45552,17 @@ } return str; } }); enifed('htmlbars-util/safe-string', ['exports', './handlebars/safe-string'], function (exports, _handlebarsSafeString) { + 'use strict'; + exports.default = _handlebarsSafeString.default; }); enifed("htmlbars-util/template-utils", ["exports", "../htmlbars-util/morph-utils"], function (exports, _htmlbarsUtilMorphUtils) { + "use strict"; + exports.RenderState = RenderState; exports.blockFor = blockFor; exports.renderAndCleanup = renderAndCleanup; exports.clearMorph = clearMorph; exports.clearMorphList = clearMorphList; @@ -46987,10 +45578,11 @@ // A map of morphs for each item yielded in during this // rendering pass. Any morphs in the DOM but not in this map // will be pruned during cleanup. this.handledMorphs = {}; + this.collisions = undefined; // The morph to clear once rendering is complete. By // default, we set this to the previous morph (to catch // the case where nothing is yielded; in that case, we // should just clear the morph). Otherwise this gets set @@ -47035,11 +45627,11 @@ function bindBlocks(env, shadowScope, blocks) { if (!blocks) { return; } - if (typeof blocks === "function") { + if (typeof blocks === 'function') { env.hooks.bindBlock(env, shadowScope, blocks); } else { for (var name in blocks) { if (blocks.hasOwnProperty(name)) { env.hooks.bindBlock(env, shadowScope, blocks[name], name); @@ -47053,10 +45645,11 @@ // helper or hook being invoked has yielded. Once it has finished either // yielding multiple items (via yieldItem) or a single template (via // yieldTemplate), we detect what was rendered and how it differs from // the previous render, cleaning up old state in DOM as appropriate. var renderState = options.renderState; + renderState.collisions = undefined; renderState.shadowOptions = shadowOptions; // Invoke the callback, instructing it to save information about what it // renders into RenderState. var result = callback(options); @@ -47155,10 +45748,11 @@ morphList.clear(); morph.morphList = null; } }); enifed("htmlbars-util/void-tag-names", ["exports", "./array-utils"], function (exports, _arrayUtils) { + "use strict"; // The HTML elements in this list are speced by // http://www.w3.org/TR/html-markup/syntax.html#syntax-elements, // and will be forced to close regardless of if they have a // self-closing /> at the end. @@ -47170,10 +45764,11 @@ }); exports.default = voidMap; }); enifed("morph-attr", ["exports", "./morph-attr/sanitize-attribute-value", "./dom-helper/prop", "./dom-helper/build-html-dom", "./htmlbars-util"], function (exports, _morphAttrSanitizeAttributeValue, _domHelperProp, _domHelperBuildHtmlDom, _htmlbarsUtil) { + "use strict"; function getProperty() { return this.domHelper.getPropertyStrict(this.element, this.attrName); } @@ -47241,11 +45836,11 @@ var _normalizeProperty = _domHelperProp.normalizeProperty(this.element, attrName); var normalized = _normalizeProperty.normalized; var type = _normalizeProperty.type; - if (element.namespaceURI === _domHelperBuildHtmlDom.svgNamespace || attrName === "style" || type === "attr") { + if (element.namespaceURI === _domHelperBuildHtmlDom.svgNamespace || attrName === 'style' || type === 'attr') { this._update = updateAttribute; this._get = getAttribute; this.attrName = normalized; } else { this._update = updateProperty; @@ -47288,13 +45883,15 @@ exports.default = AttrMorph; exports.sanitizeAttributeValue = _morphAttrSanitizeAttributeValue.sanitizeAttributeValue; }); enifed('morph-attr/sanitize-attribute-value', ['exports'], function (exports) { - exports.sanitizeAttributeValue = sanitizeAttributeValue; /* jshint scripturl:true */ + 'use strict'; + + exports.sanitizeAttributeValue = sanitizeAttributeValue; var badProtocols = { 'javascript:': true, 'vbscript:': true }; @@ -47350,10 +45947,11 @@ return value; } }); enifed('morph-range', ['exports', './morph-range/utils'], function (exports, _morphRangeUtils) { + 'use strict'; // constructor just initializes the fields // use one of the static initializers to create a valid morph. function Morph(domHelper, contextualElement) { this.domHelper = domHelper; @@ -47613,10 +46211,11 @@ }; exports.default = Morph; }); enifed('morph-range/morph-list', ['exports', './utils'], function (exports, _utils) { + 'use strict'; function MorphList() { // morph graph this.firstChildMorph = null; this.lastChildMorph = null; @@ -47690,36 +46289,39 @@ this.lastChildMorph._syncLastNode(); }; prototype.removeChildMorph = function MorphList$removeChildMorph(morph) { if (morph.parentMorphList !== this) { - throw new Error('Cannot remove a morph from a parent it is not inside of'); + throw new Error("Cannot remove a morph from a parent it is not inside of"); } morph.destroy(); }; exports.default = MorphList; }); enifed('morph-range/morph-list.umd', ['exports', './morph-list'], function (exports, _morphList) { + 'use strict'; (function (root, factory) { if (typeof enifed === 'function' && enifed.amd) { enifed([], factory); } else if (typeof exports === 'object') { module.exports = factory(); } else { root.MorphList = factory(); } - })(this, function () { + })(undefined, function () { return _morphList.default; }); }); enifed("morph-range/utils", ["exports"], function (exports) { + // inclusive of both nodes + "use strict"; + exports.clear = clear; exports.insertBefore = insertBefore; - // inclusive of both nodes function clear(parentNode, firstNode, lastNode) { if (!parentNode) { return; } @@ -47748,17 +46350,18 @@ node = nextNode; } while (node); } }); enifed('route-recognizer', ['exports', './route-recognizer/dsl'], function (exports, _routeRecognizerDsl) { + 'use strict'; var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\']; var escapeRegex = new RegExp('(\\' + specials.join('|\\') + ')', 'g'); function isArray(test) { - return Object.prototype.toString.call(test) === '[object Array]'; + return Object.prototype.toString.call(test) === "[object Array]"; } // A Segment represents a segment in the original route description. // Each Segment type provides an `eachChar` and `regex` method. // @@ -47802,15 +46405,15 @@ function DynamicSegment(name) { this.name = name; } DynamicSegment.prototype = { eachChar: function (callback) { - callback({ invalidChars: '/', repeat: true }); + callback({ invalidChars: "/", repeat: true }); }, regex: function () { - return '([^/]+)'; + return "([^/]+)"; }, generate: function (params) { return params[this.name]; } @@ -47819,15 +46422,15 @@ function StarSegment(name) { this.name = name; } StarSegment.prototype = { eachChar: function (callback) { - callback({ invalidChars: '', repeat: true }); + callback({ invalidChars: "", repeat: true }); }, regex: function () { - return '(.+)'; + return "(.+)"; }, generate: function (params) { return params[this.name]; } @@ -47835,25 +46438,25 @@ function EpsilonSegment() {} EpsilonSegment.prototype = { eachChar: function () {}, regex: function () { - return ''; + return ""; }, generate: function () { - return ''; + return ""; } }; function parse(route, names, types) { // normalize route as not starting with a "/". Recognition will // also normalize. - if (route.charAt(0) === '/') { + if (route.charAt(0) === "/") { route = route.substr(1); } - var segments = route.split('/'), + var segments = route.split("/"), results = []; for (var i = 0, l = segments.length; i < l; i++) { var segment = segments[i], match; @@ -47864,11 +46467,11 @@ types.dynamics++; } else if (match = segment.match(/^\*([^\/]+)$/)) { results.push(new StarSegment(match[1])); names.push(match[1]); types.stars++; - } else if (segment === '') { + } else if (segment === "") { results.push(new EpsilonSegment()); } else { results.push(new StaticSegment(segment)); types.statics++; } @@ -48109,11 +46712,11 @@ }; RouteRecognizer.prototype = { add: function (routes, options) { var currentState = this.rootState, - regex = '^', + regex = "^", types = { statics: 0, dynamics: 0, stars: 0 }, handlers = [], allSegments = [], name; @@ -48135,12 +46738,12 @@ } isEmpty = false; // Add a "/" for the new segment - currentState = currentState.put({ validChars: '/' }); - regex += '/'; + currentState = currentState.put({ validChars: "/" }); + regex += "/"; // Add a representation of the segment to the NFA and regex currentState = addSegment(currentState, segment); regex += segment.regex(); } @@ -48148,16 +46751,16 @@ var handler = { handler: route.handler, names: names }; handlers.push(handler); } if (isEmpty) { - currentState = currentState.put({ validChars: '/' }); - regex += '/'; + currentState = currentState.put({ validChars: "/" }); + regex += "/"; } currentState.handlers = handlers; - currentState.regex = new RegExp(regex + '$'); + currentState.regex = new RegExp(regex + "$"); currentState.types = types; if (name = options && options.as) { this.names[name] = { segments: allSegments, @@ -48168,11 +46771,11 @@ handlersFor: function (name) { var route = this.names[name], result = []; if (!route) { - throw new Error('There is no route named ' + name); + throw new Error("There is no route named " + name); } for (var i = 0, l = route.handlers.length; i < l; i++) { result.push(route.handlers[i]); } @@ -48184,13 +46787,13 @@ return !!this.names[name]; }, generate: function (name, params) { var route = this.names[name], - output = ''; + output = ""; if (!route) { - throw new Error('There is no route named ' + name); + throw new Error("There is no route named " + name); } var segments = route.segments; for (var i = 0, l = segments.length; i < l; i++) { @@ -48198,11 +46801,11 @@ if (segment instanceof EpsilonSegment) { continue; } - output += '/'; + output += "/"; output += segment.generate(params); } if (output.charAt(0) !== '/') { output = '/' + output; @@ -48235,24 +46838,24 @@ for (var j = 0, l = value.length; j < l; j++) { var arrayPair = key + '[]' + '=' + encodeURIComponent(value[j]); pairs.push(arrayPair); } } else { - pair += '=' + encodeURIComponent(value); + pair += "=" + encodeURIComponent(value); pairs.push(pair); } } if (pairs.length === 0) { return ''; } - return '?' + pairs.join('&'); + return "?" + pairs.join("&"); }, parseQueryString: function (queryString) { - var pairs = queryString.split('&'), + var pairs = queryString.split("&"), queryParams = {}; for (var i = 0; i < pairs.length; i++) { var pair = pairs[i].split('='), key = decodeQueryParamPart(pair[0]), keyLength = key.length, @@ -48298,16 +46901,16 @@ path = decodeURI(path); // DEBUG GROUP path - if (path.charAt(0) !== '/') { - path = '/' + path; + if (path.charAt(0) !== "/") { + path = "/" + path; } pathLen = path.length; - if (pathLen > 1 && path.charAt(pathLen - 1) === '/') { + if (pathLen > 1 && path.charAt(pathLen - 1) === "/") { path = path.substr(0, pathLen - 1); isSlashDropped = true; } for (i = 0, l = path.length; i < l; i++) { @@ -48331,12 +46934,12 @@ var state = solutions[0]; if (state && state.handlers) { // if a trailing slash was dropped and a star segment is the last segment // specified, put the trailing slash back - if (isSlashDropped && state.regex.source.slice(-5) === '(.+)$') { - path = path + '/'; + if (isSlashDropped && state.regex.source.slice(-5) === "(.+)$") { + path = path + "/"; } return findHandler(state, path, queryParams); } } }; @@ -48346,10 +46949,12 @@ RouteRecognizer.VERSION = '0.1.5'; exports.default = RouteRecognizer; }); enifed("route-recognizer/dsl", ["exports"], function (exports) { + "use strict"; + function Target(path, matcher, delegate) { this.path = path; this.matcher = matcher; this.delegate = delegate; } @@ -48452,13 +47057,16 @@ } }, this); }; }); enifed('router', ['exports', './router/router'], function (exports, _routerRouter) { + 'use strict'; + exports.default = _routerRouter.default; }); enifed('router/handler-info', ['exports', './utils', 'rsvp/promise'], function (exports, _utils, _rsvpPromise) { + 'use strict'; function HandlerInfo(_props) { var props = _props || {}; _utils.merge(this, props); this.initialize(props); @@ -48480,11 +47088,11 @@ payload.log(this.name + ': ' + message); } }, promiseLabel: function (label) { - return _utils.promiseLabel('\'' + this.name + '\' ' + label); + return _utils.promiseLabel("'" + this.name + "' " + label); }, getUnresolved: function () { return this; }, @@ -48498,11 +47106,11 @@ beforeModel = _utils.bind(this, this.runBeforeModelHook, payload), model = _utils.bind(this, this.getModel, payload), afterModel = _utils.bind(this, this.runAfterModelHook, payload), becomeResolved = _utils.bind(this, this.becomeResolved, payload); - return _rsvpPromise.default.resolve(undefined, this.promiseLabel('Start handler')).then(checkForAbort, null, this.promiseLabel('Check for abort')).then(beforeModel, null, this.promiseLabel('Before model')).then(checkForAbort, null, this.promiseLabel('Check if aborted during \'beforeModel\' hook')).then(model, null, this.promiseLabel('Model')).then(checkForAbort, null, this.promiseLabel('Check if aborted in \'model\' hook')).then(afterModel, null, this.promiseLabel('After model')).then(checkForAbort, null, this.promiseLabel('Check if aborted in \'afterModel\' hook')).then(becomeResolved, null, this.promiseLabel('Become resolved')); + return _rsvpPromise.default.resolve(undefined, this.promiseLabel("Start handler")).then(checkForAbort, null, this.promiseLabel("Check for abort")).then(beforeModel, null, this.promiseLabel("Before model")).then(checkForAbort, null, this.promiseLabel("Check if aborted during 'beforeModel' hook")).then(model, null, this.promiseLabel("Model")).then(checkForAbort, null, this.promiseLabel("Check if aborted in 'model' hook")).then(afterModel, null, this.promiseLabel("After model")).then(checkForAbort, null, this.promiseLabel("Check if aborted in 'afterModel' hook")).then(becomeResolved, null, this.promiseLabel("Become resolved")); }, runBeforeModelHook: function (payload) { if (payload.trigger) { payload.trigger(true, 'willResolveModel', payload, this.handler); @@ -48520,15 +47128,15 @@ return this.runSharedModelHook(payload, 'afterModel', [resolvedModel]).then(function () { // Ignore the fulfilled value returned from afterModel. // Return the value stashed in resolvedModels, which // might have been swapped out in afterModel. return payload.resolvedModels[name]; - }, null, this.promiseLabel('Ignore fulfillment value and return model value')); + }, null, this.promiseLabel("Ignore fulfillment value and return model value")); }, runSharedModelHook: function (payload, hookName, args) { - this.log(payload, 'calling ' + hookName + ' hook'); + this.log(payload, "calling " + hookName + " hook"); if (this.queryParams) { args.push(this.queryParams); } args.push(payload); @@ -48537,22 +47145,22 @@ if (result && result.isTransition) { result = null; } - return _rsvpPromise.default.resolve(result, this.promiseLabel('Resolve value returned from one of the model hooks')); + return _rsvpPromise.default.resolve(result, this.promiseLabel("Resolve value returned from one of the model hooks")); }, // overridden by subclasses getModel: null, checkForAbort: function (shouldContinue, promiseValue) { - return _rsvpPromise.default.resolve(shouldContinue(), this.promiseLabel('Check for abort')).then(function () { + return _rsvpPromise.default.resolve(shouldContinue(), this.promiseLabel("Check for abort")).then(function () { // We don't care about shouldContinue's resolve value; // pass along the original value passed to this fn. return promiseValue; - }, null, this.promiseLabel('Ignore fulfillment value and continue')); + }, null, this.promiseLabel("Ignore fulfillment value and continue")); }, stashResolvedModel: function (payload, resolvedModel) { payload.resolvedModels = payload.resolvedModels || {}; payload.resolvedModels[this.name] = resolvedModel; @@ -48614,10 +47222,11 @@ } exports.default = HandlerInfo; }); enifed('router/handler-info/factory', ['exports', 'router/handler-info/resolved-handler-info', 'router/handler-info/unresolved-handler-info-by-object', 'router/handler-info/unresolved-handler-info-by-param'], function (exports, _routerHandlerInfoResolvedHandlerInfo, _routerHandlerInfoUnresolvedHandlerInfoByObject, _routerHandlerInfoUnresolvedHandlerInfoByParam) { + 'use strict'; handlerInfoFactory.klasses = { resolved: _routerHandlerInfoResolvedHandlerInfo.default, param: _routerHandlerInfoUnresolvedHandlerInfoByParam.default, object: _routerHandlerInfoUnresolvedHandlerInfoByObject.default @@ -48631,18 +47240,19 @@ } exports.default = handlerInfoFactory; }); enifed('router/handler-info/resolved-handler-info', ['exports', '../handler-info', 'router/utils', 'rsvp/promise'], function (exports, _handlerInfo, _routerUtils, _rsvpPromise) { + 'use strict'; var ResolvedHandlerInfo = _routerUtils.subclass(_handlerInfo.default, { resolve: function (shouldContinue, payload) { // A ResolvedHandlerInfo just resolved with itself. if (payload && payload.resolvedModels) { payload.resolvedModels[this.name] = this.context; } - return _rsvpPromise.default.resolve(this, this.promiseLabel('Resolve')); + return _rsvpPromise.default.resolve(this, this.promiseLabel("Resolve")); }, getUnresolved: function () { return this.factory('param', { name: this.name, @@ -48655,14 +47265,15 @@ }); exports.default = ResolvedHandlerInfo; }); enifed('router/handler-info/unresolved-handler-info-by-object', ['exports', '../handler-info', 'router/utils', 'rsvp/promise'], function (exports, _handlerInfo, _routerUtils, _rsvpPromise) { + 'use strict'; var UnresolvedHandlerInfoByObject = _routerUtils.subclass(_handlerInfo.default, { getModel: function (payload) { - this.log(payload, this.name + ': resolving provided model'); + this.log(payload, this.name + ": resolving provided model"); return _rsvpPromise.default.resolve(this.context); }, initialize: function (props) { this.names = props.names || []; @@ -48708,10 +47319,11 @@ }); exports.default = UnresolvedHandlerInfoByObject; }); enifed('router/handler-info/unresolved-handler-info-by-param', ['exports', '../handler-info', 'router/utils'], function (exports, _handlerInfo, _routerUtils) { + 'use strict'; // Generated by URL transitions and non-dynamic route segments in named Transitions. var UnresolvedHandlerInfoByParam = _routerUtils.subclass(_handlerInfo.default, { initialize: function (props) { this.params = props.params || {}; @@ -48733,10 +47345,11 @@ }); exports.default = UnresolvedHandlerInfoByParam; }); enifed('router/router', ['exports', 'route-recognizer', 'rsvp/promise', './utils', './transition-state', './transition', './transition-intent/named-transition-intent', './transition-intent/url-transition-intent', './handler-info'], function (exports, _routeRecognizer, _rsvpPromise, _utils, _transitionState, _transition, _transitionIntentNamedTransitionIntent, _transitionIntentUrlTransitionIntent, _handlerInfo) { + 'use strict'; var pop = Array.prototype.pop; function Router(_options) { var options = _options || {}; @@ -48792,11 +47405,11 @@ // Transition promises by default resolve with resolved state. // For our purposes, swap out the promise to resolve // after the transition has been finalized. newTransition.promise = newTransition.promise.then(function (result) { return finalizeTransition(newTransition, result.state); - }, null, _utils.promiseLabel('Settle transition promise when transition is finalized')); + }, null, _utils.promiseLabel("Settle transition promise when transition is finalized")); if (!wasTransitioning) { notifyExistingHandlers(this, newState, newTransition); } @@ -48858,11 +47471,11 @@ updateURL(newTransition, oldState, true); if (router.didTransition) { router.didTransition(router.currentHandlerInfos); } return result; - }, null, _utils.promiseLabel('Transition complete')); + }, null, _utils.promiseLabel("Transition complete")); return newTransition; } }, // NOTE: this doesn't really belong here, but here @@ -48918,11 +47531,11 @@ /** Hook point for updating the URL. @param {String} url a URL to update to */ updateURL: function () { - throw new Error('updateURL is not implemented'); + throw new Error("updateURL is not implemented"); }, /** Hook point for replacing the current URL, i.e. with replaceState By default this behaves the same as `updateURL` @@ -48953,11 +47566,11 @@ for (var i = 0, len = handlerInfos.length; i < len; ++i) { var handlerInfo = handlerInfos[i]; params[handlerInfo.name] = handlerInfo.params || {}; } - _utils.log(this, 'Starting a refresh transition'); + _utils.log(this, "Starting a refresh transition"); var intent = new _transitionIntentNamedTransitionIntent.default({ name: handlerInfos[handlerInfos.length - 1].name, pivotHandler: pivotHandler || handlerInfos[0].handler, contexts: [], // TODO collect contexts...? queryParams: this._changedQueryParams || state.queryParams || {} @@ -49349,11 +47962,11 @@ to update the router's array of `currentHandlerInfos`. */ function finalizeTransition(transition, newState) { try { - _utils.log(transition.router, transition.sequence, 'Resolved all models on destination route; finalizing transition.'); + _utils.log(transition.router, transition.sequence, "Resolved all models on destination route; finalizing transition."); var router = transition.router, handlerInfos = newState.handlerInfos, seq = transition.sequence; @@ -49376,11 +47989,11 @@ if (router.didTransition) { router.didTransition(router.currentHandlerInfos); } - _utils.log(router, transition.sequence, 'TRANSITION COMPLETE.'); + _utils.log(router, transition.sequence, "TRANSITION COMPLETE."); // Resolve with the final handler. return handlerInfos[handlerInfos.length - 1].handler; } catch (e) { if (!(e instanceof _transition.TransitionAborted)) { @@ -49416,11 +48029,11 @@ } var intent; if (args.length === 0) { - _utils.log(router, 'Updating query params'); + _utils.log(router, "Updating query params"); // A query param update is really just a transition // into the route you're already on. var handlerInfos = router.state.handlerInfos; intent = new _transitionIntentNamedTransitionIntent.default({ @@ -49428,15 +48041,15 @@ contexts: [], queryParams: queryParams }); } else if (name.charAt(0) === '/') { - _utils.log(router, 'Attempting URL transition to ' + name); + _utils.log(router, "Attempting URL transition to " + name); intent = new _transitionIntentUrlTransitionIntent.default({ url: name }); } else { - _utils.log(router, 'Attempting transition to ' + name); + _utils.log(router, "Attempting transition to " + name); intent = new _transitionIntentNamedTransitionIntent.default({ name: args[0], contexts: _utils.slice.call(args, 1), queryParams: queryParams }); @@ -49537,10 +48150,11 @@ } exports.default = Router; }); enifed('router/transition-intent', ['exports', './utils'], function (exports, _utils) { + 'use strict'; function TransitionIntent(props) { this.initialize(props); // TODO: wat @@ -49553,10 +48167,12 @@ }; exports.default = TransitionIntent; }); enifed('router/transition-intent/named-transition-intent', ['exports', '../transition-intent', '../transition-state', '../handler-info/factory', '../utils'], function (exports, _transitionIntent, _transitionState, _handlerInfoFactory, _utils) { + 'use strict'; + exports.default = _utils.subclass(_transitionIntent.default, { name: null, pivotHandler: null, contexts: null, queryParams: null, @@ -49649,11 +48265,11 @@ newState.handlerInfos.unshift(handlerToUse); } if (objects.length > 0) { - throw new Error('More context objects were passed than there are dynamic segments for the route: ' + targetRouteName); + throw new Error("More context objects were passed than there are dynamic segments for the route: " + targetRouteName); } if (!isIntermediate) { this.invalidateChildren(newState.handlerInfos, invalidateIndex); } @@ -49721,19 +48337,19 @@ var oldParams = oldHandlerInfo && name === oldHandlerInfo.name && oldHandlerInfo.params || {}; var peek = objects[objects.length - 1]; var paramName = names[numNames]; if (_utils.isParam(peek)) { - params[paramName] = '' + objects.pop(); + params[paramName] = "" + objects.pop(); } else { // If we're here, this means only some of the params // were string/number params, so try and use a param // value from a previous handler. if (oldParams.hasOwnProperty(paramName)) { params[paramName] = oldParams[paramName]; } else { - throw new Error('You didn\'t provide enough string/numeric parameters to satisfy all of the dynamic segments for route ' + name); + throw new Error("You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route " + name); } } } return _handlerInfoFactory.default('param', { @@ -49743,10 +48359,12 @@ }); } }); }); enifed('router/transition-intent/url-transition-intent', ['exports', '../transition-intent', '../transition-state', '../handler-info/factory', '../utils', './../unrecognized-url-error'], function (exports, _transitionIntent, _transitionState, _handlerInfoFactory, _utils, _unrecognizedUrlError) { + 'use strict'; + exports.default = _utils.subclass(_transitionIntent.default, { url: null, initialize: function (props) { this.url = props.url; @@ -49795,10 +48413,11 @@ return newState; } }); }); enifed('router/transition-state', ['exports', './handler-info', './utils', 'rsvp/promise'], function (exports, _handlerInfo, _utils, _rsvpPromise) { + 'use strict'; function TransitionState(other) { this.handlerInfos = []; this.queryParams = {}; this.params = {}; @@ -49815,11 +48434,11 @@ if (targetName !== '') { targetName += '.'; } targetName += handlerInfo.name; }); - return _utils.promiseLabel('\'' + targetName + '\': ' + label); + return _utils.promiseLabel("'" + targetName + "': " + label); }, resolve: function (shouldContinue, payload) { var self = this; // First, calculate params for this state. This is useful @@ -49834,20 +48453,20 @@ var currentState = this; var wasAborted = false; // The prelude RSVP.resolve() asyncs us into the promise land. - return _rsvpPromise.default.resolve(null, this.promiseLabel('Start transition')).then(resolveOneHandlerInfo, null, this.promiseLabel('Resolve handler'))['catch'](handleError, this.promiseLabel('Handle error')); + return _rsvpPromise.default.resolve(null, this.promiseLabel("Start transition")).then(resolveOneHandlerInfo, null, this.promiseLabel('Resolve handler'))['catch'](handleError, this.promiseLabel('Handle error')); function innerShouldContinue() { - return _rsvpPromise.default.resolve(shouldContinue(), currentState.promiseLabel('Check if should continue'))['catch'](function (reason) { + return _rsvpPromise.default.resolve(shouldContinue(), currentState.promiseLabel("Check if should continue"))['catch'](function (reason) { // We distinguish between errors that occurred // during resolution (e.g. beforeModel/model/afterModel), // and aborts due to a rejecting promise from shouldContinue(). wasAborted = true; return _rsvpPromise.default.reject(reason); - }, currentState.promiseLabel('Handle abort')); + }, currentState.promiseLabel("Handle abort")); } function handleError(error) { // This is the only possible // reject value of TransitionState#resolve @@ -49900,10 +48519,11 @@ }; exports.default = TransitionState; }); enifed('router/transition', ['exports', 'rsvp/promise', './handler-info', './utils'], function (exports, _rsvpPromise, _handlerInfo, _utils) { + 'use strict'; /** @private A Transition is a thennable (a promise-like object) that represents @@ -49962,11 +48582,11 @@ this.params = {}; } function checkForAbort() { if (transition.isAborted) { - return _rsvpPromise.default.reject(undefined, _utils.promiseLabel('Transition aborted - reject')); + return _rsvpPromise.default.reject(undefined, _utils.promiseLabel("Transition aborted - reject")); } } } Transition.currentSequence = 0; @@ -50072,11 +48692,11 @@ */ abort: function () { if (this.isAborted) { return this; } - _utils.log(this.router, this.sequence, this.targetName + ': transition was aborted'); + _utils.log(this.router, this.sequence, this.targetName + ": transition was aborted"); this.intent.preTransitionState = this.router.state; this.isAborted = true; this.isActive = false; this.router.activeTransition = null; return this; @@ -50154,11 +48774,11 @@ return _rsvpPromise.default.reject(reason); }); }, toString: function () { - return 'Transition (sequence ' + this.sequence + ')'; + return "Transition (sequence " + this.sequence + ")"; }, /** @private */ @@ -50174,24 +48794,25 @@ @private Logs and returns a TransitionAborted error. */ function logAbort(transition) { - _utils.log(transition.router, transition.sequence, 'detected abort.'); + _utils.log(transition.router, transition.sequence, "detected abort."); return new TransitionAborted(); } function TransitionAborted(message) { - this.message = message || 'TransitionAborted'; - this.name = 'TransitionAborted'; + this.message = message || "TransitionAborted"; + this.name = "TransitionAborted"; } exports.Transition = Transition; exports.logAbort = logAbort; exports.TransitionAborted = TransitionAborted; }); enifed("router/unrecognized-url-error", ["exports", "./utils"], function (exports, _utils) { + "use strict"; /** Promise reject reasons passed to promise rejection handlers for failed transitions. */ @@ -50204,10 +48825,12 @@ UnrecognizedURLError.prototype = _utils.oCreate(Error.prototype); exports.default = UnrecognizedURLError; }); enifed('router/utils', ['exports'], function (exports) { + 'use strict'; + exports.extractQueryParams = extractQueryParams; exports.log = log; exports.bind = bind; exports.forEach = forEach; exports.trigger = trigger; @@ -50217,11 +48840,11 @@ var slice = Array.prototype.slice; var _isArray; if (!Array.isArray) { _isArray = function (x) { - return Object.prototype.toString.call(x) === '[object Array]'; + return Object.prototype.toString.call(x) === "[object Array]"; }; } else { _isArray = Array.isArray; } @@ -50287,11 +48910,11 @@ if (!router.log) { return; } if (arguments.length === 3) { - router.log('Transition #' + sequence + ': ' + msg); + router.log("Transition #" + sequence + ": " + msg); } else { msg = sequence; router.log(msg); } } @@ -50304,11 +48927,11 @@ return fn.apply(context, args); }; } function isParam(object) { - return typeof object === 'string' || object instanceof String || typeof object === 'number' || object instanceof Number; + return typeof object === "string" || object instanceof String || typeof object === "number" || object instanceof Number; } function forEach(array, callback) { for (var i = 0, l = array.length; i < l && false !== callback(array[i]); i++) {} } @@ -50323,11 +48946,11 @@ if (!handlerInfos) { if (ignoreFailure) { return; } - throw new Error('Could not trigger event \'' + name + '\'. There are no active handlers'); + throw new Error("Could not trigger event '" + name + "'. There are no active handlers"); } var eventWasHandled = false; for (var i = handlerInfos.length - 1; i >= 0; i--) { @@ -50342,11 +48965,11 @@ } } } if (!eventWasHandled && !ignoreFailure) { - throw new Error('Nothing handled the event \'' + name + '\'.'); + throw new Error("Nothing handled the event '" + name + "'."); } } function getChangelist(oldObject, newObject) { var key; @@ -50414,11 +49037,11 @@ function resolveHook(obj, hookName) { if (!obj) { return; } - var underscored = '_' + hookName; + var underscored = "_" + hookName; return obj[underscored] && underscored || obj[hookName] && hookName; } function callHook(obj, _hookName, arg1, arg2) { var hookName = resolveHook(obj, _hookName); @@ -50447,23 +49070,28 @@ exports.callHook = callHook; exports.resolveHook = resolveHook; exports.applyHook = applyHook; }); enifed('rsvp', ['exports', './rsvp/promise', './rsvp/events', './rsvp/node', './rsvp/all', './rsvp/all-settled', './rsvp/race', './rsvp/hash', './rsvp/hash-settled', './rsvp/rethrow', './rsvp/defer', './rsvp/config', './rsvp/map', './rsvp/resolve', './rsvp/reject', './rsvp/filter', './rsvp/asap'], function (exports, _rsvpPromise, _rsvpEvents, _rsvpNode, _rsvpAll, _rsvpAllSettled, _rsvpRace, _rsvpHash, _rsvpHashSettled, _rsvpRethrow, _rsvpDefer, _rsvpConfig, _rsvpMap, _rsvpResolve, _rsvpReject, _rsvpFilter, _rsvpAsap) { + 'use strict'; - _rsvpConfig.config.async = _rsvpAsap.default; // default async is asap; + // defaults + _rsvpConfig.config.async = _rsvpAsap.default; + _rsvpConfig.config.after = function (cb) { + setTimeout(cb, 0); + }; var cast = _rsvpResolve.default; function async(callback, arg) { _rsvpConfig.config.async(callback, arg); } function on() { - _rsvpConfig.config.on.apply(_rsvpConfig.config, arguments); + _rsvpConfig.config['on'].apply(_rsvpConfig.config, arguments); } function off() { - _rsvpConfig.config.off.apply(_rsvpConfig.config, arguments); + _rsvpConfig.config['off'].apply(_rsvpConfig.config, arguments); } // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { var callbacks = window['__PROMISE_INSTRUMENTATION__']; @@ -50493,11 +49121,12 @@ exports.reject = _rsvpReject.default; exports.async = async; exports.map = _rsvpMap.default; exports.filter = _rsvpFilter.default; }); -enifed('rsvp.umd', ['exports', './rsvp'], function (exports, _rsvp) { +enifed('rsvp.umd', ['exports', './rsvp/platform', './rsvp'], function (exports, _rsvpPlatform, _rsvp) { + 'use strict'; var RSVP = { 'race': _rsvp.race, 'Promise': _rsvp.Promise, 'allSettled': _rsvp.allSettled, @@ -50523,15 +49152,16 @@ enifed(function () { return RSVP; }); } else if (typeof module !== 'undefined' && module['exports']) { module['exports'] = RSVP; - } else if (typeof this !== 'undefined') { - this['RSVP'] = RSVP; + } else if (typeof _rsvpPlatform.default !== 'undefined') { + _rsvpPlatform.default['RSVP'] = RSVP; } }); enifed('rsvp/-internal', ['exports', './utils', './instrument', './config'], function (exports, _utils, _instrument, _config) { + 'use strict'; function withOwnPromise() { return new TypeError('A promises callback cannot return that same promise.'); } @@ -50590,11 +49220,12 @@ } function handleOwnThenable(promise, thenable) { if (thenable._state === FULFILLED) { fulfill(promise, thenable._result); - } else if (promise._state === REJECTED) { + } else if (thenable._state === REJECTED) { + thenable._onError = null; reject(promise, thenable._result); } else { subscribe(thenable, undefined, function (value) { if (thenable !== value) { resolve(promise, value); @@ -50634,12 +49265,12 @@ fulfill(promise, value); } } function publishRejection(promise) { - if (promise._onerror) { - promise._onerror(promise._result); + if (promise._onError) { + promise._onError(promise._result); } publish(promise); } @@ -50664,19 +49295,18 @@ if (promise._state !== PENDING) { return; } promise._state = REJECTED; promise._result = reason; - _config.config.async(publishRejection, promise); } function subscribe(parent, child, onFulfillment, onRejection) { var subscribers = parent._subscribers; var length = subscribers.length; - parent._onerror = null; + parent._onError = null; subscribers[length] = child; subscribers[length + FULFILLED] = onFulfillment; subscribers[length + REJECTED] = onRejection; @@ -50755,26 +49385,37 @@ } else { value = detail; succeeded = true; } - if (promise._state !== PENDING) {} else if (hasCallback && succeeded) { - resolve(promise, value); - } else if (failed) { - reject(promise, error); - } else if (settled === FULFILLED) { - fulfill(promise, value); - } else if (settled === REJECTED) { - reject(promise, value); - } + if (promise._state !== PENDING) { + // noop + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (failed) { + reject(promise, error); + } else if (settled === FULFILLED) { + fulfill(promise, value); + } else if (settled === REJECTED) { + reject(promise, value); + } } function initializePromise(promise, resolver) { + var resolved = false; try { resolver(function resolvePromise(value) { + if (resolved) { + return; + } + resolved = true; resolve(promise, value); }, function rejectPromise(reason) { + if (resolved) { + return; + } + resolved = true; reject(promise, reason); }); } catch (e) { reject(promise, e); } @@ -50791,13 +49432,13 @@ exports.invokeCallback = invokeCallback; exports.FULFILLED = FULFILLED; exports.REJECTED = REJECTED; exports.PENDING = PENDING; }); - -// noop enifed('rsvp/all-settled', ['exports', './enumerator', './promise', './utils'], function (exports, _enumerator, _promise, _utils) { + 'use strict'; + exports.default = allSettled; function AllSettled(Constructor, entries, label) { this._superConstructor(Constructor, entries, false, /* don't abort on reject */label); } @@ -50852,11 +49493,11 @@ ``` @method allSettled @static @for RSVP - @param {Array} promises + @param {Array} entries @param {String} label - optional string that describes the promise. Useful for tooling. @return {Promise} promise that is fulfilled with an array of the settled states of the constituent promises. */ @@ -50864,10 +49505,12 @@ function allSettled(entries, label) { return new AllSettled(_promise.default, entries, label).promise; } }); enifed("rsvp/all", ["exports", "./promise"], function (exports, _promise) { + "use strict"; + exports.default = all; /** This is a convenient alias for `RSVP.Promise.all`. @@ -50882,12 +49525,16 @@ function all(array, label) { return _promise.default.all(array, label); } }); enifed('rsvp/asap', ['exports'], function (exports) { + 'use strict'; + exports.default = asap; var len = 0; + var toString = ({}).toString; + var vertxNext; function asap(callback, arg) { queue[len] = callback; queue[len + 1] = arg; len += 2; @@ -50900,18 +49547,26 @@ } var browserWindow = typeof window !== 'undefined' ? window : undefined; var browserGlobal = browserWindow || {}; var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; + var isNode = typeof window === 'undefined' && typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]'; // test for web worker but not in IE10 var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; // node function useNextTick() { + var nextTick = process.nextTick; + // node version 0.10.x displays a deprecation warning when nextTick is used recursively + // setImmediate should be used instead instead + var version = process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/); + if (Array.isArray(version) && version[1] === '0' && version[2] === '10') { + nextTick = setImmediate; + } return function () { - process.nextTick(flush); + nextTick(flush); }; } // vertx function useVertxTimer() { @@ -50961,21 +49616,22 @@ len = 0; } function attemptVertex() { try { - var vertx = eriuqer('vertx'); - var vertxNext = vertx.runOnLoop || vertx.runOnContext; + var r = eriuqer; + var vertx = r('vertx'); + vertxNext = vertx.runOnLoop || vertx.runOnContext; return useVertxTimer(); } catch (e) { return useSetTimeout(); } } var scheduleFlush; // Decide what async method to use to triggering processing of queued callbacks: - if (typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]') { + if (isNode) { scheduleFlush = useNextTick(); } else if (BrowserMutationObserver) { scheduleFlush = useMutationObserver(); } else if (isWorker) { scheduleFlush = useMessageChannel(); @@ -50984,23 +49640,24 @@ } else { scheduleFlush = useSetTimeout(); } }); enifed('rsvp/config', ['exports', './events'], function (exports, _events) { + 'use strict'; var config = { instrument: false }; - _events.default.mixin(config); + _events.default['mixin'](config); function configure(name, value) { if (name === 'onerror') { // handle for legacy users that expect the actual // error to be passed to their function added via // `RSVP.configure('onerror', someFunctionHere);` - config.on('error', value); + config['on']('error', value); return; } if (arguments.length === 2) { config[name] = value; @@ -51011,10 +49668,12 @@ exports.config = config; exports.configure = configure; }); enifed('rsvp/defer', ['exports', './promise'], function (exports, _promise) { + 'use strict'; + exports.default = defer; /** `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s @@ -51033,11 +49692,11 @@ ```javascript var deferred = RSVP.defer(); deferred.resolve("Success!"); - defered.promise.then(function(value){ + deferred.promise.then(function(value){ // value here is "Success!" }); ``` @method defer @@ -51058,10 +49717,12 @@ return deferred; } }); enifed('rsvp/enumerator', ['exports', './utils', './-internal'], function (exports, _utils, _internal) { + 'use strict'; + exports.makeSettledResult = makeSettledResult; function makeSettledResult(state, position, value) { if (state === _internal.FULFILLED) { return { @@ -51075,35 +49736,39 @@ }; } } function Enumerator(Constructor, input, abortOnReject, label) { - this._instanceConstructor = Constructor; - this.promise = new Constructor(_internal.noop, label); - this._abortOnReject = abortOnReject; + var enumerator = this; - if (this._validateInput(input)) { - this._input = input; - this.length = input.length; - this._remaining = input.length; + enumerator._instanceConstructor = Constructor; + enumerator.promise = new Constructor(_internal.noop, label); + enumerator._abortOnReject = abortOnReject; - this._init(); + if (enumerator._validateInput(input)) { + enumerator._input = input; + enumerator.length = input.length; + enumerator._remaining = input.length; - if (this.length === 0) { - _internal.fulfill(this.promise, this._result); + enumerator._init(); + + if (enumerator.length === 0) { + _internal.fulfill(enumerator.promise, enumerator._result); } else { - this.length = this.length || 0; - this._enumerate(); - if (this._remaining === 0) { - _internal.fulfill(this.promise, this._result); + enumerator.length = enumerator.length || 0; + enumerator._enumerate(); + if (enumerator._remaining === 0) { + _internal.fulfill(enumerator.promise, enumerator._result); } } } else { - _internal.reject(this.promise, this._validationError()); + _internal.reject(enumerator.promise, enumerator._validationError()); } } + exports.default = Enumerator; + Enumerator.prototype._validateInput = function (input) { return _utils.isArray(input); }; Enumerator.prototype._validationError = function () { @@ -51112,52 +49777,53 @@ Enumerator.prototype._init = function () { this._result = new Array(this.length); }; - exports.default = Enumerator; - Enumerator.prototype._enumerate = function () { - var length = this.length; - var promise = this.promise; - var input = this._input; + var enumerator = this; + var length = enumerator.length; + var promise = enumerator.promise; + var input = enumerator._input; for (var i = 0; promise._state === _internal.PENDING && i < length; i++) { - this._eachEntry(input[i], i); + enumerator._eachEntry(input[i], i); } }; Enumerator.prototype._eachEntry = function (entry, i) { - var c = this._instanceConstructor; + var enumerator = this; + var c = enumerator._instanceConstructor; if (_utils.isMaybeThenable(entry)) { if (entry.constructor === c && entry._state !== _internal.PENDING) { - entry._onerror = null; - this._settledAt(entry._state, i, entry._result); + entry._onError = null; + enumerator._settledAt(entry._state, i, entry._result); } else { - this._willSettleAt(c.resolve(entry), i); + enumerator._willSettleAt(c.resolve(entry), i); } } else { - this._remaining--; - this._result[i] = this._makeResult(_internal.FULFILLED, i, entry); + enumerator._remaining--; + enumerator._result[i] = enumerator._makeResult(_internal.FULFILLED, i, entry); } }; Enumerator.prototype._settledAt = function (state, i, value) { - var promise = this.promise; + var enumerator = this; + var promise = enumerator.promise; if (promise._state === _internal.PENDING) { - this._remaining--; + enumerator._remaining--; - if (this._abortOnReject && state === _internal.REJECTED) { + if (enumerator._abortOnReject && state === _internal.REJECTED) { _internal.reject(promise, value); } else { - this._result[i] = this._makeResult(state, i, value); + enumerator._result[i] = enumerator._makeResult(state, i, value); } } - if (this._remaining === 0) { - _internal.fulfill(promise, this._result); + if (enumerator._remaining === 0) { + _internal.fulfill(promise, enumerator._result); } }; Enumerator.prototype._makeResult = function (state, i, value) { return value; @@ -51171,11 +49837,13 @@ }, function (reason) { enumerator._settledAt(_internal.REJECTED, i, reason); }); }; }); -enifed("rsvp/events", ["exports"], function (exports) { +enifed('rsvp/events', ['exports'], function (exports) { + 'use strict'; + function indexOf(callbacks, callback) { for (var i = 0, l = callbacks.length; i < l; i++) { if (callbacks[i] === callback) { return i; } @@ -51228,14 +49896,14 @@ @method mixin @for RSVP.EventTarget @private @param {Object} object object to extend with EventTarget methods */ - mixin: function (object) { - object.on = this.on; - object.off = this.off; - object.trigger = this.trigger; + 'mixin': function (object) { + object['on'] = this['on']; + object['off'] = this['off']; + object['trigger'] = this['trigger']; object._promiseCallbacks = undefined; return object; }, /** @@ -51250,11 +49918,15 @@ @for RSVP.EventTarget @private @param {String} eventName name of the event to listen for @param {Function} callback function to be called when the event is triggered. */ - on: function (eventName, callback) { + 'on': function (eventName, callback) { + if (typeof callback !== 'function') { + throw new TypeError('Callback must be a function'); + } + var allCallbacks = callbacksFor(this), callbacks; callbacks = allCallbacks[eventName]; @@ -51295,11 +49967,11 @@ @param {Function} callback optional argument. If given, only the function given will be removed from the event's callback queue. If no `callback` argument is given, all callbacks will be removed from the event's callback queue. */ - off: function (eventName, callback) { + 'off': function (eventName, callback) { var allCallbacks = callbacksFor(this), callbacks, index; if (!callback) { @@ -51336,14 +50008,14 @@ ``` @method trigger @for RSVP.EventTarget @private @param {String} eventName name of the event to be triggered - @param {Any} options optional value to be passed to any event handlers for + @param {*} options optional value to be passed to any event handlers for the given `eventName` */ - trigger: function (eventName, options) { + 'trigger': function (eventName, options) { var allCallbacks = callbacksFor(this), callbacks, callback; if (callbacks = allCallbacks[eventName]) { @@ -51356,10 +50028,12 @@ } } }; }); enifed('rsvp/filter', ['exports', './promise', './utils'], function (exports, _promise, _utils) { + 'use strict'; + exports.default = filter; /** `RSVP.filter` is similar to JavaScript's native `filter` method, except that it waits for all promises to become fulfilled before running the `filterFn` on @@ -51447,11 +50121,11 @@ */ function filter(promises, filterFn, label) { return _promise.default.all(promises, label).then(function (values) { if (!_utils.isFunction(filterFn)) { - throw new TypeError('You must pass a function as filter\'s second argument.'); + throw new TypeError("You must pass a function as filter's second argument."); } var length = values.length; var filtered = new Array(length); @@ -51476,10 +50150,12 @@ }); }); } }); enifed('rsvp/hash-settled', ['exports', './promise', './enumerator', './promise-hash', './utils'], function (exports, _promise, _enumerator, _promiseHash, _utils) { + 'use strict'; + exports.default = hashSettled; function HashSettled(Constructor, object, label) { this._superConstructor(Constructor, object, false, label); } @@ -51584,11 +50260,11 @@ }); ``` @method hashSettled @for RSVP - @param {Object} promises + @param {Object} object @param {String} label optional string that describes the promise. Useful for tooling. @return {Promise} promise that is fulfilled when when all properties of `promises` have been settled. @static @@ -51597,10 +50273,12 @@ function hashSettled(object, label) { return new HashSettled(_promise.default, object, label).promise; } }); enifed('rsvp/hash', ['exports', './promise', './promise-hash'], function (exports, _promise, _promiseHash) { + 'use strict'; + exports.default = hash; /** `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array for its `promises` argument. @@ -51681,11 +50359,11 @@ ``` @method hash @static @for RSVP - @param {Object} promises + @param {Object} object @param {String} label optional string that describes the promise. Useful for tooling. @return {Promise} promise that is fulfilled when all properties of `promises` have been fulfilled, or rejected if any of them become rejected. */ @@ -51693,10 +50371,12 @@ function hash(object, label) { return new _promiseHash.default(_promise.default, object, label).promise; } }); enifed('rsvp/instrument', ['exports', './config', './utils'], function (exports, _config, _utils) { + 'use strict'; + exports.default = instrument; var queue = []; function scheduleFlush() { @@ -51711,11 +50391,11 @@ payload.childGuid = payload.key + payload.childId; if (payload.error) { payload.stack = payload.error.stack; } - _config.config.trigger(entry.name, entry.payload); + _config.config['trigger'](entry.name, entry.payload); } queue.length = 0; }, 50); } @@ -51728,17 +50408,19 @@ eventName: eventName, detail: promise._result, childId: child && child._id, label: promise._label, timeStamp: _utils.now(), - error: _config.config['instrument-with-stack'] ? new Error(promise._label) : null + error: _config.config["instrument-with-stack"] ? new Error(promise._label) : null } })) { scheduleFlush(); } } }); enifed('rsvp/map', ['exports', './promise', './utils'], function (exports, _promise, _utils) { + 'use strict'; + exports.default = map; /** `RSVP.map` is similar to JavaScript's native `map` method, except that it waits for all promises to become fulfilled before running the `mapFn` on @@ -51819,11 +50501,11 @@ */ function map(promises, mapFn, label) { return _promise.default.all(promises, label).then(function (values) { if (!_utils.isFunction(mapFn)) { - throw new TypeError('You must pass a function as map\'s second argument.'); + throw new TypeError("You must pass a function as map's second argument."); } var length = values.length; var results = new Array(length); @@ -51834,10 +50516,12 @@ return _promise.default.all(results, label); }); } }); enifed('rsvp/node', ['exports', './promise', './-internal', './utils'], function (exports, _promise, _internal, _utils) { + 'use strict'; + exports.default = denodeify; function Result() { this.value = undefined; } @@ -52017,11 +50701,11 @@ @for RSVP @param {Function} nodeFunc a 'node-style' function that takes a callback as its last argument. The callback expects an error to be passed as its first argument (if an error occurred, otherwise null), and the value from the operation as its second argument ('function(err, value){ }'). - @param {Boolean|Array} argumentNames An optional paramter that if set + @param {Boolean|Array} [options] An optional paramter that if set to `true` causes the promise to fulfill with the callback's success arguments as an array. This is useful if the node function has multiple success paramters. If you set this paramter to an array with names, the promise will fulfill with a hash with these names as keys and the success parameters as values. @@ -52101,11 +50785,30 @@ } else { return false; } } }); +enifed('rsvp/platform', ['exports'], function (exports) { + 'use strict'; + + var platform; + + /* global self */ + if (typeof self === 'object') { + platform = self; + + /* global global */ + } else if (typeof global === 'object') { + platform = global; + } else { + throw new Error('no global: `self` or `global` found'); + } + + exports.default = platform; +}); enifed('rsvp/promise-hash', ['exports', './enumerator', './-internal', './utils'], function (exports, _enumerator, _internal, _utils) { + 'use strict'; function PromiseHash(Constructor, object, label) { this._superConstructor(Constructor, object, true, label); } @@ -52124,46 +50827,49 @@ PromiseHash.prototype._validationError = function () { return new Error('Promise.hash must be called with an object'); }; PromiseHash.prototype._enumerate = function () { - var promise = this.promise; - var input = this._input; + var enumerator = this; + var promise = enumerator.promise; + var input = enumerator._input; var results = []; for (var key in input) { - if (promise._state === _internal.PENDING && input.hasOwnProperty(key)) { + if (promise._state === _internal.PENDING && Object.prototype.hasOwnProperty.call(input, key)) { results.push({ position: key, entry: input[key] }); } } var length = results.length; - this._remaining = length; + enumerator._remaining = length; var result; for (var i = 0; promise._state === _internal.PENDING && i < length; i++) { result = results[i]; - this._eachEntry(result.entry, result.position); + enumerator._eachEntry(result.entry, result.position); } }; }); enifed('rsvp/promise', ['exports', './config', './instrument', './utils', './-internal', './promise/all', './promise/race', './promise/resolve', './promise/reject'], function (exports, _config, _instrument, _utils, _internal, _promiseAll, _promiseRace, _promiseResolve, _promiseReject) { + 'use strict'; + exports.default = Promise; + var guidKey = 'rsvp_' + _utils.now() + '-'; var counter = 0; function needsResolver() { throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); } function needsNew() { - throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); } - exports.default = Promise; /** Promise objects represent the eventual result of an asynchronous operation. The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise’s eventual value or the reason @@ -52265,31 +50971,34 @@ @param {function} resolver @param {String} label optional string for labeling the promise. Useful for tooling. @constructor */ + function Promise(resolver, label) { - this._id = counter++; - this._label = label; - this._state = undefined; - this._result = undefined; - this._subscribers = []; + var promise = this; + promise._id = counter++; + promise._label = label; + promise._state = undefined; + promise._result = undefined; + promise._subscribers = []; + if (_config.config.instrument) { - _instrument.default('created', this); + _instrument.default('created', promise); } if (_internal.noop !== resolver) { if (!_utils.isFunction(resolver)) { needsResolver(); } - if (!(this instanceof Promise)) { + if (!(promise instanceof Promise)) { needsNew(); } - _internal.initializePromise(this, resolver); + _internal.initializePromise(promise, resolver); } } Promise.cast = _promiseResolve.default; // deprecated Promise.all = _promiseAll.default; @@ -52300,12 +51009,17 @@ Promise.prototype = { constructor: Promise, _guidKey: guidKey, - _onerror: function (reason) { - _config.config.trigger('error', reason); + _onError: function (reason) { + var promise = this; + _config.config.after(function () { + if (promise._onError) { + _config.config['trigger']('error', reason); + } + }); }, /** The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise's eventual value or the @@ -52492,30 +51206,30 @@ // something went wrong }); ``` @method then - @param {Function} onFulfilled - @param {Function} onRejected + @param {Function} onFulfillment + @param {Function} onRejection @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} */ then: function (onFulfillment, onRejection, label) { var parent = this; var state = parent._state; if (state === _internal.FULFILLED && !onFulfillment || state === _internal.REJECTED && !onRejection) { if (_config.config.instrument) { - _instrument.default('chained', this, this); + _instrument.default('chained', parent, parent); } - return this; + return parent; } - parent._onerror = null; + parent._onError = null; - var child = new this.constructor(_internal.noop, label); + var child = new parent.constructor(_internal.noop, label); var result = parent._result; if (_config.config.instrument) { _instrument.default('chained', parent, child); } @@ -52559,11 +51273,11 @@ @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} */ 'catch': function (onRejection, label) { - return this.then(null, onRejection, label); + return this.then(undefined, onRejection, label); }, /** `finally` will be invoked regardless of the promise's fate just as native try/catch/finally behaves @@ -52603,13 +51317,14 @@ @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} */ 'finally': function (callback, label) { - var constructor = this.constructor; + var promise = this; + var constructor = promise.constructor; - return this.then(function (value) { + return promise.then(function (value) { return constructor.resolve(callback()).then(function () { return value; }); }, function (reason) { return constructor.resolve(callback()).then(function () { @@ -52618,10 +51333,12 @@ }, label); } }; }); enifed('rsvp/promise/all', ['exports', '../enumerator'], function (exports, _enumerator) { + 'use strict'; + exports.default = all; /** `RSVP.Promise.all` accepts an array of promises, and returns a new promise which is fulfilled with an array of fulfillment values for the passed promises, or @@ -52673,10 +51390,12 @@ function all(entries, label) { return new _enumerator.default(this, entries, true, /* abort on reject */label).promise; } }); enifed('rsvp/promise/race', ['exports', '../utils', '../-internal'], function (exports, _utils, _internal) { + 'use strict'; + exports.default = race; /** `RSVP.Promise.race` returns a new promise which is settled in the same way as the first passed promise to settle. @@ -52735,11 +51454,11 @@ RSVP.Promise.race([ajax('foo.json'), timeout(5000)]) ``` @method race @static - @param {Array} promises array of promises to observe + @param {Array} entries array of promises to observe @param {String} label optional string for describing the promise returned. Useful for tooling. @return {Promise} a promise which settles in the same way as the first passed promise to settle. */ @@ -52771,10 +51490,12 @@ return promise; } }); enifed('rsvp/promise/reject', ['exports', '../-internal'], function (exports, _internal) { + 'use strict'; + exports.default = reject; /** `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. It is shorthand for the following: @@ -52803,11 +51524,11 @@ }); ``` @method reject @static - @param {Any} reason value that the returned promise will be rejected with. + @param {*} reason value that the returned promise will be rejected with. @param {String} label optional string for identifying the returned promise. Useful for tooling. @return {Promise} a promise rejected with the given `reason`. */ @@ -52818,10 +51539,12 @@ _internal.reject(promise, reason); return promise; } }); enifed('rsvp/promise/resolve', ['exports', '../-internal'], function (exports, _internal) { + 'use strict'; + exports.default = resolve; /** `RSVP.Promise.resolve` returns a promise that will become resolved with the passed `value`. It is shorthand for the following: @@ -52846,11 +51569,11 @@ }); ``` @method resolve @static - @param {Any} value value that the returned promise will be resolved with + @param {*} object value that the returned promise will be resolved with @param {String} label optional string for identifying the returned promise. Useful for tooling. @return {Promise} a promise that will become fulfilled with the given `value` */ @@ -52867,10 +51590,12 @@ _internal.resolve(promise, object); return promise; } }); enifed('rsvp/race', ['exports', './promise'], function (exports, _promise) { + 'use strict'; + exports.default = race; /** This is a convenient alias for `RSVP.Promise.race`. @@ -52885,38 +51610,42 @@ function race(array, label) { return _promise.default.race(array, label); } }); enifed('rsvp/reject', ['exports', './promise'], function (exports, _promise) { + 'use strict'; + exports.default = reject; /** This is a convenient alias for `RSVP.Promise.reject`. @method reject @static @for RSVP - @param {Any} reason value that the returned promise will be rejected with. + @param {*} reason value that the returned promise will be rejected with. @param {String} label optional string for identifying the returned promise. Useful for tooling. @return {Promise} a promise rejected with the given `reason`. */ function reject(reason, label) { return _promise.default.reject(reason, label); } }); enifed('rsvp/resolve', ['exports', './promise'], function (exports, _promise) { + 'use strict'; + exports.default = resolve; /** This is a convenient alias for `RSVP.Promise.resolve`. @method resolve @static @for RSVP - @param {Any} value value that the returned promise will be resolved with + @param {*} value value that the returned promise will be resolved with @param {String} label optional string for identifying the returned promise. Useful for tooling. @return {Promise} a promise that will become fulfilled with the given `value` */ @@ -52924,11 +51653,10 @@ function resolve(value, label) { return _promise.default.resolve(value, label); } }); enifed("rsvp/rethrow", ["exports"], function (exports) { - exports.default = rethrow; /** `RSVP.rethrow` will rethrow an error on the next turn of the JavaScript event loop in order to aid debugging. Promises A+ specifies that any exceptions that occur with a promise must be @@ -52965,18 +51693,23 @@ @for RSVP @param {Error} reason reason the promise became rejected. @throws Error @static */ + "use strict"; + exports.default = rethrow; + function rethrow(reason) { setTimeout(function () { throw reason; }); throw reason; } }); enifed('rsvp/utils', ['exports'], function (exports) { + 'use strict'; + exports.objectOrFunction = objectOrFunction; exports.isFunction = isFunction; exports.isMaybeThenable = isMaybeThenable; function objectOrFunction(x) { \ No newline at end of file