dist/ember.prod.js in ember-source-2.7.0.beta.1 vs dist/ember.prod.js in ember-source-2.7.0.beta.2

- old
+ new

@@ -4,11 +4,11 @@ * @copyright Copyright 2011-2016 Tilde Inc. and contributors * Portions Copyright 2006-2011 Strobe Inc. * Portions Copyright 2008-2011 Apple Inc. All rights reserved. * @license Licensed under MIT license * See https://raw.github.com/emberjs/ember.js/master/LICENSE - * @version 2.7.0-beta.1 + * @version 2.7.0-beta.2 */ var enifed, requireModule, require, Ember; var mainContext = this; @@ -3726,30 +3726,36 @@ */ }); enifed("ember/version", ["exports"], function (exports) { "use strict"; - exports.default = "2.7.0-beta.1"; + exports.default = "2.7.0-beta.2"; }); enifed('ember-application/index', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-runtime/system/lazy_load', 'ember-application/system/resolver', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-application/system/engine', 'ember-application/system/engine-instance'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberRuntimeSystemLazy_load, _emberApplicationSystemResolver, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberApplicationSystemEngine, _emberApplicationSystemEngineInstance) { 'use strict'; _emberMetalCore.default.Application = _emberApplicationSystemApplication.default; _emberMetalCore.default.Resolver = _emberApplicationSystemResolver.Resolver; _emberMetalCore.default.DefaultResolver = _emberApplicationSystemResolver.default; + if (false) { + _emberMetalCore.default.Engine = _emberApplicationSystemEngine.default; + + // Expose `EngineInstance` and `ApplicationInstance` for easy overriding. + // Reanalyze whether to continue exposing these after feature flag is removed. + _emberMetalCore.default.EngineInstance = _emberApplicationSystemEngineInstance.default; + _emberMetalCore.default.ApplicationInstance = _emberApplicationSystemApplicationInstance.default; + } + _emberRuntimeSystemLazy_load.runLoadHooks('Ember.Application', _emberApplicationSystemApplication.default); }); // reexports /** @module ember @submodule ember-application */ - -// Expose `EngineInstance` and `ApplicationInstance` for easy overriding. -// Reanalyze whether to continue exposing these after feature flag is removed. enifed('ember-application/system/application-instance', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/run_loop', 'ember-metal/computed', 'ember-runtime/mixins/registry_proxy', 'ember-metal/assign', 'ember-environment', 'ember-runtime/ext/rsvp', 'ember-views/system/jquery', 'ember-application/system/engine-instance'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalRun_loop, _emberMetalComputed, _emberRuntimeMixinsRegistry_proxy, _emberMetalAssign, _emberEnvironment, _emberRuntimeExtRsvp, _emberViewsSystemJquery, _emberApplicationSystemEngineInstance) { /** @module ember @submodule ember-application */ @@ -4342,13 +4348,12 @@ The `rootElement` can be either a DOM element or a jQuery-compatible selector string. Note that *views appended to the DOM outside the root element will not receive events.* If you specify a custom root element, make sure you only append views inside it! - To learn more about the advantages of event delegation and the Ember view - layer, and a list of the event listeners that are setup by default, visit the - [Ember View Layer guide](http://emberjs.com/guides/understanding-ember/the-view-layer/#toc_event-delegation). + To learn more about the events Ember components use, see + [components/handling-events](https://guides.emberjs.com/v2.6.0/components/handling-events/#toc_event-names). ### Initializers Libraries on top of Ember can add initializers, like so: @@ -5108,17 +5113,16 @@ * all controllers receive the application as their `namespace` property * the application view receives the application controller as its `controller` property * the application view receives the application template as its `defaultTemplate` property - @private - @method buildRegistry + @method buildRegistry @static @param {Ember.Application} namespace the application for which to build the registry @return {Ember.Registry} the built registry - @public + @private */ buildRegistry: function (application) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var registry = this._super.apply(this, arguments); @@ -5192,10 +5196,14 @@ @submodule ember-application */ 'use strict'; + var _templateObject = _taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); + + function _taggedTemplateLiteralLoose(strings, raw) { strings.raw = raw; return strings; } + /** The `EngineInstance` encapsulates all of the stateful aspects of a running `Engine`. @public @@ -5277,10 +5285,14 @@ _bootSync: function (options) { if (this._booted) { return this; } + if (false) { + this.cloneParentDependencies(); + } + this.base.runInstanceInitializers(this); this._booted = true; return this; @@ -5306,29 +5318,61 @@ this._super.apply(this, arguments); _emberMetalRun_loop.default(this.__container__, 'destroy'); } }); - exports.default = EngineInstance; -}); + if (false) { + EngineInstance.reopen({ + /** + Build a new `Ember.EngineInstance` that's a child of this instance. + Engines must be registered by name with their parent engine + (or application). + @private + @method buildChildEngineInstance + @param name {String} the registered name of the engine. + @param options {Object} options provided to the engine instance. + @return {Ember.EngineInstance,Error} + */ + buildChildEngineInstance: function (name) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; -/** - Build a new `Ember.EngineInstance` that's a child of this instance. - Engines must be registered by name with their parent engine - (or application). - @private - @method buildChildEngineInstance - @param name {String} the registered name of the engine. - @param options {Object} options provided to the engine instance. - @return {Ember.EngineInstance,Error} -*/ + var Engine = this.lookup('engine:' + name); -/** - Clone dependencies shared between an engine instance and its parent. - @private - @method cloneParentDependencies -*/ + if (!Engine) { + throw new _emberMetalError.default('You attempted to mount the engine \'' + name + '\', but it is not registered with its parent.'); + } + + var engineInstance = Engine.buildInstance(options); + + _emberApplicationSystemEngineParent.setEngineParent(engineInstance, this); + + return engineInstance; + }, + + /** + Clone dependencies shared between an engine instance and its parent. + @private + @method cloneParentDependencies + */ + cloneParentDependencies: function () { + var _this2 = this; + + var parent = _emberApplicationSystemEngineParent.getEngineParent(this); + + ['route:basic', 'event_dispatcher:main', _containerRegistry.privatize(_templateObject), 'service:-routing'].forEach(function (key) { + _this2.register(key, parent.resolveRegistration(key)); + }); + + ['router:main', '-view-registry:main'].forEach(function (key) { + _this2.register(key, parent.lookup(key), { instantiate: false }); + }); + } + }); + } + + exports.default = EngineInstance; +}); enifed('ember-application/system/engine-parent', ['exports', 'ember-metal/symbol'], function (exports, _emberMetalSymbol) { /** @module ember @submodule ember-application */ @@ -5412,11 +5456,11 @@ var Engine = _emberRuntimeSystemNamespace.default.extend(_emberRuntimeMixinsRegistry_proxy.default, { init: function () { this._super.apply(this, arguments); if (this[GLIMMER] === undefined) { - this[GLIMMER] = _emberMetalFeatures.default('ember-glimmer'); + this[GLIMMER] = false; } this.buildRegistry(); }, @@ -5694,17 +5738,16 @@ * all controllers receive the application as their `namespace` property * the application view receives the application controller as its `controller` property * the application view receives the application template as its `defaultTemplate` property - @private - @method buildRegistry + @method buildRegistry @static @param {Ember.Application} namespace the application for which to build the registry @return {Ember.Registry} the built registry - @public + @private */ buildRegistry: function (namespace) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var registry = new _containerRegistry.default({ @@ -5999,14 +6042,13 @@ /** Convert the string name of the form 'type:name' to a Javascript object with the parsed aspects of the name broken out. - @protected - @param {String} fullName the lookup string + @param {String} fullName the lookup string @method parseName - @public + @protected */ parseName: function (fullName) { return this._parseNameCache[fullName] || (this._parseNameCache[fullName] = this._parseName(fullName)); }, @@ -6050,14 +6092,13 @@ /** Returns a human-readable description for a fullName. Used by the Application namespace in assertions to describe the precise name of the class that Ember is looking for, rather than container keys. - @protected - @param {String} fullName the lookup string + @param {String} fullName the lookup string @method lookupDescription - @public + @protected */ lookupDescription: function (fullName) { var parsedName = this.parseName(fullName); var description; @@ -6079,81 +6120,75 @@ }, /** Given a parseName object (output from `parseName`), apply the conventions expected by `Ember.Router` - @protected - @param {Object} parsedName a parseName object with the parsed + @param {Object} parsedName a parseName object with the parsed fullName lookup string @method useRouterNaming - @public + @protected */ useRouterNaming: function (parsedName) { parsedName.name = parsedName.name.replace(/\./g, '_'); if (parsedName.name === 'basic') { parsedName.name = ''; } }, /** Look up the template in Ember.TEMPLATES - @protected - @param {Object} parsedName a parseName object with the parsed + @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveTemplate - @public + @protected */ resolveTemplate: function (parsedName) { var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/'); return _emberTemplatesTemplate_registry.get(templateName) || _emberTemplatesTemplate_registry.get(_emberRuntimeSystemString.decamelize(templateName)); }, /** Lookup the view using `resolveOther` - @protected - @param {Object} parsedName a parseName object with the parsed + @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveView - @public + @protected */ resolveView: function (parsedName) { this.useRouterNaming(parsedName); return this.resolveOther(parsedName); }, /** Lookup the controller using `resolveOther` - @protected - @param {Object} parsedName a parseName object with the parsed + @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveController - @public + @protected */ resolveController: function (parsedName) { this.useRouterNaming(parsedName); return this.resolveOther(parsedName); }, /** Lookup the route using `resolveOther` - @protected - @param {Object} parsedName a parseName object with the parsed + @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveRoute - @public + @protected */ resolveRoute: function (parsedName) { this.useRouterNaming(parsedName); return this.resolveOther(parsedName); }, /** Lookup the model on the Application namespace - @protected - @param {Object} parsedName a parseName object with the parsed + @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveModel - @public + @protected */ resolveModel: function (parsedName) { var className = _emberRuntimeSystemString.classify(parsedName.name); var factory = _emberMetalProperty_get.get(parsedName.root, className); @@ -6162,27 +6197,25 @@ } }, /** Look up the specified object (from parsedName) on the appropriate namespace (usually on the Application) - @protected - @param {Object} parsedName a parseName object with the parsed + @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveHelper - @public + @protected */ resolveHelper: function (parsedName) { return this.resolveOther(parsedName); }, /** Look up the specified object (from parsedName) on the appropriate namespace (usually on the Application) - @protected - @param {Object} parsedName a parseName object with the parsed + @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveOther - @public + @protected */ resolveOther: function (parsedName) { var className = _emberRuntimeSystemString.classify(parsedName.name) + _emberRuntimeSystemString.classify(parsedName.type); var factory = _emberMetalProperty_get.get(parsedName.root, className); if (factory) { @@ -6420,14 +6453,16 @@ /** If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace. ```javascript Ember.Logger.assert(true); // undefined Ember.Logger.assert(true === false); // Throws an Assertion failed error. + Ember.Logger.assert(true === false, 'Something invalid'); // Throws an Assertion failed error with message. ``` @method assert @for Ember.Logger @param {Boolean} bool Value to test + @param {String} message Assertion message on failed @public */ assert: consoleMethod('assert') || assertPolyfill }; }); @@ -7379,11 +7414,11 @@ var parentView = _emberMetalProperty_get.get(this, 'parentView'); return parentView ? _emberMetalProperty_get.get(parentView, 'controller') : null; }), /** - Calls a action passed to a component. + Calls an action passed to a component. For example a component for playing or pausing music may translate click events into action notifications of "play" or "stop" depending on some internal state of the component: ```javascript // app/components/play-button.js @@ -8380,12 +8415,11 @@ return _emberMetalProperty_get.get(this, 'active') && !willBeActive && 'ember-transitioning-out'; }), /** Event handler that invokes the link, activating the associated route. - @private - @method _invoke + @method _invoke @param {Event} event @private */ _invoke: function (event) { if (!_emberViewsSystemUtils.isSimpleClick(event)) { @@ -9759,13 +9793,19 @@ } } // Determine if this is an initial render or a re-render. if (state.manager) { - var templateMeta = state.manager.block.template.meta; + var sm = state.manager; + var templateMeta = null; + if (sm.block) { + templateMeta = sm.block.template.meta; + } else if (sm.scope && sm.scope._view) { + templateMeta = sm.scope._view.template.meta; + } env.meta.moduleName = templateMeta && templateMeta.moduleName || env.meta && env.meta.moduleName; - _emberHtmlbarsUtilsExtractPositionalParams.default(renderNode, state.manager.component.constructor, params, attrs, false); + _emberHtmlbarsUtilsExtractPositionalParams.default(renderNode, sm.component.constructor, params, attrs, false); state.manager.rerender(env, attrs, visitor); return; } var parentView = env.view; @@ -12006,11 +12046,10 @@ The `mut` helper changes the `totalClicks` value to what was provided as the action argument. See a [2.0 blog post](http://emberjs.com/blog/2015/05/10/run-up-to-two-oh.html#toc_the-code-mut-code-helper) for additional information on using `{{mut}}`. - @public @method mut @param {Object} [attr] the "two-way" attribute that can be modified. @for Ember.Templates.helpers @public */ @@ -12072,11 +12111,13 @@ @submodule ember-templates */ 'use strict'; - _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@' + _emberVersion.default; + if (!false) { + _emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@' + _emberVersion.default; + } /** The `{{outlet}}` helper lets you specify where a child route will render in your template. An important use of the `{{outlet}}` helper is in your application's `application.hbs` file: @@ -12124,11 +12165,10 @@ 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 */ @@ -15477,11 +15517,11 @@ props._morph = morph; return parentView.appendChild(viewClassOrInstance, props); } }); -enifed('ember-htmlbars/system/build-component-template', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'htmlbars-runtime', 'ember-htmlbars/hooks/get-value', 'ember-htmlbars/streams/utils'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _htmlbarsRuntime, _emberHtmlbarsHooksGetValue, _emberHtmlbarsStreamsUtils) { +enifed('ember-htmlbars/system/build-component-template', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'htmlbars-runtime', 'htmlbars-util/template-utils', 'ember-htmlbars/hooks/get-value', 'ember-htmlbars/streams/utils'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _htmlbarsRuntime, _htmlbarsUtilTemplateUtils, _emberHtmlbarsHooksGetValue, _emberHtmlbarsStreamsUtils) { 'use strict'; exports.default = buildComponentTemplate; exports.buildHTMLTemplate = buildHTMLTemplate; @@ -15537,11 +15577,11 @@ var val = _attrs[prop]; if (typeof val === 'string') { attrs[prop] = val; } else { - attrs[prop] = ['value', val]; + attrs[prop] = _htmlbarsUtilTemplateUtils.buildStatement('value', val); } } var childTemplate = content.templates.default; var elementTemplate = _htmlbarsRuntime.internal.manualElement(tagName, attrs, childTemplate.isEmpty); @@ -15641,21 +15681,21 @@ var attrName = undefined, expression = undefined; if (colonIndex !== -1) { var attrProperty = attr.substring(0, colonIndex); attrName = attr.substring(colonIndex + 1); - expression = ['get', '' + streamBasePath + attrProperty]; + expression = _htmlbarsUtilTemplateUtils.buildStatement('get', '' + streamBasePath + attrProperty); } else if (attrs[attr]) { // TODO: For compatibility with 1.x, we probably need to `set` // the component's attribute here if it is a CP, but we also // probably want to suspend observers and allow the // willUpdateAttrs logic to trigger observers at the correct time. attrName = attr; - expression = ['value', attrs[attr]]; + expression = _htmlbarsUtilTemplateUtils.buildStatement('value', attrs[attr]); } else { attrName = attr; - expression = ['get', '' + streamBasePath + attr]; + expression = _htmlbarsUtilTemplateUtils.buildStatement('get', '' + streamBasePath + attr); } normalized[attrName] = expression; } } @@ -15668,15 +15708,15 @@ if (normalizedClass) { normalized.class = normalizedClass; } if (_emberMetalProperty_get.get(component, 'isVisible') === false) { - var hiddenStyle = ['subexpr', '-html-safe', ['display: none;'], []]; + var hiddenStyle = _htmlbarsUtilTemplateUtils.buildStatement('subexpr', '-html-safe', ['display: none;'], []); var existingStyle = normalized.style; if (existingStyle) { - normalized.style = ['subexpr', 'concat', [existingStyle, ' ', hiddenStyle], []]; + normalized.style = _htmlbarsUtilTemplateUtils.buildStatement('subexpr', 'concat', [existingStyle, ' ', hiddenStyle], []); } else { normalized.style = hiddenStyle; } } @@ -15689,11 +15729,11 @@ var classNames = _emberMetalProperty_get.get(component, 'classNames'); var classNameBindings = _emberMetalProperty_get.get(component, 'classNameBindings'); if (attrs.class) { if (_emberHtmlbarsStreamsUtils.isStream(attrs.class)) { - normalizedClass.push(['subexpr', '-normalize-class', [['value', attrs.class.path], ['value', attrs.class]], []]); + normalizedClass.push(_htmlbarsUtilTemplateUtils.buildStatement('subexpr', '-normalize-class', [_htmlbarsUtilTemplateUtils.buildStatement('value', attrs.class.path), _htmlbarsUtilTemplateUtils.buildStatement('value', attrs.class)], [])); } else { normalizedClass.push(attrs.class); } } @@ -15710,11 +15750,11 @@ if (classNameBindings) { normalizeClasses(classNameBindings, normalizedClass, streamBasePath); } if (normalizeClass.length) { - return ['subexpr', '-join-classes', normalizedClass, []]; + return _htmlbarsUtilTemplateUtils.buildStatement('subexpr', '-join-classes', normalizedClass, []); } } function normalizeClasses(classes, output, streamBasePath) { var i; @@ -15734,15 +15774,15 @@ continue; } var prop = '' + streamBasePath + propName; - output.push(['subexpr', '-normalize-class', [ + output.push(_htmlbarsUtilTemplateUtils.buildStatement('subexpr', '-normalize-class', [ // params - ['value', propName], ['get', prop]], [ + _htmlbarsUtilTemplateUtils.buildStatement('value', propName), _htmlbarsUtilTemplateUtils.buildStatement('get', prop)], [ // hash - 'activeClass', activeClass, 'inactiveClass', inactiveClass]]); + 'activeClass', activeClass, 'inactiveClass', inactiveClass])); } } function validateTaglessComponent(component) {} }); @@ -16086,11 +16126,11 @@ morphs[0] = dom.createMorphAt(fragment, 0, 0, contextualElement); dom.insertBoundary(fragment, 0); dom.insertBoundary(fragment, null); return morphs; }, - statements: [["content", "yield", ["loc", [null, [1, 0], [1, 9]]]]], + statements: [["content", "yield", ["loc", [null, [1, 0], [1, 9]]], 0, 0, 0, 0]], locals: [], templates: [] }; })()); }); @@ -16139,11 +16179,11 @@ morphs[0] = dom.createMorphAt(fragment, 0, 0, contextualElement); dom.insertBoundary(fragment, 0); dom.insertBoundary(fragment, null); return morphs; }, - statements: [["content", "linkTitle", ["loc", [null, [1, 17], [1, 30]]]]], + statements: [["content", "linkTitle", ["loc", [null, [1, 17], [1, 30]]], 0, 0, 0, 0]], locals: [], templates: [] }; })(); var child1 = (function () { @@ -16164,11 +16204,11 @@ morphs[0] = dom.createMorphAt(fragment, 0, 0, contextualElement); dom.insertBoundary(fragment, 0); dom.insertBoundary(fragment, null); return morphs; }, - statements: [["content", "yield", ["loc", [null, [1, 38], [1, 47]]]]], + statements: [["content", "yield", ["loc", [null, [1, 38], [1, 47]]], 0, 0, 0, 0]], locals: [], templates: [] }; })(); return { @@ -16188,11 +16228,11 @@ morphs[0] = dom.createMorphAt(fragment, 0, 0, contextualElement); dom.insertBoundary(fragment, 0); dom.insertBoundary(fragment, null); return morphs; }, - statements: [["block", "if", [["get", "linkTitle", ["loc", [null, [1, 6], [1, 15]]]]], [], 0, 1, ["loc", [null, [1, 0], [1, 54]]]]], + statements: [["block", "if", [["get", "linkTitle", ["loc", [null, [1, 6], [1, 15]]], 0, 0, 0, 0]], [], 0, 1, ["loc", [null, [1, 0], [1, 54]]]]], locals: [], templates: [child0, child1] }; })()); }); @@ -16217,11 +16257,11 @@ morphs[0] = dom.createMorphAt(fragment, 0, 0, contextualElement); dom.insertBoundary(fragment, 0); dom.insertBoundary(fragment, null); return morphs; }, - statements: [["content", "outlet", ["loc", [null, [1, 0], [1, 10]]]]], + statements: [["content", "outlet", ["loc", [null, [1, 0], [1, 10]]], 0, 0, 0, 0]], locals: [], templates: [] }; })()); }); @@ -19160,11 +19200,11 @@ } else { target[method](); } } else { if (params) { - _emberMetalUtils.apply(target, method, params); + method.apply(target, params); } else { method.call(target); } } } @@ -19890,14 +19930,17 @@ return callback.call(binding); } } var flaggedInstrument; - - exports.flaggedInstrument = flaggedInstrument = function (name, payload, callback) { - return callback(); - }; + if (false) { + exports.flaggedInstrument = flaggedInstrument = instrument; + } else { + exports.flaggedInstrument = flaggedInstrument = function (name, payload, callback) { + return callback(); + }; + } exports.flaggedInstrument = flaggedInstrument; function withFinalizer(callback, finalizer, payload, binding) { var result = undefined; try { @@ -20260,10 +20303,16 @@ this._registry.splice(index, 1); } } }; + if (false) { + Libraries.prototype.isRegistered = function (name) { + return !!this._getLibraryByName(name); + }; + } + exports.default = new Libraries(); }); enifed('ember-metal/map', ['exports', 'ember-metal/utils', 'ember-metal/empty_object'], function (exports, _emberMetalUtils, _emberMetalEmpty_object) { /** @module ember @@ -20509,17 +20558,17 @@ @namespace Ember @private @constructor */ function Map() { - if (this instanceof this.constructor) { + if (this instanceof Map) { this._keys = OrderedSet.create(); this._keys._silenceRemoveDeprecation = true; this._values = new _emberMetalEmpty_object.default(); this.size = 0; } else { - missingNew('OrderedSet'); + missingNew('Map'); } } /** @method create @@ -21113,10 +21162,42 @@ var EMBER_META_PROPERTY = { name: META_FIELD, descriptor: META_DESC }; + if (false) { + Meta.prototype.readInheritedValue = function (key, subkey) { + var internalKey = '_' + key; + + var pointer = this; + + while (pointer !== undefined) { + var map = pointer[internalKey]; + if (map) { + var value = map[subkey]; + if (value !== undefined || subkey in map) { + return map[subkey]; + } + } + pointer = pointer.parent; + } + + return UNDEFINED; + }; + + Meta.prototype.writeValue = function (obj, key, value) { + var descriptor = _emberMetalUtils.lookupDescriptor(obj, key); + var isMandatorySetter = descriptor && descriptor.set && descriptor.set.isMandatorySetter; + + if (isMandatorySetter) { + this.writeValues(key, value); + } else { + obj[key] = value; + } + }; + } + // choose the one appropriate for given platform var setMeta = function (obj, meta) { // if `null` already, just set it to the new value // otherwise define property first if (obj[META_FIELD] !== null) { @@ -22651,21 +22732,53 @@ existingDesc.teardown(obj, keyName); } if (desc instanceof Descriptor) { value = desc; - - obj[keyName] = value; - + if (false) { + if (watching) { + Object.defineProperty(obj, keyName, { + configurable: true, + enumerable: true, + writable: true, + value: value + }); + } else { + obj[keyName] = value; + } + } else { + obj[keyName] = value; + } if (desc.setup) { desc.setup(obj, keyName); } } else { if (desc == null) { value = data; - obj[keyName] = data; + if (false) { + if (watching) { + meta.writeValues(keyName, data); + + var defaultDescriptor = { + configurable: true, + enumerable: true, + set: MANDATORY_SETTER_FUNCTION(keyName), + get: DEFAULT_GETTER_FUNCTION(keyName) + }; + + if (REDEFINE_SUPPORTED) { + Object.defineProperty(obj, keyName, defaultDescriptor); + } else { + handleBrokenPhantomDefineProperty(obj, keyName, defaultDescriptor); + } + } else { + obj[keyName] = data; + } + } else { + obj[keyName] = data; + } } else { value = desc; // fallback to ES5 Object.defineProperty(obj, keyName, desc); @@ -23155,18 +23268,42 @@ /* no change */ return value; } else { _emberMetalProperty_events.propertyWillChange(obj, keyName); - obj[keyName] = value; + if (false) { + setWithMandatorySetter(meta, obj, keyName, value); + } else { + obj[keyName] = value; + } _emberMetalProperty_events.propertyDidChange(obj, keyName); } return value; } + if (false) { + var setWithMandatorySetter = function (meta, obj, keyName, value) { + if (meta && meta.peekWatching(keyName) > 0) { + makeEnumerable(obj, keyName); + meta.writeValue(obj, keyName, value); + } else { + obj[keyName] = value; + } + }; + + var makeEnumerable = function (obj, key) { + var desc = Object.getOwnPropertyDescriptor(obj, key); + + if (desc && desc.set && desc.set.isMandatorySetter) { + desc.enumerable = true; + Object.defineProperty(obj, key, desc); + } + }; + } + function setPath(root, path, value, tolerant) { var keyName; // get the last part of the path keyName = path.slice(path.lastIndexOf('.') + 1); @@ -23215,15 +23352,14 @@ } }); 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) { + function replace(array, idx, amt, objects) { var args = [].concat(objects); var ret = []; // https://code.google.com/p/chromium/issues/detail?id=56588 var size = 60000; var start = idx; @@ -23244,46 +23380,10 @@ ret = ret.concat(splice.apply(array, chunk)); } return ret; } - - /** - Replaces objects in an array with the passed objects. - - ```javascript - var array = [1,2,3]; - Ember.EnumerableUtils.replace(array, 1, 2, [4, 5]); // [1, 4, 5] - - var array = [1,2,3]; - Ember.EnumerableUtils.replace(array, 1, 1, [4, 5]); // [1, 4, 5, 3] - - var array = [1,2,3]; - Ember.EnumerableUtils.replace(array, 10, 1, [4, 5]); // [1, 2, 3, 4, 5] - ``` - - @method replace - @deprecated - @param {Array} array The array the objects should be inserted into. - @param {Number} idx Starting index in the array to replace. If *idx* >= - length, then append to the end of the array. - @param {Number} amt Number of elements that should be removed from the array, - starting at *idx* - @param {Array} objects An array of zero or more objects that should be - inserted into the array at *idx* - - @return {Array} The modified array. - @public - */ - - function replace(array, idx, amt, objects) { - if (array.replace) { - return array.replace(idx, amt, objects); - } else { - return _replace(array, idx, amt, objects); - } - } }); enifed('ember-metal/run_loop', ['exports', 'ember-metal/debug', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/utils', 'ember-metal/property_events', 'backburner'], function (exports, _emberMetalDebug, _emberMetalTesting, _emberMetalError_handler, _emberMetalUtils, _emberMetalProperty_events, _backburner) { 'use strict'; exports.default = run; @@ -24124,11 +24224,10 @@ exports.guidFor = guidFor; exports.wrap = wrap; exports.tryInvoke = tryInvoke; exports.makeArray = makeArray; exports.inspect = inspect; - exports.apply = apply; exports.applyStr = applyStr; exports.lookupDescriptor = lookupDescriptor; exports.toString = toString; var _uuid = 0; @@ -24366,19 +24465,20 @@ return ret; } } var HAS_SUPER_PATTERN = /\.(_super|call\(this|apply\(this)/; + var fnToString = Function.prototype.toString; var checkHasSuper = (function () { - var sourceAvailable = (function () { + var sourceAvailable = fnToString.call(function () { return this; - }).toString().indexOf('return this') > -1; + }).indexOf('return this') > -1; if (sourceAvailable) { return function checkHasSuper(func) { - return HAS_SUPER_PATTERN.test(func.toString()); + return HAS_SUPER_PATTERN.test(fnToString.call(func)); }; } return function checkHasSuper() { return true; @@ -24421,35 +24521,12 @@ } function _wrap(func, superFunc) { function superWrapper() { var orig = this._super; - var ret = undefined; this._super = superFunc; - switch (arguments.length) { - case 0: - ret = func.call(this);break; - case 1: - ret = func.call(this, arguments[0]);break; - case 2: - ret = func.call(this, arguments[0], arguments[1]);break; - case 3: - ret = func.call(this, arguments[0], arguments[1], arguments[2]);break; - case 4: - ret = func.call(this, arguments[0], arguments[1], arguments[2], arguments[3]);break; - case 5: - ret = func.call(this, arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);break; - default: - // v8 bug potentially incorrectly deopts this function: https://code.google.com/p/v8/issues/detail?id=3709 - // we may want to keep this around till this ages out on mobile - var args = new Array(arguments.length); - for (var x = 0; x < arguments.length; x++) { - args[x] = arguments[x]; - } - ret = func.apply(this, args); - break; - } + var ret = func.apply(this, arguments); this._super = orig; return ret; } superWrapper.wrappedFunction = func; @@ -24602,42 +24679,12 @@ } } return '{' + ret.join(', ') + '}'; } - // The following functions are intentionally minified to keep the functions - // below Chrome's function body size inlining limit of 600 chars. /** @param {Object} t target - @param {Function} m method - @param {Array} a args - @private - */ - - function apply(t, m, a) { - var l = a && a.length; - if (!a || !l) { - return m.call(t); - } - switch (l) { - case 1: - return m.call(t, a[0]); - case 2: - return m.call(t, a[0], a[1]); - case 3: - return m.call(t, a[0], a[1], a[2]); - case 4: - return m.call(t, a[0], a[1], a[2], a[3]); - case 5: - return m.call(t, a[0], a[1], a[2], a[3], a[4]); - default: - return m.apply(t, a); - } - } - - /** - @param {Object} t target @param {String} m method @param {Array} a args @private */ @@ -24714,15 +24761,67 @@ } if ('function' === typeof obj.willWatchProperty) { obj.willWatchProperty(keyName); } + + if (false) { + // NOTE: this is dropped for prod + minified builds + handleMandatorySetter(m, obj, keyName); + } } else { m.writeWatching(keyName, (m.peekWatching(keyName) || 0) + 1); } } + if (false) { + (function () { + var hasOwnProperty = function (obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); + }; + + var propertyIsEnumerable = function (obj, key) { + return Object.prototype.propertyIsEnumerable.call(obj, key); + }; + + // Future traveler, although this code looks scary. It merely exists in + // development to aid in development asertions. Production builds of + // ember strip this entire block out + handleMandatorySetter = function handleMandatorySetter(m, obj, keyName) { + var descriptor = _emberMetalUtils.lookupDescriptor(obj, keyName); + var configurable = descriptor ? descriptor.configurable : true; + var isWritable = descriptor ? descriptor.writable : true; + var hasValue = descriptor ? 'value' in descriptor : true; + var possibleDesc = descriptor && descriptor.value; + var isDescriptor = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor; + + if (isDescriptor) { + return; + } + + // this x in Y deopts, so keeping it in this function is better; + if (configurable && isWritable && hasValue && keyName in obj) { + var desc = { + configurable: true, + set: _emberMetalProperties.MANDATORY_SETTER_FUNCTION(keyName), + enumerable: propertyIsEnumerable(obj, keyName), + get: undefined + }; + + if (hasOwnProperty(obj, keyName)) { + m.writeValues(keyName, obj[keyName]); + desc.get = _emberMetalProperties.DEFAULT_GETTER_FUNCTION(keyName); + } else { + desc.get = _emberMetalProperties.INHERITING_GETTER_FUNCTION(keyName); + } + + Object.defineProperty(obj, keyName, desc); + } + }; + })(); + } + function unwatchKey(obj, keyName, meta) { var m = meta || _emberMetalMeta.meta(obj); var count = m.peekWatching(keyName); if (count === 1) { m.writeWatching(keyName, 0); @@ -24735,32 +24834,47 @@ } if ('function' === typeof obj.didUnwatchProperty) { obj.didUnwatchProperty(keyName); } + + if (false) { + // It is true, the following code looks quite WAT. But have no fear, It + // exists purely to improve development ergonomics and is removed from + // ember.min.js and ember.prod.js builds. + // + // Some further context: Once a property is watched by ember, bypassing `set` + // for mutation, will bypass observation. This code exists to assert when + // that occurs, and attempt to provide more helpful feedback. The alternative + // is tricky to debug partially observable properties. + if (!desc && keyName in obj) { + var maybeMandatoryDescriptor = _emberMetalUtils.lookupDescriptor(obj, keyName); + + if (maybeMandatoryDescriptor.set && maybeMandatoryDescriptor.set.isMandatorySetter) { + if (maybeMandatoryDescriptor.get && maybeMandatoryDescriptor.get.isInheritingGetter) { + var possibleValue = m.readInheritedValue('values', keyName); + if (possibleValue === _emberMetalMeta.UNDEFINED) { + delete obj[keyName]; + return; + } + } + + Object.defineProperty(obj, keyName, { + configurable: true, + enumerable: Object.prototype.propertyIsEnumerable.call(obj, keyName), + writable: true, + value: m.peekValues(keyName) + }); + m.deleteFromValues(keyName); + } + } + } } else if (count > 1) { m.writeWatching(keyName, count - 1); } } }); - -// NOTE: this is dropped for prod + minified builds - -// Future traveler, although this code looks scary. It merely exists in -// development to aid in development asertions. Production builds of -// ember strip this entire block out - -// this x in Y deopts, so keeping it in this function is better; - -// It is true, the following code looks quite WAT. But have no fear, It -// exists purely to improve development ergonomics and is removed from -// ember.min.js and ember.prod.js builds. -// -// Some further context: Once a property is watched by ember, bypassing `set` -// for mutation, will bypass observation. This code exists to assert when -// that occurs, and attempt to provide more helpful feedback. The alternative -// is tricky to debug partially observable properties. enifed('ember-metal/watch_path', ['exports', 'ember-metal/meta', 'ember-metal/chains'], function (exports, _emberMetalMeta, _emberMetalChains) { 'use strict'; exports.makeChainNode = makeChainNode; exports.watchPath = watchPath; @@ -26419,10 +26533,14 @@ this.parent = name; this.enableLoadingSubstates = options && options.enableLoadingSubstates; this.matches = []; this.explicitIndex = undefined; this.options = options; + + if (false) { + this.router = options && options.router; + } } exports.default = DSL; DSL.prototype = { @@ -26440,11 +26558,11 @@ if (this.enableLoadingSubstates) { createRoute(this, name + '_loading', { resetNamespace: options.resetNamespace }); createRoute(this, name + '_error', { path: dummyErrorRoute }); } - if (_emberMetalFeatures.default('ember-route-serializers') && options.serialize && this.router) { + if (false && options.serialize && this.router) { this.router._serializeMethods[name] = options.serialize; } if (callback) { var fullName = getFullName(this, name, options.resetNamespace); @@ -26635,10 +26753,14 @@ return object; } var DEFAULT_SERIALIZE = _emberMetalSymbol.default('DEFAULT_SERIALIZE'); + if (false) { + defaultSerialize[DEFAULT_SERIALIZE] = true; + } + function hasDefaultSerialize(route) { return !!route.serialize[DEFAULT_SERIALIZE]; } /** @@ -26731,10 +26853,14 @@ controllerProto = definedControllerClass.proto(); var controllerDefinedQueryParameterConfiguration = _emberMetalProperty_get.get(controllerProto, 'queryParams'); var normalizedControllerQueryParameterConfiguration = _emberRoutingUtils.normalizeControllerQueryParams(controllerDefinedQueryParameterConfiguration); combinedQueryParameterConfiguration = mergeEachQueryParams(normalizedControllerQueryParameterConfiguration, queryParameterConfiguraton); + + if (false) { + if (controllerDefinedQueryParameterConfiguration.length) {} + } } else if (hasRouterDefinedQueryParams) { // the developer has not defined a controller but *has* supplied route query params. // Generate a class for them so we can later insert default values var generatedControllerClass = _emberRoutingSystemGenerate_controller.generateControllerFactory(_containerOwner.getOwner(this), controllerName); controllerProto = generatedControllerClass.proto(); @@ -26757,10 +26883,23 @@ continue; } var desc = combinedQueryParameterConfiguration[propName]; + if (false) { + // apply default values to controllers + // detect that default value defined on router config + if (desc.hasOwnProperty('defaultValue')) { + // detect that property was not defined on controller + if (controllerProto[propName] === undefined) { + controllerProto[propName] = desc.defaultValue; + } else { + deprecateQueryParamDefaultValuesSetOnController(controllerName, this.routeName, propName); + } + } + } + var scope = desc.scope || 'model'; var parts; if (scope === 'controller') { parts = []; @@ -28427,13 +28566,17 @@ // hierarchy so that any existing other renders that target it // don't suddenly blow up. They will still stick themselves // into its outlets, which won't render anywhere. All of this // statefulness should get the machete in 2.0. this.connections[i] = { + owner: connection.owner, into: connection.into, outlet: connection.outlet, - name: connection.name + name: connection.name, + controller: undefined, + template: undefined, + ViewClass: undefined }; _emberMetalRun_loop.default.once(this.router, '_setOutlets'); } } }, @@ -28598,16 +28741,20 @@ */ function mergeEachQueryParams(controllerQP, routeQP) { var keysAlreadyMergedOrSkippable; var qps = {}; - keysAlreadyMergedOrSkippable = { - defaultValue: true, - type: true, - scope: true, - as: true - }; + if (false) { + keysAlreadyMergedOrSkippable = {}; + } else { + keysAlreadyMergedOrSkippable = { + defaultValue: true, + type: true, + scope: true, + as: true + }; + } // first loop over all controller qps, merging them with any matching route qps // into a new empty object to avoid mutating. for (var cqpName in controllerQP) { if (!controllerQP.hasOwnProperty(cqpName)) { @@ -28647,15 +28794,10 @@ function deprecateQueryParamDefaultValuesSetOnController(controllerName, routeName, propName) {} exports.default = Route; }); - -// 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-console', 'ember-metal/debug', 'ember-metal/error', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/properties', 'ember-metal/empty_object', 'ember-metal/computed', 'ember-metal/assign', 'ember-metal/run_loop', 'ember-runtime/system/object', 'ember-runtime/mixins/evented', 'ember-routing/system/route', 'ember-routing/system/dsl', 'ember-routing/location/api', 'ember-routing/utils', 'ember-metal/utils', 'ember-routing/system/router_state', 'container/owner', 'ember-metal/dictionary', 'router', 'router/transition'], function (exports, _emberConsole, _emberMetalDebug, _emberMetalError, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalProperties, _emberMetalEmpty_object, _emberMetalComputed, _emberMetalAssign, _emberMetalRun_loop, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented, _emberRoutingSystemRoute, _emberRoutingSystemDsl, _emberRoutingLocationApi, _emberRoutingUtils, _emberMetalUtils, _emberRoutingSystemRouter_state, _containerOwner, _emberMetalDictionary, _router4, _routerTransition) { 'use strict'; exports.triggerEvent = triggerEvent; @@ -28728,20 +28870,28 @@ var moduleBasedResolver = this._hasModuleBasedResolver(); var options = { enableLoadingSubstates: !!moduleBasedResolver }; + if (false) { + options.router = this; + } + return new _emberRoutingSystemDsl.default(null, options); }, init: function () { this._super.apply(this, arguments); this._activeViews = {}; this._qpCache = new _emberMetalEmpty_object.default(); this._resetQueuedQueryParameterChanges(); this._handledErrors = _emberMetalDictionary.default(null); + + if (false) { + this._serializeMethods = new _emberMetalEmpty_object.default(); + } }, /* Resets all pending query paramter changes. Called after transitioning to a new route @@ -29193,10 +29343,14 @@ var lastURL; var emberRouter = this; router.getHandler = this._getHandlerFunction(); + if (false) { + router.getSerializer = this._getSerializerFunction(); + } + var doUpdateURL = function () { location.setURL(lastURL); }; router.updateURL = function (path) { @@ -29266,16 +29420,13 @@ _doTransition: function (_targetRouteName, models, _queryParams) { var targetRouteName = _targetRouteName || _emberRoutingUtils.getActiveTargetName(this.router); var queryParams = {}; - // merge in any queryParams from the active transition which could include - // queryparams from the url on initial load. - if (this.router.activeTransition) { - _emberMetalAssign.default(queryParams, this.router.activeTransition.queryParams); - } + this._processActiveTransitionQueryParams(targetRouteName, models, queryParams, _queryParams); + _emberMetalAssign.default(queryParams, _queryParams); this._prepareQueryParams(targetRouteName, models, queryParams); var transitionArgs = _emberRoutingUtils.routeArgs(targetRouteName, models, queryParams); var transition = this.router.transitionTo.apply(this.router, transitionArgs); @@ -29283,10 +29434,33 @@ didBeginTransition(transition, this); return transition; }, + _processActiveTransitionQueryParams: function (targetRouteName, models, queryParams, _queryParams) { + // merge in any queryParams from the active transition which could include + // queryParams from the url on initial load. + if (!this.router.activeTransition) { + return; + } + + var unchangedQPs = {}; + var qpUpdates = this._qpUpdates || {}; + for (var key in this.router.activeTransition.queryParams) { + if (!qpUpdates[key]) { + unchangedQPs[key] = this.router.activeTransition.queryParams[key]; + } + } + + // We need to fully scope queryParams so that we can create one object + // that represents both pased in queryParams and ones that aren't changed + // from the active transition. + this._fullyScopeQueryParams(targetRouteName, models, _queryParams); + this._fullyScopeQueryParams(targetRouteName, models, unchangedQPs); + _emberMetalAssign.default(queryParams, unchangedQPs); + }, + _prepareQueryParams: function (targetRouteName, models, queryParams) { this._hydrateUnsuppliedQueryParams(targetRouteName, models, queryParams); this._serializeQueryParams(targetRouteName, queryParams); this._pruneDefaultQueryParamValues(targetRouteName, queryParams); }, @@ -29328,10 +29502,34 @@ qps: qps, map: map }; }, + _fullyScopeQueryParams: function (leafRouteName, contexts, queryParams) { + var state = calculatePostTransitionState(this, leafRouteName, contexts); + var handlerInfos = state.handlerInfos; + _emberRoutingUtils.stashParamNames(this, handlerInfos); + + for (var i = 0, len = handlerInfos.length; i < len; ++i) { + var route = handlerInfos[i].handler; + var qpMeta = _emberMetalProperty_get.get(route, '_qp'); + + for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) { + var qp = qpMeta.qps[j]; + + var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey; + + if (presentProp) { + if (presentProp !== qp.scopedPropertyName) { + queryParams[qp.scopedPropertyName] = queryParams[presentProp]; + delete queryParams[presentProp]; + } + } + } + } + }, + _hydrateUnsuppliedQueryParams: function (leafRouteName, contexts, queryParams) { var state = calculatePostTransitionState(this, leafRouteName, contexts); var handlerInfos = state.handlerInfos; var appCache = this._bucketCache; _emberRoutingUtils.stashParamNames(this, handlerInfos); @@ -29341,11 +29539,11 @@ var qpMeta = _emberMetalProperty_get.get(route, '_qp'); for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) { var qp = qpMeta.qps[j]; - var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName; + var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey; if (presentProp) { if (presentProp !== qp.scopedPropertyName) { queryParams[qp.scopedPropertyName] = queryParams[presentProp]; delete queryParams[presentProp]; @@ -29606,10 +29804,14 @@ return state; } function updatePaths(router) { var infos = router.router.currentHandlerInfos; + if (infos.length === 0) { + return; + } + var path = EmberRouter._routePath(infos); var currentRouteName = infos[infos.length - 1].name; _emberMetalProperty_set.set(router, 'currentPath', path); _emberMetalProperty_set.set(router, 'currentRouteName', currentRouteName); @@ -30109,11 +30311,11 @@ // __...--.'``;. ,. ;``--..__ .' ,-._ _.-' // _..-''-------' `' `' `' O ``-''._ (,;') _,' // ,'________________ \`-._`-',' // `._ ```````````------...___ '-.._'-: // ```--.._ ,. ````--...__\-. - // `.--. `-` "INFINTIY IS LESS ____ | |` + // `.--. `-` "INFINITY IS LESS ____ | |` // `. `. THAN BEYOND" ,'`````. ; ;` // `._`. __________ `. \'__/` // `-:._____/______/___/____`. \ ` // | `._ `. \ // `._________`-. `. `.___ @@ -31843,17 +32045,10 @@ } return _copy(obj, deep, deep ? [] : null, deep ? [] : null); } }); -enifed("ember-runtime/core", ["exports"], function (exports) { - "use strict"; -}); -/** -@module ember -@submodule ember-runtime -*/ enifed('ember-runtime/ext/function', ['exports', 'ember-environment', 'ember-metal/debug', 'ember-metal/computed', 'ember-metal/mixin'], function (exports, _emberEnvironment, _emberMetalDebug, _emberMetalComputed, _emberMetalMixin) { /** @module ember @submodule ember-runtime */ @@ -31903,11 +32098,11 @@ Make sure you list these dependencies so Ember knows when to update bindings that connect to a computed property. Changing a dependency will not immediately trigger an update of the computed property, but will instead clear the cache so that it is updated when the next `get` is called on the property. - See [Ember.ComputedProperty](/api/classes/Ember.ComputedProperty.html), [Ember.computed](/api/#method_computed). + See [Ember.ComputedProperty](/api/classes/Ember.ComputedProperty.html), [Ember.computed](/api/classes/Ember.computed.html). @method property @for Function @public */ FunctionPrototype.property = function () { @@ -32240,11 +32435,13 @@ EmComputed.mapBy = _emberRuntimeComputedReduce_computed_macros.mapBy; EmComputed.filter = _emberRuntimeComputedReduce_computed_macros.filter; EmComputed.filterBy = _emberRuntimeComputedReduce_computed_macros.filterBy; EmComputed.uniq = _emberRuntimeComputedReduce_computed_macros.uniq; - EmComputed.uniqBy = _emberRuntimeComputedReduce_computed_macros.uniqBy; + if (true) { + EmComputed.uniqBy = _emberRuntimeComputedReduce_computed_macros.uniqBy; + } EmComputed.union = _emberRuntimeComputedReduce_computed_macros.union; EmComputed.intersect = _emberRuntimeComputedReduce_computed_macros.intersect; EmComputed.collect = _emberRuntimeComputedReduce_computed_macros.collect; @@ -32853,10 +33050,11 @@ }), _Mixin$create.firstObject = _emberMetalComputed.computed(function () { return objectAt(this, 0); }).readOnly(), _Mixin$create.lastObject = _emberMetalComputed.computed(function () { return objectAt(this, _emberMetalProperty_get.get(this, 'length') - 1); }).readOnly(), _Mixin$create.contains = function (obj) { + if (false) {} return this.indexOf(obj) >= 0; }, _Mixin$create.slice = function (beginIndex, endIndex) { var ret = _emberMetalCore.default.A(); var length = _emberMetalProperty_get.get(this, 'length'); @@ -33023,10 +33221,60 @@ } return this.__each; }).volatile(), _Mixin$create)); + if (false) { + ArrayMixin.reopen({ + /** + Returns `true` if the passed object can be found in the array. + This method is a Polyfill for ES 2016 Array.includes. + If no `startAt` argument is given, the starting location to + search is 0. If it's negative, searches from the index of + `this.length + startAt` by asc. + ```javascript + [1, 2, 3].includes(2); // true + [1, 2, 3].includes(4); // false + [1, 2, 3].includes(3, 2); // true + [1, 2, 3].includes(3, 3); // false + [1, 2, 3].includes(3, -1); // true + [1, 2, 3].includes(1, -1); // false + [1, 2, 3].includes(1, -4); // true + [1, 2, NaN].includes(NaN); // true + ``` + @method includes + @param {Object} obj The object to search for. + @param {Number} startAt optional starting location to search, default 0 + @return {Boolean} `true` if object is found in the array. + @public + */ + includes: function (obj, startAt) { + var len = _emberMetalProperty_get.get(this, 'length'); + var idx, currentObj; + + if (startAt === undefined) { + startAt = 0; + } + + if (startAt < 0) { + startAt += len; + } + + for (idx = startAt; idx < len; idx++) { + currentObj = objectAt(this, idx); + + // SameValueZero comparison (NaN !== NaN) + if (obj === currentObj || obj !== obj && currentObj !== currentObj) { + return true; + } + } + + return false; + } + }); + } + exports.default = ArrayMixin; }); // ES6TODO: Ember.A /** @@ -33239,35 +33487,10 @@ }); ``` @property @each @public */ - -/** - Returns `true` if the passed object can be found in the array. - This method is a Polyfill for ES 2016 Array.includes. - If no `startAt` argument is given, the starting location to - search is 0. If it's negative, searches from the index of - `this.length + startAt` by asc. - ```javascript - [1, 2, 3].includes(2); // true - [1, 2, 3].includes(4); // false - [1, 2, 3].includes(3, 2); // true - [1, 2, 3].includes(3, 3); // false - [1, 2, 3].includes(3, -1); // true - [1, 2, 3].includes(1, -1); // false - [1, 2, 3].includes(1, -4); // true - [1, 2, NaN].includes(NaN); // true - ``` - @method includes - @param {Object} obj The object to search for. - @param {Number} startAt optional starting location to search, default 0 - @return {Boolean} `true` if object is found in the array. - @public -*/ - -// SameValueZero comparison (NaN !== NaN) enifed('ember-runtime/mixins/comparable', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { 'use strict'; /** @module ember @@ -33765,10 +33988,11 @@ @param {Object} obj The object to search for. @return {Boolean} `true` if object is found in enumerable. @public */ contains: function (obj) { + if (false) {} var found = this.find(function (item) { return item === obj; }); @@ -34547,58 +34771,101 @@ return 0; }); } }); - Enumerable.reopen({ - /** - Returns a new enumerable that contains only items containing a unique property value. - The default implementation returns an array regardless of the receiver type. - ```javascript - var arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }]; - arr.uniqBy('value'); // [{ value: 'a' }, { value: 'b' }] - ``` - @method uniqBy - @return {Ember.Enumerable} - @public - */ + if (true) { + Enumerable.reopen({ + /** + Returns a new enumerable that contains only items containing a unique property value. + The default implementation returns an array regardless of the receiver type. + ```javascript + var arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }]; + arr.uniqBy('value'); // [{ value: 'a' }, { value: 'b' }] + ``` + @method uniqBy + @return {Ember.Enumerable} + @public + */ - uniqBy: function (key) { - var ret = emberA(); - var seen = new _emberMetalEmpty_object.default(); + uniqBy: function (key) { + var ret = emberA(); + var seen = new _emberMetalEmpty_object.default(); - this.forEach(function (item) { - var guid = _emberMetalUtils.guidFor(_emberMetalProperty_get.get(item, key)); - if (!(guid in seen)) { - seen[guid] = true; - ret.push(item); + this.forEach(function (item) { + var guid = _emberMetalUtils.guidFor(_emberMetalProperty_get.get(item, key)); + if (!(guid in seen)) { + seen[guid] = true; + ret.push(item); + } + }); + + return ret; + } + }); + } + + if (false) { + Enumerable.reopen({ + /** + Returns `true` if the passed object can be found in the enumerable. + ```javascript + [1, 2, 3].includes(2); // true + [1, 2, 3].includes(4); // false + [1, 2, undefined].includes(undefined); // true + [1, 2, null].includes(null); // true + [1, 2, NaN].includes(NaN); // true + ``` + @method includes + @param {Object} obj The object to search for. + @return {Boolean} `true` if object is found in the enumerable. + @public + */ + includes: function (obj) { + + var len = _emberMetalProperty_get.get(this, 'length'); + var idx, next; + var last = null; + var found = false; + + var context = popCtx(); + + for (idx = 0; idx < len && !found; idx++) { + next = this.nextObject(idx, last, context); + + found = obj === next || obj !== obj && next !== next; + + last = next; } - }); - return ret; - } - }); - exports.default = Enumerable; -}); + next = last = null; + context = pushCtx(context); -/** - Returns `true` if the passed object can be found in the enumerable. - ```javascript - [1, 2, 3].includes(2); // true - [1, 2, 3].includes(4); // false - [1, 2, undefined].includes(undefined); // true - [1, 2, null].includes(null); // true - [1, 2, NaN].includes(NaN); // true - ``` - @method includes - @param {Object} obj The object to search for. - @return {Boolean} `true` if object is found in the enumerable. - @public -*/ -// nothing to do + return found; + }, -// SameValueZero comparison (NaN !== NaN) + without: function (value) { + if (!this.includes(value)) { + return this; // nothing to do + } + + var ret = emberA(); + + this.forEach(function (k) { + // SameValueZero comparison (NaN !== NaN) + if (!(k === value || k !== k && value !== value)) { + ret[ret.length] = k; + } + }); + + return ret; + } + }); + } + + exports.default = Enumerable; +}); enifed('ember-runtime/mixins/evented', ['exports', 'ember-metal/mixin', 'ember-metal/events'], function (exports, _emberMetalMixin, _emberMetalEvents) { 'use strict'; /** @module ember @@ -35188,11 +35455,15 @@ @public */ addObject: function (obj) { var included; - included = this.contains(obj); + if (false) { + included = this.includes(obj); + } else { + included = this.contains(obj); + } if (!included) { this.pushObject(obj); } @@ -36838,11 +37109,15 @@ desc.set(this, keyName, value); } else { if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) { this.setUnknownProperty(keyName, value); } else { - this[keyName] = value; + if (false) { + _emberMetalProperties.defineProperty(this, keyName, null, value); // setup mandatory setter + } else { + this[keyName] = value; + } } } } } } @@ -37344,11 +37619,10 @@ exports.default = CoreObject; }); // 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. -// setup mandatory setter /** Defines the properties that will be concatenated from the superclass (instead of overridden). By default, when you extend an Ember class a property defined in @@ -38027,11 +38301,11 @@ this.arrayContentWillChange(idx, amt, len); if (len === 0) { this.splice(idx, amt); } else { - _emberMetalReplace._replace(this, idx, amt, objects); + _emberMetalReplace.default(this, idx, amt, objects); } this.arrayContentDidChange(idx, amt, len); return this; }, @@ -38735,13 +39009,16 @@ 'use strict'; var compile, compileSpec, compileOptions; // Note we don't really want to expose this from main file + if (false) { + compileOptions = _require.default('ember-glimmer-template-compiler/system/compile-options').default; + } else { + compileOptions = _require.default('ember-htmlbars-template-compiler/system/compile-options').default; + } - compileOptions = _require.default('ember-htmlbars-template-compiler/system/compile-options').default; - exports.default = function (string) { if ((!compile || !compileSpec) && _require.has('htmlbars-compiler/compiler')) { var Compiler = _require.default('htmlbars-compiler/compiler'); compile = Compiler.compile; @@ -38782,13 +39059,16 @@ exports.default = pickCompiler; function pickCompiler() { var compiler = undefined; + if (false) { + compiler = _require.default('ember-glimmer-template-compiler'); + } else { + compiler = _require.default('ember-htmlbars-template-compiler'); + } - compiler = _require.default('ember-htmlbars-template-compiler'); - return compiler; } }); enifed('ember-template-compiler/index', ['exports', 'ember-template-compiler/compat', 'ember-metal', 'ember-template-compiler/system/precompile', 'ember-template-compiler/system/compile', 'ember-template-compiler/system/register-plugin', 'ember-template-compiler/system/compile-options', 'ember-template-compiler/system/template'], function (exports, _emberTemplateCompilerCompat, _emberMetal, _emberTemplateCompilerSystemPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemRegisterPlugin, _emberTemplateCompilerSystemCompileOptions, _emberTemplateCompilerSystemTemplate) { 'use strict'; @@ -39447,50 +39727,78 @@ }); enifed('ember-templates/component', ['exports', 'ember-metal/features', 'require'], function (exports, _emberMetalFeatures, _require) { 'use strict'; exports.default = (function () { - return _require.default('ember-htmlbars/component').default; + if (false) { + return _require.default('ember-glimmer/component').default; + } else { + return _require.default('ember-htmlbars/component').default; + } })(); }); enifed('ember-templates/components/checkbox', ['exports', 'ember-metal/features', 'require'], function (exports, _emberMetalFeatures, _require) { 'use strict'; exports.default = (function () { - return _require.default('ember-htmlbars/components/checkbox').default; + if (false) { + return _require.default('ember-glimmer/components/checkbox').default; + } else { + return _require.default('ember-htmlbars/components/checkbox').default; + } })(); }); enifed('ember-templates/components/link-to', ['exports', 'ember-metal/features', 'require'], function (exports, _emberMetalFeatures, _require) { 'use strict'; exports.default = (function () { - return _require.default('ember-htmlbars/components/link-to').default; + if (false) { + return _require.default('ember-glimmer/components/link-to').default; + } else { + return _require.default('ember-htmlbars/components/link-to').default; + } })(); }); enifed('ember-templates/components/text_area', ['exports', 'ember-metal/features', 'require'], function (exports, _emberMetalFeatures, _require) { 'use strict'; exports.default = (function () { - return _require.default('ember-htmlbars/components/text_area').default; + if (false) { + return _require.default('ember-glimmer/components/text_area').default; + } else { + return _require.default('ember-htmlbars/components/text_area').default; + } })(); }); enifed('ember-templates/components/text_field', ['exports', 'ember-metal/features', 'require'], function (exports, _emberMetalFeatures, _require) { 'use strict'; exports.default = (function () { - return _require.default('ember-htmlbars/components/text_field').default; + if (false) { + return _require.default('ember-glimmer/components/text_field').default; + } else { + return _require.default('ember-htmlbars/components/text_field').default; + } })(); }); enifed('ember-templates/helper', ['exports', 'ember-metal/features', 'require'], function (exports, _emberMetalFeatures, _require) { 'use strict'; exports.default = (function () { - return _require.default('ember-htmlbars/helper').default; + if (false) { + return _require.default('ember-glimmer/helper').default; + } else { + return _require.default('ember-htmlbars/helper').default; + } })(); var helper = (function () { - return _require.default('ember-htmlbars/helper').helper; + if (false) { + return _require.default('ember-glimmer/helper').helper; + } else { + return _require.default('ember-htmlbars/helper').helper; + } })(); exports.helper = helper; }); enifed('ember-templates/index', ['exports', 'ember-metal/core', 'ember-templates/template_registry', 'ember-templates/bootstrap', 'ember-templates/renderer', 'ember-templates/component', 'ember-templates/helper', 'ember-templates/components/checkbox', 'ember-templates/components/text_field', 'ember-templates/components/text_area', 'ember-templates/components/link-to'], function (exports, _emberMetalCore, _emberTemplatesTemplate_registry, _emberTemplatesBootstrap, _emberTemplatesRenderer, _emberTemplatesComponent, _emberTemplatesHelper, _emberTemplatesComponentsCheckbox, _emberTemplatesComponentsText_field, _emberTemplatesComponentsText_area, _emberTemplatesComponentsLinkTo) { 'use strict'; @@ -39526,21 +39834,33 @@ // reexports enifed('ember-templates/renderer', ['exports', 'ember-metal/features', 'require'], function (exports, _emberMetalFeatures, _require) { 'use strict'; var InteractiveRenderer = (function () { - return _require.default('ember-htmlbars/renderer').InteractiveRenderer; + if (false) { + return _require.default('ember-glimmer/renderer').InteractiveRenderer; + } else { + return _require.default('ember-htmlbars/renderer').InteractiveRenderer; + } })(); exports.InteractiveRenderer = InteractiveRenderer; var InertRenderer = (function () { - return _require.default('ember-htmlbars/renderer').InertRenderer; + if (false) { + return _require.default('ember-glimmer/renderer').InertRenderer; + } else { + return _require.default('ember-htmlbars/renderer').InertRenderer; + } })(); exports.InertRenderer = InertRenderer; var Renderer = (function () { - return _require.default('ember-htmlbars/renderer').Renderer; + if (false) { + return _require.default('ember-glimmer/renderer').Renderer; + } else { + return _require.default('ember-htmlbars/renderer').Renderer; + } })(); exports.Renderer = Renderer; }); enifed("ember-templates/template_registry", ["exports"], function (exports) { // STATE within a module is frowned apon, this exists @@ -40743,12 +41063,11 @@ return this; }, /** - @private - Creates a new DOM element, renders the view into it, then returns the + Creates a new DOM element, renders the view into it, then returns the element. By default, the element created and rendered into will be a `BODY` element, since this is the default context that views are rendered into when being inserted directly into the DOM. ```js @@ -42880,14 +43199,16 @@ function acceptExpression(node, env, scope) { var ret = { value: null }; // Primitive literals are unambiguously non-array representations of // themselves. - if (typeof node !== 'object' || node === null) { - ret.value = node; - } else { + if (Array.isArray(node)) { + // if (node.length !== 7) { throw new Error('FIXME: Invalid statement length!'); } + ret.value = evaluateNode(node, env, scope); + } else { + ret.value = node; } return ret; } @@ -44433,17 +44754,18 @@ for (var key in attributes) { if (typeof attributes[key] === 'string') { continue; } - statements.push(["attribute", key, attributes[key]]); + + statements.push(_htmlbarsUtilTemplateUtils.buildStatement("attribute", key, attributes[key])); } var isEmpty = _isEmpty || _htmlbarsUtilVoidTagNames.default[tagName]; if (!isEmpty) { - statements.push(['content', 'yield']); + statements.push(_htmlbarsUtilTemplateUtils.buildStatement('content', 'yield')); } var template = { arity: 0, cachedFragment: null, @@ -44501,11 +44823,11 @@ for (var key in attributes) { if (typeof attributes[key] === 'string') { continue; } - statements.push(["attribute", key, attributes[key]]); + statements.push(_htmlbarsUtilTemplateUtils.buildStatement("attribute", key, attributes[key])); } var template = { arity: 0, cachedFragment: null, @@ -45125,15 +45447,17 @@ exports.default = _htmlbarsUtilHandlebarsSafeString.default; }); enifed("htmlbars-util/template-utils", ["exports", "htmlbars-util/morph-utils", "htmlbars-runtime/render"], function (exports, _htmlbarsUtilMorphUtils, _htmlbarsRuntimeRender) { "use strict"; + var _slice = Array.prototype.slice; exports.RenderState = RenderState; exports.blockFor = blockFor; exports.renderAndCleanup = renderAndCleanup; exports.clearMorph = clearMorph; exports.clearMorphList = clearMorphList; + exports.buildStatement = buildStatement; function RenderState(renderNode, morphList) { // The morph list that is no longer needed and can be // destroyed. this.morphListToClear = morphList; @@ -45322,9 +45646,20 @@ } // Remove the MorphList from the morph. morphList.clear(); morph.morphList = null; + } + + function buildStatement() { + var statement = [].concat(_slice.call(arguments)); + + // ensure array length is 7 by padding with 0 + for (var i = arguments.length; i < 7; i++) { + statement[i] = 0; + } + + return statement; } }); enifed("htmlbars-util/void-tag-names", ["exports", "htmlbars-util/array-utils"], function (exports, _htmlbarsUtilArrayUtils) { "use strict";